开源提示框SVProgressHUD使用备忘录

涨薪技术|Kubernetes(k8s)环境部署实战 这两者都是在/etc/docker/daemon.json里修改的,所以我们一起配置了就好了,首先执行下述命令编辑daemon.json:​​​​​​​。安装完成后,可以使用以下命令来查看dashboard访问的端口号​​​​​​​。网络插件CNI也是以容器的方式进行启动​​​​​​​。安装完成后可以检查是否拉取了对应的容器​​​​​​​。再使用以下命令进行安装:​​​​​​​。打开后输入以下内容:​​​​​​​。安装1.19.0版本​​​​​​​。修改IP地址:​​​​​​​。 阅读详情

https://github.com/samvermette/SVProgressHUD

//
//  SVProgressHUD.h
//
//  Created by Sam Vermette on 27.03.11.
//  Copyright 2011 Sam Vermette. All rights reserved.
//
//  https://github.com/samvermette/SVProgressHUD
//

#import <UIKit/UIKit.h>
#import <AvailabilityMacros.h>

enum {
    SVProgressHUDMaskTypeNone = 1, // allow user interactions while HUD is displayed(允许用户进行其他界面操作)
    SVProgressHUDMaskTypeClear,    // don't allow(不允许用户进行其他界面操作)
    SVProgressHUDMaskTypeBlack,    // don't allow and dim the UI in the back of the HUD(不允许用户进行其他界面操作)
    SVProgressHUDMaskTypeGradient  // don't allow and dim the UI with a a-la-alert-view bg gradient(不允许用户进行其他界面操作)
};

typedef NSUInteger SVProgressHUDMaskType;

@interface SVProgressHUD : UIView

// 下列函数展示提示框
+ (void)show;
+ (void)showWithStatus:(NSString*)status;
+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType;

+ (void)showSuccessWithStatus:(NSString*)string;
+ (void)showSuccessWithStatus:(NSString *)string duration:(NSTimeInterval)duration;
+ (void)showErrorWithStatus:(NSString *)string;
+ (void)showErrorWithStatus:(NSString *)string duration:(NSTimeInterval)duration;

// 改变当前正在展示的提示框文字
+ (void)setStatus:(NSString*)string; // change the HUD loading status while it's showing

// 下列函数关闭当前提示
+ (void)dismiss; // simply dismiss the HUD with a fade+scale out animation
+ (void)dismissWithSuccess:(NSString*)successString; // also displays the success icon image
+ (void)dismissWithSuccess:(NSString*)successString afterDelay:(NSTimeInterval)seconds;
+ (void)dismissWithError:(NSString*)errorString; // also displays the error icon image
+ (void)dismissWithError:(NSString*)errorString afterDelay:(NSTimeInterval)seconds;

+ (BOOL)isVisible;

@end


//
//  SVProgressHUD.m
//
//  Created by Sam Vermette on 27.03.11.
//  Copyright 2011 Sam Vermette. All rights reserved.
//
//  https://github.com/samvermette/SVProgressHUD
//

#import "SVProgressHUD.h"
#import <QuartzCore/QuartzCore.h>

@interface SVProgressHUD ()

@property (nonatomic, readwrite) SVProgressHUDMaskType maskType;
@property (nonatomic, strong, readonly) NSTimer *fadeOutTimer;

@property (nonatomic, strong, readonly) UIWindow *overlayWindow;
@property (nonatomic, strong, readonly) UIView *hudView;
@property (nonatomic, strong, readonly) UILabel *stringLabel;
@property (nonatomic, strong, readonly) UIImageView *imageView;
@property (nonatomic, strong, readonly) UIActivityIndicatorView *spinnerView;

@property (nonatomic, readonly) CGFloat visibleKeyboardHeight;

- (void)showWithStatus:(NSString*)string maskType:(SVProgressHUDMaskType)hudMaskType networkIndicator:(BOOL)show;
- (void)setStatus:(NSString*)string;
- (void)registerNotifications;
- (void)moveToPoint:(CGPoint)newCenter rotateAngle:(CGFloat)angle;
- (void)positionHUD:(NSNotification*)notification;

