Search results for

column

2,048 results found

Post

Replies

Boosts

Views

Activity

Reply to TabularData Framework: crash on opening CSV file
That definitely helps. Earlier I wrote: There’s clearly something wonky going on with the symbolication of frames 3 through 0 … I was hoping that a full crash report would let me do a better job of symbolication, using tools I have access to here at Apple, but that didn’t pan out. With this crash report I was able to get better symbols for those frames: 0 TabularData … DataFrame.append(column:) + 1712 … 1 TabularData … DataFrame.append(column:) + 356 … 2 TabularData … static DataFrame.loadCSV(parser:rows:schema:options:) + 700 … 3 TabularData … DataFrame.init(csvData:columns:rows:types:options:) + 1068 … 4 TabularData … DataFrame.init(contentsOfCSVFile:columns:rows:types:options:) + 648 … 5 Contacts Journal CRM … CJCSVHeaderMapper.loadInitialCSVData(withURL:) + 1680 … Remember that we’re hunting for a trap in frame 0, and looking at the code I see two potential causes of that, each with their own message: Can't insert column COL_NAME. Names must be unique within the DataFrame. Can't
Topic: Machine Learning & AI SubTopic: General Tags:
Jun ’22
Reply to Using montage video as training data for Action Classifier
Use this directoryWithVideosAndAnnotation data source (as pointed in the above link). But note that, you need to use Create ML framework to do this in Swift. The CreateML App current does not support this yet. directoryWithVideosAndAnnotation(at: URL, ===> this is your directory URL for your videos annotationFile: URL, ===> this is the CSV or JSON, or TXT annotation file URL videoColumn: String, ===> this is the video file column name string you used in your annotation file. labelColumn: String, ===> this is the label name column name string your used in your annotation file. startTimeColumn: String? = nil, ===> this is start time column, optional, if you don't provide, it assumes starting from 0 endTimeColumn: String? = nil) ===> this is end time column, optional, if you don't provide, it assumes ending at the very end.
Jun ’20
Reply to How to read and write to a table?
You haven't actually described a problem or asked a question. So:— What platform, macOS or iOS?— Are you stuck at creating the table view itself? Or at populating the rows? Or at designing the structure of the columns within the rows? Or at implementing that design?— It's not obvious how you expect to use a stepped to increment column heading values, or even what that means, really. A heading is a heading. It may contain a numeric component that increments in value across the columns (e.g.), but a stepper is a UI element that allows a user to choose a number from a range of numbers.Keep in mind that macOS table views have an explicit concept of a table column, while iOS does not. Either way, you should be able to approach a solution to your problem incrementally. Start with simple rows, and add information (and UI elements) horizontally for each of the structural pieces that you want for columns. There's no particular advantage in trying to implement all the detail
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’16
Reply to Sidebar on the right in SwiftUI
Hey, Not sure if you found your answer yet, but you might be able to achieve that with Introspect. This library lets you interact with the AppKit/UIKit framework that SwiftUI uses. I'm assuming you are not using an Catalyst app, so you would be looking at the AppKit functionality. As you can see on the GitHub page, NSSplitViewController is not implemented in the library yet, however, UISplitViewController is. If you are using Catalyst, you can just write NavigationView { // Your views here } .introspectSplitViewController { controller in // some examples controller.preferredSupplementaryColumnWidthFraction = 3 controller.preferredPrimaryColumnWidth = 180 controller.preferredDisplayMode = .twoBesideSecondary controller.presentsWithGesture = false } You can set the width of each column as you wish. 1st column = Primary 2nd column = Supplementary 3rd column = Secondary You can use preferredcolumnColumnWidth for an exact width, or preferredcolumnColumnWidthFraction for a portio
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Mac Catalyst When to Handle Setting Min/Max Size for UISplitViewController columns? Window Resize Event?
Trying to use UISplitViewController. Since this app can be run on many different monitor sizes I want to allow the splits to be resized reasonably. There is this API: //Allow setting the primary column width with point values. This is especially useful in Catalyst where the window may be resized more often. // If set to non-Automatic, takes precedence over preferredPrimaryColumnWidthFraction. @property(nonatomic, assign) CGFloat preferredPrimaryColumnWidth API_AVAILABLE(ios(14.0)); // default: UISplitViewControllerAutomaticDimension > > @property(nonatomic, assign) CGFloat minimumSupplementaryColumnWidth API_AVAILABLE(ios(14.0)); @property(nonatomic, assign) CGFloat maximumSupplementaryColumnWidth API_AVAILABLE(ios(14.0)); // An animatable property that can be used to adjust the minimum absolute width of the primary view controller in the split view controller. @property(nonatomic, assign) CGFloat minimumPrimaryColumnWidth API_AVAILABLE(ios(8.0)); // default: UISplitViewControllerAutomaticDimen
0
0
503
Oct ’22
Reply to TabularData Framework: crash on opening CSV file
Thanks! Yes, I was able to replicate the issue with a CSV file with duplicate column names, as well as with a CSV file with some extra empty columns. I guess the next question is how to best handle this situation, since this happen when I just load the CSV file into the TabularData framework and it just crashes the app. I'm not sure how to 'prepare' the file before loading it, to check for duplicate columns or extra columns etc. Because that would, y'know, require a CSV parsing framework like TabularData! I would actually assume that theTabularData framework would be able to handle these situations, and return an error instead of crashing completely. Is there any other error handling I can do to avoid the crash?
Topic: Machine Learning & AI SubTopic: General Tags:
Jun ’22
Reply to Date Conversion
Hi all! I'm starting with swift :D a question: if I'm creating a MLDateTable from a csv file, how do I convert a column from string to date?, and in another column, how do I convert the None values to 0 and double? I tried the forms above but it tells me they don't support MLDatTable.
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’22
Reply to vLookup In App?
No, the one thing I know is it starts at zero. I started the route at zero, I think I forgot to start at zero for the columns, though. I'll have to try when I have a computer near me tonight! I just wanted to make sure there was no limit, as I wanted 11 columns and 9 rows.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’16
Reply to sizing a cell in the NSOutlineView
1. Just have only one column in your NSOutlineView.2. Use the Xcode view inspector or change the alignment dynamically on the appropriate NSView if your outline view is view based.As far as I understand, by default the column is set to fit the content of the cells underneath and will resize itself if the data added will be wider.Nope. The column width does not dynamically adjust to the contents of the cell. At least that's how it works when AutoLayout is disabled. And I don't remember it working differently when AutoLayout is enabled.
Topic: UI Frameworks SubTopic: AppKit Tags:
Feb ’20
Reply to create csv or xls file
XLS files are complex so I’m going to ignore that.CSV files are a lot less complex—although more complex than most folks think—so I’ll focus there. Here’s some simplifying assumptions:you’re build an iOS or Mac app, and thus have access to Foundationthe data will be small enough to fit in memory easilythe text encoding will be UTF-8the line breaks will be Windows style (CR LF)the items won’t include any weird characters (like CR or LF)Based on those requirements, here’s an implementation that optimised for readability:import Foundation func quoteColumn(column: String) -> String { if column.containsString(,) || column.containsString() { return + column.stringByReplacingOccurrencesOfString(, withString: ) + } else { return column } } func commaSeparatedValueStringForColumns(columns: [String]) -> String { return columns.map {column in quoteColumn(column) }.joinWithSeparator(,) } func commaSeparatedValueDataForLines(lines: [[String]]) -> NSData { return line
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’15