Search Results

Search found 6094 results on 244 pages for 'double gras'.

Page 122/244 | < Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >

  • Java weird generic return type

    - by drozzy
    Browsing through Guava libraries I saw this weird signature on a readLines method from Files class: public static <T> T readLines(File file, Charset charset, LineProcessor<T> callback) I know a little bit about generics in java, but this baffled me. What does the double T mean here? And why is the first one in angled brackets?

    Read the article

  • How can I manually interpolate string escapes in a Perl string?

    - by Ryan Thompson
    In perl suppose I have a string like 'hello\tworld\n', and what I want is: 'hello world ' That is, "hello", then a literal tab character, then "world", then a literal newline. Or equivalently, "hello\tworld\n" (note the double quotes). In other words, is there a function for taking a string with escape sequences and returning an equivalent string with all the escape sequences interpolated?

    Read the article

  • Visual Studio appears to randomly adopt american keyboard layout

    - by HollyStyles
    Gah! this is really causing me hassle today. Suddenly without warning '@' (at symbol) and '"' (double quote) are trading places on my keyboard but ONLY in Visual Studio 2008 !!! I can't seem to find anything in help or online to explain/remedy this. Is there some keyboard shortcut I am inadvertantly executing?? I rebooted my PC and it went away for an hour or two and then suddenly came back. Oh the insanity :(

    Read the article

  • Explain this C++ operator definition

    - by David Johnstone
    I have the following operator defined in a C++ class called StringProxy: operator std::string&() { return m_string; } a) What is this and how does this work? I understand the idea of operator overloading, but they normally look like X operator+(double i). b) Given an instance of StringProxy, how can I use this operator to get the m_string?

    Read the article

  • WPF multibound textblock not updating

    - by Superstringcheese
    I want to create a program which calculates how long it will take to repeat a process a certain number of times. I've scaled this down a lot for this example. So, I have some textboxes which are bound to properties in a class: Count: <TextBox x:Name="txtCount" Text="{Binding Count, Mode=TwoWay}" Width="50"/> Days: <TextBox x:Name="txtDays" Text="{Binding Days, Mode=TwoWay}" Width="50"/> and a textblock which is multibound like so: <TextBlock x:Name="tbkTotal"> <TextBlock.Text> <MultiBinding StringFormat="Days: {0}, Count: {1}"> <Binding Path="Days" /> /* This isn't updating */ <Binding Path="Count" /> </MultiBinding> </TextBlock.Text> </TextBlock> My DataContext is set in the Window1.xaml.cs file. public Window1() { InitializeComponent(); Sample sample = new Sample(); this.DataContext = sample; } I can update the multibound textblock with the Count property just fine, but the Days property always shows 0, even though the Days input accurately reflects changes. I believe that this is because my accessors are different for Days - namely, the Set method. This class is in a different file. public class Sample : INotifyPropertyChanged { private int _count; private TimeSpan _span; public int Count { get { return _count; } set { _count = value; NotifyPropertyChanged("Count"); /* Doesn't seem to be needed, actually */ } } public TimeSpan Span { get { return _span; } } /* The idea is to provide a property for Days, Hours, Minutes, etc. as conveniences to the inputter */ public double Days { get { return _span.Days; } set { TimeSpan ts = new TimeSpan(); double val = value > 0 ? value : 0; ts = TimeSpan.FromDays(val); _span.Add(ts); NotifyPropertyChanged("Span"); /* Here I can only get it to work if I notify that Span has changed - doesn't seem to be aware that the value behind Days has changed. */ } } private void NotifyPropertyChanged(string property) { if (null != this.PropertyChanged) { PropertyChanged(this, new PropertyChangedEventArgs(property)); } } public Sample() { _count = 0; _span = new TimeSpan(); } public event PropertyChangedEventHandler PropertyChanged; }

    Read the article

  • Why doesn't MongoDb store my slashes in this string?

    - by Rob Dudley
    Can anyone tell me why this command doesn't work from the MongoDB shell client: db.coll.update({'live':true},{$set:{'mask':"\D\D\D\D\D\D\D\D"}},false,true) but db.coll.findOne({'id':'someId'}) returns the mask field as: "mask" : "DDDDDDDD", Where are the slashes going? I've tried "double escaping" with \\D and that inserts both slashes: "mask" : "\\D\\D\\D\\D\\D\\D\\D\\D", MongoDB shell version: 2.0.6, MongoDB version: 2.0.5, OSX Lion Thanks

    Read the article

  • Communicate between separate MPI-Programs

    - by Fyg
    I have the following problem: Program 1 has a huge amount of data, say 10GB. The data in question consists of large integer- and double-arrays. Program 2 has 1..n MPI processes that use tiles of this data to compute results. How can I send the data from program 1 to the MPI Processes? Using File I/O is out of question. The compute node has sufficient RAM.

    Read the article

  • softkeyboard in landscape mode does not pop up in android emulator

    - by yee-chen
    In android emulator, I am in landscape mode and double click the text edit panel. the softkeyboard does not show up. However, it works in portrait mode. I have check some of posts on line. They said because of hardkeyboard is available in landscape mode. If that so, how can i disable the hardkeyboard. Or is there any setting reason for this problem?

    Read the article

  • Extending Visual Studio with a Custom Designer

    - by Mick
    How do I create a custom Visual Studio 2008 UI designer for a C# file? For example, when you double click on a DataSet in the Solution Explorer, a UI screen appears that allows you to edit the DataSet, even though it is defined in XML/code (which you can right click and "View Code"). Usually this code is separated from user code in some way, either by region ("Windows Forms Designer Generated Code"), by codegen (".g.cs" for WPF XAML files), or some other means like partial classes.

    Read the article

  • XCode CoreData files not found/opening

    - by jAmi
    Hello, I am using the Xcode 3.1.4 that means SDK 3.1.2 The problem is that I cannot open .xcdatamodel (Core Data) file and I don't even get the Data Model option in Design Menu bar. When ever I double click and try to open the file, XCode gives me an error saying that it cannot find the file at (my project's path).Perhaps it was moved or deleted? , but the file exists at the same path. Please help me out as I haven't upgraded my system to Snow Leopard so cant use SDK 3.2 Regards jAmi

    Read the article

  • Across process marhalling problem with an array of points

    - by ElMagn
    Hi All, We have what we think is a marshalling problem with a renderer object when called across process boundaries. The renderer is an ATL COM server with a COM object that implements the IPoints interface defined below: typedef [uuid(B0E01719-005A-427c-B9DD-B42A18E969AE)] struct Point { double X; double Y; } Point; [ object, uuid(3BFECFE3-B4FB-4f14-8257-6E065D02E3B3), helpstring("IPoints Interface"), dual, ] interface IPoints : IDispatch { HRESULT DrawPolyLine([in] long hDC, [in] short count, [in, size_is(count)] Point * points ); // many more like DrawLine } The count parameter represents the number of points and the points parameter represents an array of the actual points. We have two process running, a graphical display process (GDP) and a tabular (grid) display process (TDP). A factory in the GDP, written in C#, creates the renderer and the clients of the renderer in the GDP. When the clients call into the renderer, everything displays correctly. The renderer is created at start up BTW. There is another factory in the TDP, written in VB6, that calls into the factory in the GDP to create the clients. When the clients call into the renderer, only the first point in the array is marshaled correctly, all the other points are garbage. Seems that the rendering works only when the client creation is started from the same process as the renderer. Now, i am not sure what the solution to this problem is. It seems that if we can guarantee that the clients are always created from a thread in the same GDP process as the renderer then the points are marshaled correctly. We tried using a background thread from the Thread Pool in C# and it indeed worked. The problem is that Windows Forms created from the clients stopped working because accessing the form's controls from a thread other than the thread that created the control is not allowed. We might change the calls to access the forms but we have quite a few of them and are trying to look into a different solution that might involve making changes to the renderer. The other problem is that the renderer is legacy code and we can't just change the interface. I am wondering what can we do to the renderer's interface that would help with marshalling from across process calls. Any ideas would be greatly appreciated. Regards, ElMagn

    Read the article

  • Visual Studio Question: How to go to a specific file path and line number programmatically?

    - by Jack
    In the Visual Studio output window, you can double click a line that contains a file path and line number and it automatically takes you to that location. In my program, I need to mimic this behavior and be able to click something (a button for example) and do go to a specific file and line number that I tell it to go to. Any help/suggestions would be appreciated. I am working in C#.

    Read the article

  • Fundamental types

    - by smerlin
    I always thought the following types are "fundamental types", so i thought my anwser to this question would be correct, but surprisingly it got downvoted... Searching the web, i found this. So, IBM says aswell those types are fundamental types.. Well how do you interpret the Standard, are following types (and similar types), "fundamental types" according to the c++ standard ? unsigned int signed char long double long long long long int unsigned long long int

    Read the article

  • c++ templates: problem with member specialization

    - by ChAoS
    I am attempting to create a template "AutoClass" that create an arbitrary class with an arbitrary set of members, such as: AutoClass<int,int,double,double> a; a.set(1,1); a.set(0,2); a.set(3,99.7); std::cout << "Hello world! " << a.get(0) << " " << a.get(1) << " " << a.get(3) << std::endl; By now I have an AutoClass with a working "set" member: class nothing {}; template < typename T1 = nothing, typename T2 = nothing, typename T3 = nothing, typename T4 = nothing, typename T5 = nothing, typename T6 = nothing> class AutoClass; template <> class AutoClass<nothing, nothing, nothing, nothing, nothing, nothing> { public: template <typename U> void set(int n,U v){} }; template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> class AutoClass: AutoClass<T2,T3,T4,T5,T6> { public: T1 V; template <typename U> void set(int n,U v) { if (n <= 0) V = v; else AutoClass<T2,T3,T4,T5,T6>::set(n-1,v); } }; and I started to have problems implementing the corresponding "get". This approach doesn't compile: template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> class AutoClass: AutoClass<T2,T3,T4,T5,T6> { public: T1 V; template <typename U> void set(int n,U v) { if (n <= 0) V = v; else AutoClass<T2,T3,T4,T5,T6>::set(n-1,v); } template <typename W> W get(int n) { if (n <= 0) return V; else return AutoClass<T2,T3,T4,T5,T6>::get(n-1); } template <> T1 get(int n) { if (n <= 0) return V; else return AutoClass<T2,T3,T4,T5,T6>::get(n-1); } }; Besides, it seems I need to implement get for the <nothing, nothing, nothing, nothing, nothing, nothing> specialization. Any Idea on how to solve this?

    Read the article

  • Scala println in a for loop

    - by random459
    The following Scala code does just what I expect it to - it prints each line of some_file.txt. import scala.io.Source val lines = Source.fromPath("some_file.txt").mkString for (line <- lines) print(line) If I use println instead of print, I expect to see some_file.txt printed out with double-spacing. Instead, the program prints a newline after every character of some_file.txt. Could someone explain this to me? I'm using Scala 2.8.0 Beta 1.

    Read the article

  • Why won't the following haskell code compile?

    - by voxcogitatio
    I'm in the process of writing a small lisp interpreter in haskell. In the process i defined this datatype, to get a less typed number; data Number = _Int Integer | _Rational Rational | _Float Double deriving(Eq,Show) Compiling this fails with the following error: ERROR "types.hs":16 - Syntax error in data type declaration (unexpected `|') Line 16 is the line w. the first '|' in the code above.

    Read the article

  • Fixing Floating Point Error

    - by HannesNZ
    I have some code that gets the leading value (non-zero) of a Double using normal math instead of String Math... For Example: 0.020 would return 2 3.12 would return 3 1000 should return 1 The code I have at the moment is: LeadingValue := Trunc(ResultValue * Power(10, -(Floor(Log10(ResultValue))))) However when ResultValue is 1000 then LeadingValue ends up as 0. What can I do to fix this problem I'm assuming is being caused by floating point errors? Thanks.

    Read the article

< Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >