cell

matlab文件处理

丶灬走出姿态 提交于 2019-12-06 14:21:06
1、读取文件(按行读取) fid = open('file_name');while(~feof(fid)) line = fgetl(fid); % 读取一行数据 endfid.close(); 2、正则表达式split字符串 1 while(~feof(fid)) 2 line = fgetl(fid); 3 % 第一个参数为要处理字符串;第二个参数为正则表达式;第三个参数为如何处理正则表达式;可以是match、split 4 data = regexp(line, '\s+', 'split'); % 返回值为split后是cell数组 5 end 3、cell数据拼接 cell_a = {'ss'}; cell_b = {'cc'}; cell_c = [cell_a,cell_b]; % 这里使用的是方括号,而不是花括号 4、cell数据选取 cell = {'1','2','3'}; cell_3 = cell{3}; % cell第3个元素 5、cell元素个数 cell = {'1','2','3'}; numel(cell); % 输出3 6、字符串拼接 str1 = 'abc'; str2 = 'efg'; str3 = [str1,str2,'xyz']; % str3为'abcefgxyz' 7、 执行文本命令(可以用字符串来当做命令来执行) str =

get cell number within a distance of one point (raster)

旧街凉风 提交于 2019-12-06 13:38:29
I need to get the cell numbers within a distance (e.g., 10 km) of one point using R, but I didn't figure out how to handle it for the raster data. library(raster) r <- raster(ncols=10, nrows=10) cellFromXY(r, c(2,2)) # get the cell number of one point How to get the cell numbers within a distance of one point? Use extract with the buffer option and cellnumbers=TRUE r <- raster(ncols=100, nrows=100) r[]<-runif(ncell(r)) xy <- cbind(-50, seq(-80, 80, by=20)) extract(r, xy[1:3,], buffer=1000000,cellnumbers=TRUE) 来源: https://stackoverflow.com/questions/13996256/get-cell-number-within-a-distance-of

UPDATE cell to be empty MYSQL PHP

吃可爱长大的小学妹 提交于 2019-12-06 13:31:18
Looked around on Google and Stack Overflow, maybe I'm just blind though. Is there a way to UPDATE a table cell with an " " (empty) value. Let's say like: mysql_query("UPDATE table SET cellname = ' ' WHERE id = '$idneeded'"); Any help much appreciated. you should know that empty string '' is not same as space string ' ' and not same as NULL value. to update the cell value to empty string : mysql_query("UPDATE table SET cellname = '' WHERE id = '$idneeded'"); UPDATE table SET cellname = ' ' WHERE id = '$idneeded' ^^^---not empty. spaces are not "empty". Try cellname='' or cellname=NULL instead.

iphone tableview with a lot of images

本秂侑毒 提交于 2019-12-06 11:07:34
问题 I have a UITableView that displays a lot of images in the cells, and i am not quit happy about the scroll performance. My UITableView is something like the photo app on the iphone. Does anybody knows why the iphone foto app scrolls so damn fast as if their's nothing on the screen. And does anybody has some tips/tricks to increase my performance/scrolling speed? 回答1: You should precache your images and not do it lazily. As you scroll your table the UITableViewDataSource:cellForRowAtIndexPath:

Excel: if duplicate cell value found in another column then highlight green

人走茶凉 提交于 2019-12-06 09:32:58
Can someone help me, I'm not sure what formula to use. I have highlighted the cell in the picture to show an example of what I mean. What I want to do is highlight the cell in column A where the value matches a value in column D, it does not have to be in the same row. If there is a duplicate value in column D then highlight the cell in column A green. Thanks for any help given. Try this as the conditional format formula =MATCH(A1,$D:$D,0) 来源: https://stackoverflow.com/questions/16559207/excel-if-duplicate-cell-value-found-in-another-column-then-highlight-green

How to skip over particular cells when tabbing through an Ext grid?

