GVKun编程网logo

typecho怎么seo(typecho怎么改头像)(typecho修改头像)

8

如果您对typecho怎么seo(typecho怎么改头像)感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于typecho怎么seo(typecho怎么改头像)的详细内容,我

如果您对typecho怎么seo(typecho怎么改头像)感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于typecho怎么seo(typecho怎么改头像)的详细内容,我们还将为您解答typecho修改头像的相关问题,并且为您提供关于com.intellij.openapi.fileTypes.ex.FileTypeChooser的实例源码、Comment2Wechat —— Typecho 插件、objective-c – check id isKindOfType CFType、python 报错 TypeError: type ‘types.GenericAlias‘ is not an acceptable base type的有价值信息。

本文目录一览:

typecho怎么seo(typecho怎么改头像)(typecho修改头像)

typecho怎么seo(typecho怎么改头像)(typecho修改头像)

1. typecho怎么改头像

2. typecho头像插件

Typecho是由type和echo两个词合成的,来自于开发团队的头脑风暴。Typecho基于PHP5开发,支持多种数据库,是一款内核强健﹑扩展方便﹑体验友好﹑运行流畅的轻量级开源博客程序。选用Typecho,搭建独一无二个人网络日志发布平台,享受创作的快乐。

3. typecho更换头像

4. typecho获取qq头像

其实快并不单纯的取决于某一款程序,程序需要选择合适自己,程序是否能够满足自己的需求,WordPress是目前使用非常广泛的一款开源程序,国内的爱范儿、泪雪网、cnBeta等网站都是用WordPress开发,速度也都是非常不错的,主要看服务器已经各方面的优化,同时WordPress的资源比较多,很多的问题都能够很快的找到解决方法。

而其它的程序都较为很少人用,使用和其它方面可能会欠缺一点点。

5. typecho怎么设置头像

首先点击进入typecho点击右上方的设置,打开翻页模式即可

6. typecho评论头像

有以下两中接口形式,第一种:<?php Typecho_Plugin::factory('admin/menu.php')->navBar(); ?>可以通过navBar = array('插件名称', '方法名称')来实现,例如:Typecho_Plugin::factory('admin/menu.php')->navBar = array('HelloWorld_Plugin', 'render');问题是typecho更多的是第二形式接口,该接口带有参数,例如:// 完成发布插件接口$this->pluginHandle()->finishPublish($contents, $this);

com.intellij.openapi.fileTypes.ex.FileTypeChooser的实例源码

com.intellij.openapi.fileTypes.ex.FileTypeChooser的实例源码