- (void)dismiss;
- (void)dismissWithStatus:(NSString*)string error:(BOOL)error;
- (void)dismissWithStatus:(NSString*)string error:(BOOL)error afterDelay:(NSTimeInterval)seconds;

@end


@implementation SVProgressHUD

@synthesize overlayWindow, hudView, maskType, fadeOutTimer, stringLabel, imageView, spinnerView, visibleKeyboardHeight;

- (void)dealloc {
	self.fadeOutTimer = nil;
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}


+ (SVProgressHUD*)sharedView {
    static dispatch_once_t once;
    static SVProgressHUD *sharedView;
    dispatch_once(&once, ^ { sharedView = [[SVProgressHUD alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; });
    return sharedView;
}


+ (void)setStatus:(NSString *)string {
	[[SVProgressHUD sharedView] setStatus:string];
}

#pragma mark - Show Methods

+ (void)show {
    [[SVProgressHUD sharedView] showWithStatus:nil maskType:SVProgressHUDMaskTypeNone networkIndicator:NO];
}

+ (void)showWithStatus:(NSString *)status {
    [[SVProgressHUD sharedView] showWithStatus:status maskType:SVProgressHUDMaskTypeNone networkIndicator:NO];
}

+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType {
    [[SVProgressHUD sharedView] showWithStatus:nil maskType:maskType networkIndicator:NO];
}

+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType {
    [[SVProgressHUD sharedView] showWithStatus:status maskType:maskType networkIndicator:NO];
}

+ (void)showSuccessWithStatus:(NSString *)string {
    [SVProgressHUD showSuccessWithStatus:string duration:1];
}

+ (void)showSuccessWithStatus:(NSString *)string duration:(NSTimeInterval)duration {
    [SVProgressHUD show];
    [SVProgressHUD dismissWithSuccess:string afterDelay:duration];
}

+ (void)showErrorWithStatus:(NSString *)string {
    [SVProgressHUD showErrorWithStatus:string duration:1];
}

+ (void)showErrorWithStatus:(NSString *)string duration:(NSTimeInterval)duration {
    [SVProgressHUD show];
    [SVProgressHUD dismissWithError:string afterDelay:duration];
}


#pragma mark - Dismiss Methods

+ (void)dismiss {
	[[SVProgressHUD sharedView] dismiss];
}

+ (void)dismissWithSuccess:(NSString*)successString {
	[[SVProgressHUD sharedView] dismissWithStatus:successString error:NO];
}

+ (void)dismissWithSuccess:(NSString *)successString afterDelay:(NSTimeInterval)seconds {
    [[SVProgressHUD sharedView] dismissWithStatus:successString error:NO afterDelay:seconds];
}

+ (void)dismissWithError:(NSString*)errorString {
	[[SVProgressHUD sharedView] dismissWithStatus:errorString error:YES];
}

+ (void)dismissWithError:(NSString *)errorString afterDelay:(NSTimeInterval)seconds {
    [[SVProgressHUD sharedView] dismissWithStatus:errorString error:YES afterDelay:seconds];
}


#pragma mark - Instance Methods

- (id)initWithFrame:(CGRect)frame {
	
    if ((self = [super initWithFrame:frame])) {
		self.userInteractionEnabled = NO;
        self.backgroundColor = [UIColor clearColor];
		self.alpha = 0;
        self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    }
	
    return self;
}

- (void)drawRect:(CGRect)rect {
    
    CGContextRef context = UIGraphicsGetCurrentContext();
    
    switch (self.maskType) {
            
        case SVProgressHUDMaskTypeBlack: {
            [[UIColor colorWithWhite:0 alpha:0.5] set];
            CGContextFillRect(context, self.bounds);
            break;
        }
            
        case SVProgressHUDMaskTypeGradient: {
            
            size_t locationsCount = 2;
            CGFloat locations[2] = {0.0f, 1.0f};
            CGFloat colors[8] = {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.75f}; 
            CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
            CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, colors, locations, locationsCount);
            CGColorSpaceRelease(colorSpace);
            
            CGPoint center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
            float radius = MIN(self.bounds.size.width , self.bounds.size.height) ;
            CGContextDrawRadialGradient (context, gradient, center, 0, center, radius, kCGGradientDrawsAfterEndLocation);
            CGGradientRelease(gradient);
            
            break;
        }
    }
}

- (void)setStatus:(NSString *)string {
	
    CGFloat hudWidth = 100;
    CGFloat hudHeight = 100;
    CGFloat stringWidth = 0;
    CGFloat stringHeight = 0;
    CGRect labelRect = CGRectZero;
    
    if(string) {
        CGSize stringSize = [string sizeWithFont:self.stringLabel.font constrainedToSize:CGSizeMake(200, 300)];
        stringWidth = stringSize.width;
        stringHeight = stringSize.height;
        hudHeight = 80+stringHeight;
        
        if(stringWidth > hudWidth)
            hudWidth = ceil(stringWidth/2)*2;
        
        if(hudHeight > 100) {
            labelRect = CGRectMake(12, 66, hudWidth, stringHeight);
            hudWidth+=24;
        } else {
            hudWidth+=24;  
            labelRect = CGRectMake(0, 66, hudWidth, stringHeight);   
        }
    }
	
	self.hudView.bounds = CGRectMake(0, 0, hudWidth, hudHeight);
	
    if(string)
        self.imageView.center = CGPointMake(CGRectGetWidth(self.hudView.bounds)/2, 36);
	else
       	self.imageView.center = CGPointMake(CGRectGetWidth(self.hudView.bounds)/2, CGRectGetHeight(self.hudView.bounds)/2);
	
	self.stringLabel.hidden = NO;
	self.stringLabel.text = string;
	self.stringLabel.frame = labelRect;
	
	if(string)
		self.spinnerView.center = CGPointMake(ceil(CGRectGetWidth(self.hudView.bounds)/2)+0.5, 40.5);
	else
		self.spinnerView.center = CGPointMake(ceil(CGRectGetWidth(self.hudView.bounds)/2)+0.5, ceil(self.hudView.bounds.size.height/2)+0.5);
}

- (void)setFadeOutTimer:(NSTimer *)newTimer {
    
    if(fadeOutTimer)
        [fadeOutTimer invalidate], fadeOutTimer = nil;
    
    if(newTimer)
        fadeOutTimer = newTimer;
}


- (void)registerNotifications {
    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(positionHUD:) 
                                                 name:UIApplicationDidChangeStatusBarOrientationNotification 
                                               object:nil];  
    
    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(positionHUD:) 
                                                 name:UIKeyboardWillHideNotification
                                               object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(positionHUD:) 
                                                 name:UIKeyboardDidHideNotification
                                               object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(positionHUD:) 
                                                 name:UIKeyboardWillShowNotification
                                               object:nil];
    
    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(positionHUD:) 
                                                 name:UIKeyboardDidShowNotification
                                               object:nil];
}