吃可爱长大的小学妹 提交于 2019-12-06 09:31:51
I have a grid panel where some cells are editable, and others aren't. I'd like to make it so that when you tab through the grid with your keyboard, the non-editable cells are skipped over i.e. never get selected. Here's my simple grid so far: var store = Ext.create('Ext.data.Store', { fields:['name', 'age', 'country'], data:[ {name:'Lisa', age:13, country: 'USA'}, {name:'Bart', age:75, country: 'France'}, {name:'Homer', age:32, country: 'Germany'}, {name:'Marge', age:56, country: 'Australia'} ] }); var grid = Ext.create('Ext.grid.Panel', { title: 'People', store: store, columns: [ {header:

jQuery - OnClick, change background color for table cells

二次信任 提交于 2019-12-06 09:24:06
Let me show you a demo: here it is working for only rows. its not working for cells. i want to change cells' (tds') background colors with mouse clicks. For example: a have a table, and it has 4 tds. table's background color is white. if i click to a td, a td should be red, than if i click to b, b td should be red and a td should be white again. if i click to c than, c should be red and b should be white right now. A - B C - D Try updating the JavaScript to: $( function() { $('td').click( function() { $(this).parents('table').find('td').each( function( index, element ) { $(element).removeClass

iOS 如何解决UITableView刷新卡顿现象

隐身守侯 提交于 2019-12-06 08:47:59
对之前的项目总结一下: 事情是这样的,我需要在定制Cell完成新闻类app的展示 虽然说SDWebImage提供了一个方法,异步加载图片到UIImageView上 但是,有些时候。需要的图片并不是需要铺满UIImageView 于是就抛弃了,后来想想还是挺二逼的。我可以在下面在铺一层边框 UIImageView也能达到这个效果 于是乎,故作高大上,非要自己写。 后来看别人的方法,找到点感觉,还是写出来了,不过还是建立在网络良好的情况下 解决办法 主要要做到一下几个方面: 1.除了UI部分,所有的加载操作都在后台完成。这一点可以通过dispatch或者performSelectorInBackground或者NSOperationQueue来实现。见:在iOS开发中利用GCD进行多线程编程iOS开发中使用NSOperationQueue进行多线程操作 2.避免后台加载完成多个资源之后集中到达占用UI线程的处理时间太长。这一点可以通过NSOperationQueue来实现,将资源到UI的展现过程放在队列中逐个执行,且在每个操作完成之后进行强制等待,可以用usleep(int microSeconds)来解决。 3.重用cell。创建cell一般是很慢的,一定要重用,甚至为了performance,可以在view创建之初就创建足够多的cell在重用队列中。 来源: oschina 链接:

代码创建UITableView的诡异

人走茶凉 提交于 2019-12-06 08:45:55
昨天在折腾UITableView,最终想实现的效果是在UITableViewCell里添加UIScrollView, 效果图如下: 初步设计是用代码生成UITableView,所以没有用到IB来创建 View等控件。 几经波折,在自定义TableViewCell里成功添加了UIScrollView,而scrollview里面动态添加了N张远程图片。 但是Cell的高度始终都是原始的44像素,由于Cell里面的图片都是有固定大小,所以在 -( CGFloat )tableView:( UITableView *)tableView heightForRowAtIndexPath:( NSIndexPath *)indexPath { return 128.0 ; } 但Cell死活都是不变。经过一翻搜索,几乎无答案。最后自己再翻查ViewDidLoad,发现在初始化UITableView的时候只设置了dataSource,却没有设置delegate self . PhotoDetailTable = [[ UITableView alloc ] initWithFrame : CGRectMake ( 0 , 0 , screenFrame. size . width , screenFrame. size . height - 93 ) style :

IOS TableView Cell重用机制及TableView

若如初见. 提交于 2019-12-06 08:45:41
IOS TableView Cell重用机制及TableView常用Code2013-03-28 10:36:47 我来说两句 作者:lianbaixue 收藏 我要投稿 创建UITableViewController子类的实例后,IDE生成的代码中有如下段落: [cpp] view plaincopy - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = [NSString stringWithFormat:@"Cell"]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } //config the cell return cell; }