项目:intellij-ce-playground    文件:UnkNownFileTypeDiffRequest.java   
@NotNull
@Override
public JComponent getComponent(@NotNull final DiffContext context) {
  final SimpleColoredComponent label = new SimpleColoredComponent();
  label.append("Can't show diff for unkNown file type. ",new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,UIUtil.getInactiveTextColor()));
  if (myFileName != null) {
    label.append("Associate",SimpleTextAttributes.LINK_ATTRIBUTES,new Runnable() {
      @Override
      public void run() {
        DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND,new Runnable() {
          @Override
          public void run() {
            FileType type = FileTypeChooser.associateFileType(myFileName);
            if (type != null) onSuccess(context);
          }
        });
      }
    });
    LinkMouseListenerBase.installSingleTagOn(label);
  }
  return DiffUtil.createMessagePanel(label);
}
项目:intellij-ce-playground    文件:ChangeDiffRequestPresentable.java   
public static boolean checkAssociate(final Project project,String fileName,DiffChainContext context) {
  final String pattern = FileUtilRt.getExtension(fileName).toLowerCase();
  if (context.contains(pattern)) return false;
  int rc = Messages.showOkCancelDialog(project,VcsBundle.message("diff.unkNown.file.type.prompt",fileName),VcsBundle.message("diff.unkNown.file.type.title"),VcsBundle.message("diff.unkNown.file.type.associate"),CommonBundle.getCancelButtonText(),Messages.getQuestionIcon());
  if (rc == Messages.OK) {
    FileType fileType = FileTypeChooser.associateFileType(fileName);
    return fileType != null && !fileType.isBinary();
  } else {
    context.add(pattern);
  }
  return false;
}
项目:intellij-ce-playground    文件:PatchApplier.java   
private boolean fileTypesAreOk(final List<Pair<VirtualFile,ApplyTextFilePatch>> textPatches) {
  for (Pair<VirtualFile,ApplyTextFilePatch> textPatch : textPatches) {
    final VirtualFile file = textPatch.getFirst();
    if (! file.isDirectory()) {
      FileType fileType = file.getFileType();
      if (fileType == FileTypes.UNKNowN) {
        fileType = FileTypeChooser.associateFileType(file.getName());
        if (fileType == null) {
          showError(myProject,"Cannot apply patch. File " + file.getPresentableName() + " type not defined.",true);
          return false;
        }
      }
    }
  }
  return true;
}
项目:intellij-ce-playground    文件:CreateFileAction.java   
@Override
public boolean canClose(final String inputString) {
  if (inputString.length() == 0) {
    return super.canClose(inputString);
  }

  final PsiDirectory psiDirectory = getDirectory();

  final Project project = psiDirectory.getProject();
  final boolean[] result = {false};
  DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND,new Runnable() {
    @Override
    public void run() {
      final FileType type = FileTypeChooser.getKNownFileTypeOrAssociate(new FakeVirtualFile(psiDirectory.getVirtualFile(),getFileName(inputString)),project);
      result[0] = type != null && MyValidator.super.canClose(getFileName(inputString));
    }
  });
  return result[0];
}
项目:intellij-ce-playground    文件:FileTemplateConfigurable.java   
@Override
public void apply() throws ConfigurationException {
  if (myTemplate != null) {
    myTemplate.setText(myTemplateEditor.getDocument().getText());
    String name = myNameField.getText();
    String extension = myExtensionField.getText();
    String filename = name + "." + extension;
    if (name.length() == 0 || !isValidFilename(filename)) {
      throw new ConfigurationException(IdeBundle.message("error.invalid.template.file.name.or.extension"));
    }
    FileType fileType = FileTypeManager.getInstance().getFileTypeByFileName(filename);
    if (fileType == UnkNownFileType.INSTANCE) {
      FileTypeChooser.associateFileType(filename);
    }
    myTemplate.setName(name);
    myTemplate.setExtension(extension);
    myTemplate.setReformatCode(myAdjustBox.isSelected());
    myTemplate.setLiveTemplateEnabled(myLiveTemplateBox.isSelected());
  }
  myModified = false;
}
项目:tools-idea    文件:ChangeDiffRequestPresentable.java   
public static boolean checkAssociate(final Project project,final FilePath file,DiffChainContext context) {
  final String pattern = FileUtilRt.getExtension(file.getName()).toLowerCase();
  if (context.contains(pattern)) return false;
  int rc = Messages.showOkCancelDialog(project,file.getName()),Messages.getQuestionIcon());
  if (rc == 0) {
    FileType fileType = FileTypeChooser.associateFileType(file.getName());
    return fileType != null && !fileType.isBinary();
  } else {
    context.add(pattern);
  }
  return false;
}
项目:tools-idea    文件:PatchApplier.java   
private boolean fileTypesAreOk(final List<Pair<VirtualFile,ApplyTextFilePatch> textPatch : textPatches) {
    final VirtualFile file = textPatch.getFirst();
    if (! file.isDirectory()) {
      FileType fileType = file.getFileType();
      if (fileType == FileTypes.UNKNowN) {
        fileType = FileTypeChooser.associateFileType(file.getPresentableName());
        if (fileType == null) {
          showError(myProject,true);
          return false;
        }
      }
    }
  }
  return true;
}
项目:consulo    文件:UnkNownFileTypeDiffRequest.java   
@Nonnull
@Override
public JComponent getComponent(@Nonnull final DiffContext context) {
  final SimpleColoredComponent label = new SimpleColoredComponent();
  label.setTextAlign(SwingConstants.CENTER);
  label.append("Can't show diff for unkNown file type. ",new Runnable() {
      @Override
      public void run() {
        FileType type = FileTypeChooser.associateFileType(myFileName);
        if (type != null) onSuccess(context);
      }
    });
    LinkMouseListenerBase.installSingleTagOn(label);
  }
  return JBUI.Panels.simplePanel(label).withBorder(JBUI.Borders.empty(5));
}
项目:consulo    文件:ChangeDiffRequestPresentable.java   
public static boolean checkAssociate(final Project project,Messages.getQuestionIcon());
  if (rc == Messages.OK) {
    FileType fileType = FileTypeChooser.associateFileType(fileName);
    return fileType != null && !fileType.isBinary();
  } else {
    context.add(pattern);
  }
  return false;
}
项目:consulo    文件:Pathsverifier.java   
private boolean isFileTypeOk(@Nonnull VirtualFile file) {
  FileType fileType = file.getFileType();
  if (fileType == UnkNownFileType.INSTANCE) {
    fileType = FileTypeChooser.associateFileType(file.getName());
    if (fileType == null) {
      PatchApplier
              .showError(myProject,"Cannot apply content for " + file.getPresentableName() + " file from patch because its type not defined.",true);
      return false;
    }
  }
  if (fileType.isBinary()) {
    PatchApplier.showError(myProject,"Cannot apply file " + file.getPresentableName() + " from patch because it is binary.",true);
    return false;
  }
  return true;
}
项目:consulo    文件:FileTemplateConfigurable.java   
@requireddispatchThread
@Override
public void apply() throws ConfigurationException {
  if (myTemplate != null) {
    myTemplate.setText(myTemplateEditor.getDocument().getText());
    String name = myNameField.getText();
    String extension = myExtensionField.getText();
    String filename = name + "." + extension;
    if (name.length() == 0 || !isValidFilename(filename)) {
      throw new ConfigurationException(IdeBundle.message("error.invalid.template.file.name.or.extension"));
    }
    FileType fileType = FileTypeManager.getInstance().getFileTypeByFileName(filename);
    if (fileType == UnkNownFileType.INSTANCE) {
      FileTypeChooser.associateFileType(filename);
    }
    myTemplate.setName(name);
    myTemplate.setExtension(extension);
    myTemplate.setReformatCode(myAdjustBox.isSelected());
    myTemplate.setLiveTemplateEnabled(myLiveTemplateBox.isSelected());
  }
  myModified = false;
}
项目:intellij-ce-playground    文件:ExtractIncludeDialog.java   
@Override
protected void doOKAction() {
  final Project project = myCurrentDirectory.getProject();

  final String directoryName = myTargetDirectoryField.getText().replace(File.separatorChar,'/');
  final String targetFileName = getTargetFileName();

  if (isFileExist(directoryName,targetFileName)) {
    Messages.showErrorDialog(project,RefactoringBundle.message("file.already.exist",targetFileName),RefactoringBundle.message("file.already.exist.title"));
    return;
  }

  final FileType type = FileTypeChooser.getKNownFileTypeOrAssociate(targetFileName);
  if (type == null) {
    return;
  }

  CommandProcessor.getInstance().executeCommand(project,new Runnable() {
    @Override
    public void run() {
      final Runnable action = new Runnable() {
        @Override
        public void run() {
          try {
            PsiDirectory targetDirectory = DirectoryUtil.mkdirs(PsiManager.getInstance(project),directoryName);
            targetDirectory.checkCreateFile(targetFileName);
            final String webPath = PsiFileSystemItemUtil.getRelativePath(myCurrentDirectory,targetDirectory);
            myTargetDirectory = webPath == null ? null : targetDirectory;
          }
          catch (IncorrectOperationException e) {
            CommonRefactoringUtil.showErrorMessage(REFACTORING_NAME,e.getMessage(),null,project);
          }
        }
      };
      ApplicationManager.getApplication().runWriteAction(action);
    }
  },RefactoringBundle.message("create.directory"),null);
  if (myTargetDirectory == null) return;
  super.doOKAction();
}
项目:tools-idea    文件:OpenFileAction.java   
private static void doOpenFile(@Nullable final Project project,@NotNull final List<VirtualFile> result) {
  for (final VirtualFile file : result) {
    if (file.isDirectory()) {
      Project openedProject;
      if (ProjectAttachProcessor.canAttachToProject()) {
        openedProject = PlatformProjectOpenProcessor.doOpenProject(file,project,false,-1,false);
      }
      else {
        openedProject = ProjectUtil.openorImport(file.getPath(),false);
      }
      FileChooserUtil.setLastOpenedFile(openedProject,file);
      return;
    }

    if (OpenProjectFileChooserDescriptor.isProjectFile(file)) {
      int answer = Messages.showYesNoDialog(project,IdeBundle.message("message.open.file.is.project",IdeBundle.message("title.open.project"),Messages.getQuestionIcon());
      if (answer == 0) {
        FileChooserUtil.setLastOpenedFile(ProjectUtil.openorImport(file.getPath(),false),file);
        return;
      }
    }

    FileType type = FileTypeChooser.getKNownFileTypeOrAssociate(file,project);
    if (type == null) return;

    if (project != null) {
      openFile(file,project);
    }
    else {
      PlatformProjectOpenProcessor processor = PlatformProjectOpenProcessor.getInstanceIfItExists();
      if (processor != null) {
        processor.doOpenProject(file,false);
      }
    }
  }
}
项目:tools-idea    文件:CreateFileAction.java   
@Override
public boolean canClose(String inputString) {
  if (inputString.length() == 0) {
    return super.canClose(inputString);
  }

  final PsiDirectory psiDirectory = getDirectory();

  final FileType type = FileTypeChooser.getKNownFileTypeOrAssociate(new FakeVirtualFile(psiDirectory.getVirtualFile(),psiDirectory.getProject());
  return type != null && super.canClose(getFileName(inputString));
}
项目:tools-idea    文件:ExtractIncludeDialog.java   
@Override
protected void doOKAction() {
  final Project project = myCurrentDirectory.getProject();

  final String directoryName = myTargetDirectoryField.getText().replace(File.separatorChar,null);
  if (myTargetDirectory == null) return;
  super.doOKAction();
}
项目:consulo    文件:OpenFileAction.java   
private static void doOpenFile(@Nullable final Project project,@Nonnull final List<VirtualFile> result) {
  for (final VirtualFile file : result) {
    if (file.isDirectory()) {
      Project openedProject = ProjectUtil.open(file.getPath(),false);
      FileChooserUtil.setLastOpenedFile(openedProject,file);
      return;
    }

    if (OpenProjectFileChooserDescriptor.canopen(file)) {
      int answer = Messages.showYesNoDialog(project,Messages.getQuestionIcon());
      if (answer == 0) {
        FileChooserUtil.setLastOpenedFile(ProjectUtil.open(file.getPath(),project);
    }
    else {
      PlatformProjectOpenProcessor processor = PlatformProjectOpenProcessor.getInstance();
      processor.doOpenProject(file,false);
    }
  }
}
项目:consulo    文件:CreateFileAction.java   
@requireddispatchThread
@Override
public boolean canClose(final String inputString) {
  if (inputString.length() == 0) {
    return super.canClose(inputString);
  }

  final PsiDirectory psiDirectory = getDirectory();

  final Project project = psiDirectory.getProject();
  final boolean[] result = {false};
  FileTypeChooser.getKNownFileTypeOrAssociate(psiDirectory.getVirtualFile(),getFileName(inputString),project);
  result[0] = super.canClose(getFileName(inputString));
  return result[0];
}
项目:consulo    文件:ExtractIncludeDialog.java   
@Override
protected void doOKAction() {
  final Project project = myCurrentDirectory.getProject();

  final String directoryName = myTargetDirectoryField.getText().replace(File.separatorChar,null);
  if (myTargetDirectory == null) return;
  super.doOKAction();
}
项目:intellij-ce-playground    文件:AssociateFileTypeAction.java   
@Override
public void actionPerformed(AnActionEvent e) {
  VirtualFile file = e.getrequiredData(CommonDataKeys.VIRTUAL_FILE);
  FileTypeChooser.associateFileType(file.getName());
}
项目:tools-idea    文件:AssociateFileType.java   
public void actionPerformed(AnActionEvent e) {
  VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
  FileTypeChooser.associateFileType(file.getName());
}
项目:consulo    文件:AssociateFileType.java   
@Override
public void actionPerformed(AnActionEvent e) {
  VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
  FileTypeChooser.associateFileType(file.getName());
}

Comment2Wechat —— Typecho 插件

Comment2Wechat —— Typecho 插件

刚建这个博客的时候折腾新评论邮件通知也折腾了挺久,后来还是没能成功。
前段时间刚好看到 @Easy 的 Server酱,于是萌生了开发一个能用微信通知新评论的插件的想法,遂查文档开发了本插件。

微信截图

本项目丢在了 GitHub 上,欢迎来 Star 和 Fork~
https://github.com/YianAndCode/Comment2Wechat

使用方法

  1. 点此下载后解压,将解压后的目录名改为 Comment2Wechat,然后上传到你的 Typecho 的 /usr/plugins,并在 Typecho 后台开启插件
  2. 到Server酱里申请你的专属 SCKEY,并根据提示绑定你的微信
  3. 将你申请到的 SCKEY 填到插件设置里,保存即可

(说得好像天天有人给我评论一样...逃)


你也可以在我的独立博客看到这篇博文:https://yian.me/blog/php/typecho-plugin--comment2wechat.html

赞赏码

objective-c – check id isKindOfType CFType

objective-c – check id isKindOfType CFType

简而言之:如何在运行时确定id是否为CFType

我正在实现dynamic core data attributes并且在ExtendedManagedobject的willSave方法中我想检查id值是否为CFType以将其存储到plist文件中.

如果我试图保存为UIImage,那就不是免费的CF桥接(apple docs),我收到一个错误:

2011-11-17 17:16:25.294 [490:707]保存扩展数据时出错:属性列表对格式无效(属性列表不能包含’CFType’类型的对象)

我可以用某种方法检查它,或者我必须自己实现(只是来自docs的isKindOfClass)?

我不想在NSManagedobject子类中实现访问器,我不知道我将从实体属性中获得多少URL.问题是关于运行时的动态扩展属性.

- (void)willSave
{
NSDictionary *changes = [self valueForKey:@"extendedChanges"];
if (changes!=nil) {
    // merge changes into snapshot
    NSMutableDictionary *dict = [[self extendedSnapshot] mutablecopy];
    NSEnumerator *e = [changes keyEnumerator];
    Nsstring *key;
    while (key=[e nextObject]) {
        id value = [changes objectForKey:key];



        if (value==[NSNull null])
            [dict removeObjectForKey:key];
        else if (#ugly and I'm not shure is thread safe **else if ([value isKindOfClass:[NSArray class]] || [value isKindOfClass:[NSDictionary class]] || [value isKindOfClass:[NSDate class]] || [value isKindOfClass:[NSData class]] || [value isKindOfClass:[Nsstring class]] || [value isKindOfClass:[NSNumber class]])**)
            [dict setobject:value forKey:key];
    }

    // archive as binary plist
    NSData *data = nil;
    if ([dict count]>0) {
        Nsstring *error=nil;
        data = [nspropertyListSerialization dataFromPropertyList:dict 
                                                          format:nspropertyListBinaryFormat_v1_0 errorDescription:&error];
        if (error!=nil) {
            NSLog(@"Error saving extended data: %@",error);
            [error release];
        }
    }
    [dict release];
    [self setPrimitiveValue:data forKey:@"extendedData"];
}
[super willSave];
}

解决方法

这是解决问题的错误方法.您引用的博客文章将扩展属性保存为序列化plist. plist只能包含以下类型的对象,如 official doc中所述:

NSArray,NSDictionary,NSDate,NSData,Nsstring and NSNumber.

其他课程是不允许的.不要将任何其他类的对象添加到以这种方式扩展的属性中.

此外,将图像文件保存在CoreData数据库中并不是一个好主意,一般来说,请阅读官方文档中的On Blobs.而是将UIImage保存在文件中,并在CoreData数据库中写入文件路径.

如果您只有一个未保存到数据库的瞬态属性,您甚至不必经历创建扩展属性的麻烦.只需将其添加为NSManagedobject的子类的属性:

@interface MyManagedobject: NSManagedobject {
}
@property(retain,nonatomic) UIImage* thumbnail;
@property(retain,nonatomic) NSDictionary* thumbnailDictionary;
@end

无需在CoreData模型中添加缩略图.然后在.m文件中执行相应的@synthesize.以这种方式添加到托管对象的属性只是没有保存.

如果你想保留未知数量的缩略图,你可以放一个包含UIImage *的NSDictionary(或NSArray).

如果您确实想要从NSObject *获取CFType,请执行以下操作:

NSObject* x= ...;
CFTypeID typeID=CfgetTypeID((CFTypeRef)x);
if(typeID != CFStringGetTypeID() &&
   typeID != CFDateGetTypeID() &&
   typeID != CFDataGetTypeID() &&
   typeID != CFDictionaryGetTypeID() &&
   typeID != CFArrayGetTypeID()  ) {
       ... it's a non-plistable type ...
}

丑陋的if子句就在那里,因为没有公共函数可以为你提供非桥接的Objective-C对象的CFTypeID.
阅读CFType参考.但我不建议这样做.

python 报错 TypeError: type ‘types.GenericAlias‘ is not an acceptable base type

python 报错 TypeError: type ‘types.GenericAlias‘ is not an acceptable base type

系统有多个版本的python环境,python版本不匹配,使用合适的python版本即可解决问题

Generic Alias Type 是 python 内置类型 标准通用集合 这些标准库集合支持参数化泛型

列表如下:

  • tuple
  • list
  • dict
  • set
  • frozenset
  • type
  • collections.deque
  • collections.defaultdict
  • collections.OrderedDict
  • collections.Counter
  • collections.ChainMap
  • collections.abc.Awaitable
  • collections.abc.Coroutine
  • collections.abc.AsyncIterable
  • collections.abc.AsyncIterator
  • collections.abc.AsyncGenerator
  • collections.abc.Iterable
  • collections.abc.Iterator
  • collections.abc.Generator
  • collections.abc.Reversible
  • collections.abc.Container
  • collections.abc.Collection
  • collections.abc.Callable
  • collections.abc.Set
  • collections.abc.MutableSet
  • collections.abc.Mapping
  • collections.abc.MutableMapping
  • collections.abc.Sequence
  • collections.abc.MutableSequence
  • collections.abc.ByteString
  • collections.abc.MappingView
  • collections.abc.KeysView
  • collections.abc.ItemsView
  • collections.abc.ValuesView
  • contextlib.AbstractContextManager
  • contextlib.AbstractAsyncContextManager
  • re.Pattern
  • re.Match

今天关于typecho怎么seo(typecho怎么改头像)typecho修改头像的分享就到这里,希望大家有所收获,若想了解更多关于com.intellij.openapi.fileTypes.ex.FileTypeChooser的实例源码、Comment2Wechat —— Typecho 插件、objective-c – check id isKindOfType CFType、python 报错 TypeError: type ‘types.GenericAlias‘ is not an acceptable base type等相关知识,可以在本站进行查询。

本文标签: