Posts

scala - What is the difference between val b=a (a is an Array) and val b=a.clone()? -

I am reading scaladocs and am thinking the difference between direct assignment and .clone method. val a = array (1,2,3,4,5) case 1: val B = a Case 2: val b = a.clone () Consider: scala> Val a = array (1,2,3,4,5) a: array [int] = array (1, 2, 3, 4, 5) scale & gt; Well B = A B: Array [int] = Array (1, 2, 3, 4, 5) Scale & gt; Val c = a.clone () c: Array [Int] = Array (1, 2, 3, 4, 5) Scale & gt; B (0) = 0 Scala & gt; C (1) = 1 Scala & gt; A res2: array [int] = array (0, 2, 3, 4, 5) scale & gt; BR3: Array [int] = array (0, 2, 3, 4, 5) scale & gt; C rays 4: array [int] = array (1, 1, 3, 4, 5) As you can see, when you val b = a , then a and b point to the same object when the object changes, the change will be seen by both. On the other hand, when you clone the array, you create a new array with the same content. Changing this new array does not change the old.

language agnostic - Non-recursive algorithms for ordered traversing -

Based on the following techniques, there is a family of connective algorithms - we inspect some assets of the structure and use that property Without the linear, then without the linear time is the time for all possible / accessible variations (or closing, which really does not matter), example Lexicographic Permutation a .. a [n] Find previous [k] such as [k] Find [K + 1] in the minimum [M]. An [N] is such that [k] A [M] Swap [M] and [K] Reject one's [1]. A [n] n-k-subset Repeat from the end, first get zero, first 1 (first Count a [k] == 0 as [k1] one. [N] rebelance - 1] a [k] = 1 The division of n (in descending order) First Kashmir like [k] Increase a [k] = a [k] + 1 The number of elements of Kashmir is the last one Allows left neighbors as long as 1. I think it is enough to clarify the nature of such algorithms, and some other examples can be found in excellent, magnificent "book." My question is the following: In an...

dynamic jasper report multi row header -

Using "dynamic jasper", how do you create a table heading (adcum) in which there are several rows? For example HEADING1 | HEADING2 | HEADING3 HEADING4 | HEADING5 | HEADING6 HEADING7 | HEADING8 | HEADING9 ================================================= ==== VALUEFORHEADING1, VALUEFORHEADING2, VALUEFORHEADING3 VALUEFORHEADING4, VALUEFORHEADING5, VALUEFORHEADING6 VALUEFORHEADING7, VALUEFORHEADING8, VALUEFORHEADING9 ------------------------------- ---------------------- VALUEFORHEADING1, VALUEFORHEADING2, VALUEFORHEADING3 VALUEFORHEADING4, VALUEFORHEADING5, VALUEFORHEADING6 VALUEFORHEADING7, VALUEFORHEADING8, VALUEFORHEADING9 ------------- ----------------------------------------- Thanks UPDATE Or any other LIBs that can generate this kind of dynamic Jasper report? It is not possible in the DJ, but it is possible to use it, it is a / Div>

image - Producing a printable calendar with Python -

How can I create a printable PDF file (US letter size) such that every page is a month Represents and divides in such a way that the day of the month gets a box of equal size? What if I want to leave the weekend and only want to work in weekdays? Which Python module will I use to complete the following? : Splitting the image, such as the day of every day. Repeat 2-3 steps for all months in a fixed year Creating a PDF as a Production You can do it with 3 packages. To create a PDF, 'report lab', 'Calendar' to get the month as lists, and dragon binding PDF for 'ghostscript' to convert to PGF. You will start receiving data from the calendar package, in the U.S. Using the REPUBLOW to create a page of letter size. The table can be manipulated to make a grid, each cell should be placed in a box of the same size and the text font, size and alignment must be changed. You want it to be only a PDF, or you can convert this PDF into an image Ghost...

iphone - Apple not currently accepting applications built with this version of the sdk (Xcode 4.2, iOS SDK 4.3) -

I think there are 2000 other SO posts on this question, but what I have seen is Xcode 4.2 and iOS SDK Specific to 4.3 I am thinking that no one knows the setting which I am probably remembering. I have set up the base SDK in my project and it is of no use to target the build settings panels on iOS 4.3. FWID seems to be getting warnings of construction that all SDK 5.0 related boycotts are occurring. Are there any other project / target settings, which I'm missing, or is this a lost cause which is 4.3 app in Xcode 4.2? Xcode 4.2 has not been officially released. Still in beta, you can not submit an app created with it. Use Xcode 4.0.1 (Snow Leopard) or 4.1 (Lion). [4.1 is also available for Snow Leopard, if you can download it ...]

osx - "Double dot" directory name in C? -

I am writing a program for the class, and I'm thinking about the output for a little code. I have such a code: DIR * dir = opendir ("."); Struct dirent * Reader; While ((reader = readdir (dir))! = NULL) {// Print the name of the path found by the reader. } Now it is fine and all works, but I have noticed that the first two entries are always: . .. // Here rest files Now I'm assuming the first dot . is just the name of the current directory, but what is the second double? I know cd .. you have to go up in the file hierarchy, but I have no clue why this output is being made while reading subdirectory names me The reason for being worried is that I want to go to all the files continuously, but if I pass through .. , then the first directory name of it . , which causes a loop, how can I avoid it? .. is the root directory unless you are on file system root , Then it is similar to the root directory. Actually you want to see that your dir var...

c# - Start Debugger in Code -

I need to debug an application that was started from one-click install. (VS 2010, Excel VSTO Office 7). Based on the login credentials given to the one-click installer application, the user should be shown one of two splash pages. All of this works fine on my machine, but when deployed, the result changes in error from default to second slash page. For my life, how can I debug the process from within VS2010, I can attach to the login before entering the credentials, but I can not add Excel because it does not launch until I have not clicked okay button until it is done. So, is there a way to get excel, or instead, my code calls the debugger because it is so instant, so I can understand why my image processing is not available in the deployed application. ? thanks randy system Diagnostics. Debugger. Launch ();