- (void)positionHUD:(NSNotification*)notification {
    
    CGFloat keyboardHeight;
    double animationDuration;
    
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
    
    if(notification) {
        NSDictionary* keyboardInfo = [notification userInfo];
        CGRect keyboardFrame = [[keyboardInfo valueForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
        animationDuration = [[keyboardInfo valueForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
        
        if(notification.name == UIKeyboardWillShowNotification || notification.name == UIKeyboardDidShowNotification) {
            if(UIInterfaceOrientationIsPortrait(orientation))
                keyboardHeight = keyboardFrame.size.height;
            else
                keyboardHeight = keyboardFrame.size.width;
        } else
            keyboardHeight = 0;
    } else {
        keyboardHeight = self.visibleKeyboardHeight;
    }
    
    CGRect orientationFrame = [UIScreen mainScreen].bounds;
    CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
    
    if(UIInterfaceOrientationIsLandscape(orientation)) {
        float temp = orientationFrame.size.width;
        orientationFrame.size.width = orientationFrame.size.height;
        orientationFrame.size.height = temp;
        
        temp = statusBarFrame.size.width;
        statusBarFrame.size.width = statusBarFrame.size.height;
        statusBarFrame.size.height = temp;
    }
    
    CGFloat activeHeight = orientationFrame.size.height;
    
    if(keyboardHeight > 0)
        activeHeight += statusBarFrame.size.height*2;
    
    activeHeight -= keyboardHeight;
    CGFloat posY = floor(activeHeight*0.45);
    CGFloat posX = orientationFrame.size.width/2;
    
    CGPoint newCenter;
    CGFloat rotateAngle;
    
    switch (orientation) { 
        case UIInterfaceOrientationPortraitUpsideDown:
            rotateAngle = M_PI; 
            newCenter = CGPointMake(posX, orientationFrame.size.height-posY);
            break;
        case UIInterfaceOrientationLandscapeLeft:
            rotateAngle = -M_PI/2.0f;
            newCenter = CGPointMake(posY, posX);
            break;
        case UIInterfaceOrientationLandscapeRight:
            rotateAngle = M_PI/2.0f;
            newCenter = CGPointMake(orientationFrame.size.height-posY, posX);
            break;
        default: // as UIInterfaceOrientationPortrait
            rotateAngle = 0.0;
            newCenter = CGPointMake(posX, posY);
            break;
    } 
    
    if(notification) {
        [UIView animateWithDuration:animationDuration 
                              delay:0 
                            options:UIViewAnimationOptionAllowUserInteraction 
                         animations:^{
                             [self moveToPoint:newCenter rotateAngle:rotateAngle];
                         } completion:NULL];
    } 
    
    else {
        [self moveToPoint:newCenter rotateAngle:rotateAngle];
    }
    
}

- (void)moveToPoint:(CGPoint)newCenter rotateAngle:(CGFloat)angle {
    self.hudView.transform = CGAffineTransformMakeRotation(angle); 
    self.hudView.center = newCenter;
}

#pragma mark - Master show/dismiss methods

- (void)showWithStatus:(NSString*)string maskType:(SVProgressHUDMaskType)hudMaskType networkIndicator:(BOOL)show {
    dispatch_async(dispatch_get_main_queue(), ^{
        if(!self.superview)
            [self.overlayWindow addSubview:self];
        
        self.fadeOutTimer = nil;
        self.imageView.hidden = YES;
        self.maskType = hudMaskType;
        
        [self setStatus:string];
        [self.spinnerView startAnimating];
        
        if(self.maskType != SVProgressHUDMaskTypeNone) {
            self.overlayWindow.userInteractionEnabled = YES;
        } else {
            self.overlayWindow.userInteractionEnabled = NO;
        }
        
        [self.overlayWindow makeKeyAndVisible];
        [self positionHUD:nil];
        
        if(self.alpha != 1) {
            [self registerNotifications];
            self.hudView.transform = CGAffineTransformScale(self.hudView.transform, 1.3, 1.3);
            
            [UIView animateWithDuration:0.15
                                  delay:0
                                options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState
                             animations:^{	
                                 self.hudView.transform = CGAffineTransformScale(self.hudView.transform, 1/1.3, 1/1.3);
                                 self.alpha = 1;
                             }
                             completion:NULL];
        }
        
        [self setNeedsDisplay];
    });
}


- (void)dismissWithStatus:(NSString*)string error:(BOOL)error {
	[self dismissWithStatus:string error:error afterDelay:0.9];
}


- (void)dismissWithStatus:(NSString *)string error:(BOOL)error afterDelay:(NSTimeInterval)seconds {
    dispatch_async(dispatch_get_main_queue(), ^{
        if(self.alpha != 1)
            return;
        
        if(error)
            self.imageView.image = [UIImage imageNamed:@"SVProgressHUD.bundle/error.png"];
        else
            self.imageView.image = [UIImage imageNamed:@"SVProgressHUD.bundle/success.png"];
        
        self.imageView.hidden = NO;
        [self setStatus:string];
        [self.spinnerView stopAnimating];
        
        self.fadeOutTimer = [NSTimer scheduledTimerWithTimeInterval:seconds target:self selector:@selector(dismiss) userInfo:nil repeats:NO];
    });
}

- (void)dismiss {
    dispatch_async(dispatch_get_main_queue(), ^{

        [UIView animateWithDuration:0.15
                              delay:0
                            options:UIViewAnimationCurveEaseIn | UIViewAnimationOptionAllowUserInteraction
                         animations:^{	
                             self.hudView.transform = CGAffineTransformScale(self.hudView.transform, 0.8, 0.8);
                             self.alpha = 0;
                         }
                         completion:^(BOOL finished){ 
                             if(self.alpha == 0) {
                                 [[NSNotificationCenter defaultCenter] removeObserver:self];
                                 [hudView removeFromSuperview];
                                 hudView = nil;
                                 
                                 // Make sure to remove the overlay window from the list of windows
                                 // before trying to find the key window in that same list
                                 NSMutableArray *windows = [[NSMutableArray alloc] initWithArray:[UIApplication sharedApplication].windows];
                                 [windows removeObject:overlayWindow];
                                 overlayWindow = nil;
                                 
                                 [windows enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(UIWindow *window, NSUInteger idx, BOOL *stop) {
                                   if([window isKindOfClass:[UIWindow class]] && window.windowLevel == UIWindowLevelNormal) {
                                     [window makeKeyWindow];
                                     *stop = YES;
                                   }
                                 }];
                                 
                                 // uncomment to make sure UIWindow is gone from app.windows
                                 //NSLog(@"%@", [UIApplication sharedApplication].windows);
                                 //NSLog(@"keyWindow = %@", [UIApplication sharedApplication].keyWindow);
                             }
                         }];
    });
}

#pragma mark - Utilities

+ (BOOL)isVisible {
    return ([SVProgressHUD sharedView].alpha == 1);
}


#pragma mark - Getters

- (UIWindow *)overlayWindow {
    if(!overlayWindow) {
        overlayWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
        overlayWindow.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        overlayWindow.backgroundColor = [UIColor clearColor];
        overlayWindow.userInteractionEnabled = NO;
    }
    return overlayWindow;
}

- (UIView *)hudView {
    if(!hudView) {
        hudView = [[UIView alloc] initWithFrame:CGRectZero];
        hudView.layer.cornerRadius = 10;
		hudView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.8];
        hudView.autoresizingMask = (UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin |
                                    UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin);
        
        [self addSubview:hudView];
    }
    return hudView;
}

- (UILabel *)stringLabel {
    if (stringLabel == nil) {
        stringLabel = [[UILabel alloc] initWithFrame:CGRectZero];
		stringLabel.textColor = [UIColor whiteColor];
		stringLabel.backgroundColor = [UIColor clearColor];
		stringLabel.adjustsFontSizeToFitWidth = YES;
		stringLabel.textAlignment = UITextAlignmentCenter;
		stringLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
		stringLabel.font = [UIFont boldSystemFontOfSize:16];
		stringLabel.shadowColor = [UIColor blackColor];
		stringLabel.shadowOffset = CGSizeMake(0, -1);
        stringLabel.numberOfLines = 0;
    }
    
    if(!stringLabel.superview)
        [self.hudView addSubview:stringLabel];
    
    return stringLabel;
}

- (UIImageView *)imageView {
    if (imageView == nil)
        imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 28)];
    
    if(!imageView.superview)
        [self.hudView addSubview:imageView];
    
    return imageView;
}

- (UIActivityIndicatorView *)spinnerView {
    if (spinnerView == nil) {
        spinnerView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
		spinnerView.hidesWhenStopped = YES;
		spinnerView.bounds = CGRectMake(0, 0, 37, 37);
    }
    
    if(!spinnerView.superview)
        [self.hudView addSubview:spinnerView];
    
    return spinnerView;
}

- (CGFloat)visibleKeyboardHeight {
        
    UIWindow *keyboardWindow = nil;
    for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) {
        if(![[testWindow class] isEqual:[UIWindow class]]) {
            keyboardWindow = testWindow;
            break;
        }
    }

    // Locate UIKeyboard.  
    UIView *foundKeyboard = nil;
    for (__strong UIView *possibleKeyboard in [keyboardWindow subviews]) {
        
        // iOS 4 sticks the UIKeyboard inside a UIPeripheralHostView.
        if ([[possibleKeyboard description] hasPrefix:@"<UIPeripheralHostView"]) {
            possibleKeyboard = [[possibleKeyboard subviews] objectAtIndex:0];
        }                                                                                
        
        if ([[possibleKeyboard description] hasPrefix:@"<UIKeyboard"]) {
            foundKeyboard = possibleKeyboard;
            break;
        }
    }
        
    if(foundKeyboard && foundKeyboard.bounds.size.height > 100)
        return foundKeyboard.bounds.size.height;
    
    return 0;
}

