各种语言
参数 | 含义 |
---|---|
Type | Segment的类型,有LOAD,DYNAMIC,INTERP等 |
offset | segment在文件中的偏移量 |
VirtAddr | Segment的第一个字节在进程虚拟地址空间的起始位置 |
PhysAddr | segment的物理装载地址 |
FileSiz | segment在ELF文件中所站空间的长度 |
MemSiz | segment在进程虚拟地址空间中所占的长度 |
Flags | 权限属性,比如可读R,可写W,可执行X等 |
Align | 对齐属性,实际对齐等于2的align次方 |
一段html代码
<xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en> <head></head> <body> <h1>呵呵</h1> </body> </html>
111
一段C代码
//对两个线程ID进行比较 //若相等返回非0数值,否则返回0 #include <pthread.h> int pthread_equal(pthread_t tid1, pthread_t tid2); //获得线程自身的ID #include <pthread.h> pthread_t pthread_self(void); //创建新线程 //pthread_attr_t用来定制各种不同的线程属性,新线程函数从start_rtn函数的地址开始运行,如果 //要向start_rtn传递参数,需要将这些参数放入结构体中,然后将此将结构体地址作为arg参数传入 #include <pthread.h> int pthread_create(pthread_t *restrict tidp, const pthread_attr_t *restrict attr, void *(*strt_rtn)(void *), void *restrict arg); //单个线程可以通过3种方式退出 //1.线程可以简单地从启动例程种返回,返回值是线程的退出码 //2.线程可以被同一进程中的其他线程取消 //3.线程调用pthread_exit #include <pthread.h> void pthread_exit(void *rval_ptr); //进程中的其他线程可以通过调用下列函数来访问这个 rval_ptr指针 //如果对线程的返回值不感兴趣,可以把rval_ptr设置为NULL,这样等于等待线程终止,但是不获取 //线程终止状态 #include <pthread.h> int pthread_join(pthread_t thread, void **rval_ptr); //线程取消 #include <pthread.h> int pthread_cancel(pthread_t tid); //可以安排一些清理函数,类似进程的atexit函数,这样的函数被称为线程清理处理程序(thread //cleanup handler),一个线程可以建立多个清理处理程序,其执行顺序和注册顺序相反 #include <pthread.h> void pthread_cleanup_push(void (*rtn)(void *), void *arg); void pthread_cleanup_pop(int execute); //分离线程 #include <pthread.h> int pthread_detach(pthread_t tid); //互斥量 //如果不希望被阻塞使用trylock函数,不出现阻塞直接返回0,否则就会失败不能锁住返回EBUSY //timelock函数指定一个绝对时间(在X到达之前可以阻塞,而不是等待Y秒) #include <pthread.h> int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr); int pthread_mutex_destroy(pthread_mutex_t *mutex); int pthread_mutex_lock(pthread_mutex_t *mutex); int pthread_mutex_trylock(pthread_mutex_t *mutex); int pthread_mutex_unlock(pthread_mutex_t *mutex); int pthread_mutex_timedlock(pthread_mutex_t *restrict mutex, const struct timespec *restrict tsptr); //读写锁 #include <pthread.h> int pthread_rwlock_init(pthread_rwlock_t *restrict rwlock); int pthread_rwlock_destroy(pthread_rwlock_t *rwlock); int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock); int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock); int pthread_rwlock_unlock(pthread_rwlock_t *rwlock); int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock); int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock); int pthread_rwlock_timerdlock(pthread_rwlock_t *restrict rwlock, const struct timespec *restrict tsptr); int pthread_rwlock_timewrlock(pthread_rwlock_t *restrict rwlock, const struct timespec *restrict tsptr);
一代python代码
class Solution(object): def maxSubArray(self, nums): sum = 0 res = nums[0] for i in range(len(nums)): if(sum > 0): sum += nums[i] else: sum = nums[i] res = max(res,sum) return res print "11111111111111111222222222222222233333333333333333334444444444444444444455555555555555555556666666666666667777777777"
一段java代码
public static void init(String filePath) { try { org.springframework.context.support.ClassPathXmlApplicationContext initializedContext = new org.springframework.context.support.ClassPathXmlApplicationContext(filePath) { @Override protected void customizeBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory) { super.customizeBeanFactory(beanFactory); beanFactory.setAllowBeanDefinitionOverriding(false); } }; // ContextHolder.applicationContext = initializedContext; } catch (Throwable e) { throw new RuntimeException("ERROR ## Datalink Factory initial failed.", e); } }
一段go代码,go的代码没有亮度显示
package main import ( "fmt" ) type Phone interface { call() } type NokiaPhone struct { } func (nokiaPhone NokiaPhone) call() { fmt.Println("I am Nokia, I can call you!") } type IPhone struct { } func (iPhone IPhone) call() { fmt.Println("I am iPhone, I can call you!") } func main() { var phone Phone phone = new(NokiaPhone) phone.call() phone = new(IPhone) phone.call() } fmt.Println("111111111112222222222222222233333333333333333333333333333333333333333333333333333333444444444444444444444444444444444444444445555555555555555555555566666666666666666666")
ps aux | grep java | awk '{print $2}' | sort -n echo "aaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeee
20 次阅读
2 thoughts on “各种语言”
测试一下
各种语言,很好