@end

LIN协议V2.2A版介绍 IN 协议规范2.2A 版(2010 年 12 月发布)是面向低成本汽车网络的标准,核心采用单主多从架构,支持最高20kbit/s速率,通过单总线实现通信;定义了完整的协议栈(含协议层、传输层、物理层等),规定了帧结构(含 Break 字段、Sync 字节、保护标识符 PID、数据字段、校验和)、5 类帧类型(无条件帧、事件触发帧等)及调度表机制以保障确定性传输; 阅读详情

相关推荐

PSM倾向匹配详细步骤和程序

目录1.安装psmatch2统计包。2.数据准备3.数据分析及命令解读4.结果解读4.1模型拟合结果,此处无太多实际意义。4.2试验组可匹配的观测概览,按照命令中设定的匹配规则,试验组有8例患者未能匹配到合适对照。4.3结果解读的重点应该是对stata新生成的中间变量的解读。4.4均衡性检验结果4.5匹配结果的图示化5.Stata命令汇总最后留下两个问题给大家思考:题目 试验设计中,匹配的目的在于确保干预效应估计是建立在可比个体之间的不同结果的基础上。最简单的匹配方式是将干预组和对照组中协变量值相同的两个个

平平淡淡,戒急用忍,一生学闭嘴。 5万+

iOS 【关于SVProgressHUD的使用建议】

使用SVProgressHUD是一个非常明智的举动,他使用起来比较方便,用过MBProgressHUD的可能就比较了解。它们都是用来做下拉刷新、无限滚动、发送消息的。 前段时间,应公司的需求,我将公司项目中的MBProgressHUD全部替换为SVProgressHUD了,使用起来比MBProgressHUD要方便的多。具体的使用规范我就不一一说明了。大家可以参考这篇文章:SVProgr

CoderZYWang 7018

基于eBPF和LSM的强制文件访问控制系统架构设计和实现

本文介绍了一种基于 eBPF 与 Linux 安全模块(LSM)实现的强制文件访问控制系统。该系统利用 eBPF 的高性能和动态加载能力以及 LSM 的系统调用拦截功能,提供了灵活且强大的文件访问控制策略。文章详细描述了系统的设计思路、架构组成、关键代码实现及错误处理方式。通过用户空间程序与内核态 eBPF 程序的协作,实现了对文件操作的实时监控和控制,支持动态更新安全策略而无需重启系统。此外,文中还讨论了未来可能的扩展方向,如增加更多 hook 点、集成其他安全模块以及性能优化等。

Linux内核研究者 1859

SVProgressHUD的使用

1、首先是导入SVProgressHUD组件 使用cocoapods导入:在控制台输入 cd空格—-->然后把工程拖进—> 按回车键—>pod init —>pod search SVProgressHUD—>把要使用的版本粘贴到 工程中的podfile中的(#号行的下边就可以 # platform :ios, '9.0'之下,直接用也可以pod 'SVProgressHUD', '~> 2.

iFlyingCoder的博客 2630

PCB工艺-SI9000-模型选择

本文介绍了PCB设计中常用的阻抗计算模型,主要包括外层、内层和嵌入式三类共12种计算模型,涵盖单端/差分、共面等不同场景。针对阻抗计算中的关键参数,文章提供了经验值参考:表层走线厚度0.035mm(1.4mil),内层0.0152mm(0.6mil);并列出常见PP材料的介电常数(3.8-4.5)和成品厚度(3-7.5mil)。作者建议90%的设计问题可通过上述模型解决,层叠参数建议咨询PCB厂家获取。

weixin_50120208的博客 1400

高光谱盲超分DBSR复现全记录:从退化估计到双域耦合的工程实践

高光谱图像超分辨率旨在从低分辨率观测中恢复高分辨率光谱立方体,其核心挑战在于退化过程未知,即盲超分问题。盲超分需同时估计模糊核、噪声水平与下采样方式,本质上是病态逆问题,依赖空间与光谱先验约束。双域耦合方法通过联合空间域与光谱域信息,显著提升退化核估计精度与光谱保真度,技术价值在于更贴近真实成像场景。该技术广泛应用于遥感、医学影像与材料检测等领域。本文围绕DBSR(双域盲超分)的复现,深入剖析退化估计子网调试、双域主干训练策略及显存优化等工程细节,为高光谱盲超分实践提供可复现的参考。

weixin_29031057的博客 206

SVProgressHUD ---使用

方法 SVProgressHUD所以的方法都是类方法,并且对象是通过单例创建。由于方法都是通过类名调用,简单明了。 基本方法 + (void)show; 显示:状态是一个迅速转动的圈 + (void)showWithMaskType:(SVProgressHUDMaskType)maskType; 显示并且带着一个状态 + (void)showWithStatu

wuwuFQ的博客 9945

【Linux】Petalinux使用QSPI FLASH引导启动

1. 预分配Flash空间使用Flash引导Petalinux做的系统,也有进阶的做法。部分图片和经验来源于网络,若有侵权麻烦联系我删除,主要是做笔记的时候忘记写来源了,做完笔记很久才写博客。1. 预分配Flash空间根据生成的bit文件大小估算BOOT.BIN文件的大小,为Flash大概分配四个分区:boot、bootenv、kernel、bootscr,分别存放BOOT.BIN文件、u-boot的环境变量、内核文件(image.ub/zImage/uImage等)、启动脚本boot.scr。

Tesseract_9527的博客 3385

iOS Toast HUD 封装 基于SVProgressHUD 两分钟封装很好用的iOS版Toast 类似Android Toast 弹窗效果封装

iOS Toast封装 基于SVProgressHUD先看效果基于SV的好处代码创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表 先看效果 当然,我们为了让用户更加便捷,我们增加了图片拖拽功能。 基于SV的好处 例如网络加载需要用SV显示加载信息,但是加载成功如果是其他toa...

huizai的博客 3807

FPGA进位链(Carry Chain)实战:从Xilinx CARRY8原语到性能优化全解析

本文深入解析了FPGA进位链(Carry Chain)的原理与应用,重点剖析了Xilinx CARRY8原语的端口功能与内部机制。通过实测数据揭示了进位链的真实延迟特性与温度影响,并详细阐述了如何利用DI和S信号进行动态路径优化、实现减法运算与条件进位选择,从而有效提升设计性能。最后,文章探讨了系统级的流水线拆分、布局约束等实战优化策略与常见陷阱。

weixin_29313817的博客 462

风控域——知识图谱相关原理

本文全面介绍了知识图谱在风控领域的应用原理。从基础知识入手,阐述了知识图谱的定义、概念及应用场景,重点聚焦于金融风控。进一步讲解了知识图谱的技术架构,涵盖计算、融合与构建等方面。深入探讨了知识表示、建模、抽取、挖掘、存储、融合、检索和推理等关键技术原理,并结合金融风控实际需求,详细说明了各技术环节的具体应用方法与流程,为构建高效风控知识图谱提供了理论与实践指导。

庄小焱 619

Swift对SVProgressHUD进一步封装

Swift对SVProgressHUD进一步封装 1,准备工作 默认已经导入SVProgressHUD 2,封装 创建一个.swift文件:MyProgressHUD import UIKit enum MyProgressHUDStatus { ///成功 case success ///失败 case error ///叹号提示 ...

weixin_39185704的博客 1534

微搭低代码实现用户登录及注册功能

在小程序开发中,我们可以拿到微信用户的openid,openid可以作为用户的唯一标识,在查询数据的时候可以进行数据过滤实现查询自己提交的数据。那微搭中是否也有openid这个概念,可以获取用户自己提交的数据呢? 答案是肯定的,那要怎么去做呢?思路是先创建一个数据源方法,在数据源中返回openid,然后低代码中可以调用数据源的方法并且赋值给全局变量,这样在后续的业务中从全局变量就可以获取openid了,方便做数据权限的控制。 为了实现这个目的,我们从创建数据源开始。 创建数据源 我们先创建一个用户管理的数据

低代码布道师的博客 3003

SVProgressHUD控件使用

转载自:http://cht005288201307234627.iteye.com/blog/1927961 SVProgressHUD 博客分类:  ios   GitHub:https://github.com/samvermette/SVProgressHUD SVProgressHUD和MBProgressHUD效果差不多,不过

ysysbaobei的专栏 5万+

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

SVProgressHUD

//********************************************************* SVProgressHUD 使用过程: CocoaPods下载SDK代码包:SVProgressHUD 2.系统库:QuartzCore.framework,Foundation.framework,UIKit.framework,CoreGraphics.framework...

yanhaijunyan的博客 969

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

SVProgressHUD的作用及用法

SVProgressHUD 是一个第三方的控件,是一个弹出提示层,用来提示网络加载、或提示对错,如下图所示:     那么,SVProgressHUD 都有什么特点呢?   1. 提示当前的状态,如:网络传输、提交中、操作成功或失败等;   2. 可设置提示的 pop layer 是否为 model,提示的时候是否允许用户做其他操作;  

baidu_33793758的博客 4128

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

iOS 封装加载、提示窗progressHUD —— HERO博客

封装了一个加载动画、提示信息弹窗HWProgressHUD,使用简单,方便修改。

hero_wqb的博客 3246

Xamarin.Forms调用吐司

大家好,今天给大家介绍Xamarin.Forms底下调用吐司。    所谓的吐司,就是Toast,安卓底下有自带的吐司Toast,就是给用户提示信息,并且过一段时间后会自动消失。但自带的吐司有些简陋,今天我们要讲的是引用第三方库,下面具体介绍:1.分平台底下下载程序包:1.1 安卓平台:1.2 iOS平台:2.在可移植平台底下创建接口:public interface iHUD//吐司接口 {

lmm66950的博客 1507

快速开发常用 工具控件封装

快速开发常用 工具控件封装封装了自己平时快速开发的常用工具类和轻量级框架 源码Demo下载:https://github.com/wushge11/CommonUtil eclipse和studio的点击这里:http://download.csdn.net/detail/wushge11/9514499使用方法: compile ‘com.wushange:commutilSdk:2.0.

wushge11的博客 2836

AppStore 上架中的分类

Book 图书 Business 商业 Catalogs 商品指南 Education 教育 Entertainment 娱乐 Finance 财务 Food & Drink 美食佳饮 Games 游戏 Health & Fitness 健康健美 Lifestyle 生活 Med

hslinux的专栏 4200

NSUserDefaults类registerDefaults的使用

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. NSDictionary *dicDe

hslinux的专栏 3634

ffmepg 指定网络连接模式UDP还是TCP

AVFormatContext *formatCtx = NULL; formatCtx = avformat_alloc_context(); AVDictionary* options = NULL; av_dict_set(&options, "rtsp_transport", "tcp", 0); avformat_open_input(

hslinux的专栏 3551

XCode 4.2支持iOS 5.1.1真机调试的实现

目前市面上的ios设备,操作系统都是5.1.1的版本了。但是偶的开发环境还是Snow Leopard 10.6.8 + XCode 4.2。 新买的设备接上去,发现XCode 4.2无法在ios5.1.1的设备上面调试。 根据以前把iPhoneOS4.3.sdk往XCode 4.2转移的经验,下载了一个XCode4.4.1的DMG文件,研究下,把相应的文件从DMG里面拷贝出来 放到本地Dev

hslinux的专栏 3274

BSD socket 非阻塞模式连接

BSD socket 非阻塞模式连接,适用用各种实现BSD socket的操作系统:windows,  linux, unix, ios, android. int CNetTcpC::StartConnect(LPCSTR pszIPAddr, UINT nPort) { SOCKADDR_IN ctrl_sin; UINT sock = socket(AF

hslinux的专栏 1564

iphone,ipad尺寸汇总

汇总下,免得下次忘记了还需要重新找度娘。  Ipad mini                             1024X768       非retina屏  Ipad 1 Ipad 2                       1024X768    非 retina屏    Ipad 3 ( the new Ipad)    分辨率  2048X1536  导航

hslinux的专栏 1181

Semantic Issue PerformSelector may cause a leak because its selector is unknown

该警告不影响程序运行。看他不爽直接屏蔽了就可以: #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-performSelector-leaks"                [delegate performSelector:stateChangedSelector withObject:se

hslinux的专栏 1047
上一篇: pthread 简要使用指南(五) 线程属性(pthread_attr_t)
下一篇: 23个MySQL常用查询语句
hslinux
博客等级 码龄25年 212粉丝 46原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址