    }

    @Override
    @Async
    public void summaryKfmsgByAi(List<String> externalUserIds) {

        transactionTemplate.execute(status -> {
            try {
                List<IYqueSummaryKfMsgDto> kfMsgDtos=this.findIYqueSummaryKfMsg(externalUserIds);

                if(CollectionUtil.isNotEmpty(kfMsgDtos)){

                    String prompt = String.format(promptTpl, JSONUtil.toJsonStr(kfMsgDtos));

                    log.info("当前聊天内容分析提示词:"+prompt);

                    String result = aiService.aiHandleCommonContent(prompt);

                    log.info("大模型输出原生结果:"+result);
                    if(StringUtils.isNotEmpty(result)) {
                        // 清理字符串：去除 ```json 和换行符
                        String cleanJsonString = result
                                .replace("```json", "")
                                .replace("```", "")
                                .trim();
                        if(StringUtils.isNotEmpty(cleanJsonString)) {
                            List<IYqueSummaryKfMsg> summaryKfMsgs
                                    = JSONUtil.toList(cleanJsonString, IYqueSummaryKfMsg.class);
                            summaryKfMsgs.stream().forEach(k->{
                                k.setCreateTime(new Date());
                            });
                            iYqueSummaryKfMsgDao.deleteByExternalUserIdIn(externalUserIds);
                            iYqueSummaryKfMsgDao.saveAll(summaryKfMsgs);

                        }
                    }
                }else {

                    log.warn("分析内容不存在");
                }
                return true;
            } catch (Exception e) {
                log.error("ai客服客户会话总结异常:"+e.getMessage());
                status.setRollbackOnly();
                throw e;
            }
        });

    }

    @Override
    public Page<IYqueSummaryKfMsg> findSummaryKfMsgs(IYqueSummaryKfMsg summaryKfMsg, Pageable pageable) {
        Specification<IYqueSummaryKfMsg> spec = Specification.where(null);

        if(StringUtils.isNotEmpty(summaryKfMsg.getNickname())){
            spec = spec.and((root, query, cb) -> cb.like(cb.lower(root.get("nickname")), "%" + summaryKfMsg.getNickname().toLowerCase() + "%"));
        }

        return   iYqueSummaryKfMsgDao.findAll(spec, pageable);
    }
}
package cn.iyque.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import cn.iyque.dao.IYqueAnnexPeriodDao;
import cn.iyque.dao.IYquePeriodMsgAnnexDao;
import cn.iyque.entity.IYqueAnnexPeriod;
import cn.iyque.entity.IYquePeriodMsgAnnex;
import cn.iyque.service.IYqueAnnexPeriodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class IYqueAnnexPeriodServiceImpl implements IYqueAnnexPeriodService {

    @Autowired
    private IYqueAnnexPeriodDao iYqueAnnexPeriodDao;

    @Autowired
    private IYquePeriodMsgAnnexDao iYquePeriodMsgAnnexDao;
    @Override
    public void saveAll(List<IYqueAnnexPeriod> annexLists) {
        iYqueAnnexPeriodDao.saveAll(annexLists);
    }

    @Override
    public List<IYqueAnnexPeriod> findIYqueAnnexPeriodByMsgId(Long msgId) {

        List<IYqueAnnexPerio


P(GL_OFFSET(_gloffset_WindowPos2dMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2fARB,WindowPos2fARB@8))
GL_PREFIX(WindowPos2fARB,WindowPos2fARB@8):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos2fMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2iARB,WindowPos2iARB@8))
GL_PREFIX(WindowPos2iARB,WindowPos2iARB@8):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos2iMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2sARB,WindowPos2sARB@8))
GL_PREFIX(WindowPos2sARB,WindowPos2sARB@8):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos2sMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2dvARB,WindowPos2dvARB@4))
GL_PREFIX(WindowPos2dvARB,WindowPos2dvARB@4):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos2dvMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2fvARB,WindowPos2fvARB@4))
GL_PREFIX(WindowPos2fvARB,WindowPos2fvARB@4):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos2fvMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2ivARB,WindowPos2ivARB@4))
GL_PREFIX(WindowPos2ivARB,WindowPos2ivARB@4):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos2ivMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos2svARB,WindowPos2svARB@4))
GL_PREFIX(WindowPos2svARB,WindowPos2svARB@4):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos2svMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3dARB,WindowPos3dARB@24))
GL_PREFIX(WindowPos3dARB,WindowPos3dARB@24):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos3dMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3fARB,WindowPos3fARB@12))
GL_PREFIX(WindowPos3fARB,WindowPos3fARB@12):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos3fMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3iARB,WindowPos3iARB@12))
GL_PREFIX(WindowPos3iARB,WindowPos3iARB@12):
	MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX)
	JMP(GL_OFFSET(_gloffset_WindowPos3iMESA))

ALIGNTEXT16
GLOBL_FN(GL_PREFIX(WindowPos3sARB,WindowPos3sARB@12))
GL_PREFIX(WindowPos3sARB,WindowPos3sARB@12):
	MOV_L(CONTENT(GLNAME(_glapi_


rce(expr_binary.rhs.span())
        );

        // Special expressions which operates on the stack in special ways.
        if expr_binary.op.is_assign() {
            compile_assign_binop(
                self,
                &*expr_binary.lhs,
                &*expr_binary.rhs,
                expr_binary.op,
                needs,
            )?;

            return Ok(());
        }

        // NB: need to declare these as anonymous local variables so that they
        // get cleaned up in case there is an early break (return, try, ...).
        self.compile((&*expr_binary.lhs, Needs::Value))?;
        self.scopes.decl_anon(span)?;

        self.compile((&*expr_binary.rhs, rhs_needs_of(expr_binary.op)))?;
        self.scopes.decl_anon(span)?;

        let inst = match expr_binary.op {
            ast::BinOp::Eq => Inst::Eq,
            ast::BinOp::Neq => Inst::Neq,
            ast::BinOp::Lt => Inst::Lt,
            ast::BinOp::Gt => Inst::Gt,
            ast::BinOp::Lte => Inst::Lte,
            ast::BinOp::Gte => Inst::Gte,
            ast::BinOp::Is => Inst::Is,
            ast::BinOp::IsNot => Inst::IsNot,
            ast::BinOp::And => Inst::And,
            ast::BinOp::Or => Inst::Or,
            ast::BinOp::Add => Inst::Op { op: InstOp::Add },
            ast::BinOp::Sub => Inst::Op { op: InstOp::Sub },
            ast::BinOp::Div => Inst::Op { op: InstOp::Div },
            ast::BinOp::Mul => Inst::Op { op: InstOp::Mul },
            ast::BinOp::Rem => Inst::Op { op: InstOp::Rem },
            ast::BinOp::BitAnd => Inst::Op { op: InstOp::BitAnd },
            ast::BinOp::BitXor => Inst::Op { op: InstOp::BitXor },
            ast::BinOp::BitOr => Inst::Op { op: InstOp::BitOr },
            ast::BinOp::Shl => Inst::Op { op: InstOp::Shl },
            ast::BinOp::Shr => Inst::Op { op: InstOp::Shr },
            op => {
                return Err(CompileError::new(
                    span,
                    CompileErrorKind::UnsupportedBinaryOp { op },
                ));
            }
        };

        self.asm.push(inst, span);

        // NB: we put it here to preserve the call in case it has side effects.
        // But if we don't need the value, then pop it from the stack.
        if !needs.value() {
            self.asm.push(Inst::Pop, span);
        }

        self.scopes.undecl_anon(2, span)?;
        Ok(())
    }
}

/// Get the need of the right-hand side operator from the type of the
/// operator.
fn rhs_needs_of(op: ast::BinOp) -> Needs {
    match op {
        ast::BinOp::Is | ast::BinOp::IsNot => Needs::Type,
        _ => Needs::Value,
    }
}

fn compile_assign_binop(
    this: &mut Compiler<'_>,
    lhs: &ast::Expr,
    rhs: &ast::Expr,
    bin_op: ast::BinOp,
    needs: Needs,
) -> CompileResult<()> {
    let span = lhs.span().join(rhs.span());

    // assignments
    if let ast::BinOp::Assign = bin_op {
        let supported = match lhs {
            // <var> = <value>
            ast::Expr::Path(path) if path.rest.is_empty() => {
                this.compile((rhs, Needs::Value))?;

                let ident = path.first.resolve(this.storage, &*this.source)?;
                let var = this
                    .scopes
                    .get_var(&*


src="//upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Sub_off.svg/10px-Sub_off.svg.png" decoding="async" title="Substituted off" width="10" height="13" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Sub_off.svg/15px-Sub_off.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3b/Sub_off.svg/20px-Sub_off.svg.png 2x" data-file-width="550" data-file-height="700" /> 66'

Substitutes:

MF
15
Stig Tøfting
 72'
 46'

FW
19
Ebbe Sand

 66'

DF
2
Michael Schjønberg


acity(0.75),
          tabs: <Row>[
            Row(
              children: <Widget>[
                const Text("Differed Jobs"),
                const SizedBox(width: 5),
                Container(
                  height: 22,
                  width: 22,
                  decoration: BoxDecoration(
                    shape: BoxShape.circle,
                    color: tabController.index == 0 ? theme.primaryColor.useOpacity(0.5) : Colors.grey.useOpacity(0.3),
                  ),
                  child: Center(child: Text('$deferredJobCount', style: theme.textTheme.labelSmall,)),
                )
              ],
            ),
            Row(
              children: <Widget>[
                const Text("Recurring Jobs"),
                const SizedBox(width: 5),
                Container(
                  height: 22,
                  width: 22,
                  decoration: BoxDecoration(
                    shape: BoxShape.circle,
                    color: tabController.index == 1 ? theme.primaryColor.useOpacity(0.5) : Colors.grey.useOpacity(0.3),
                  ),
                  child: Center(child: Text('$recurringJobCount', style: theme.textTheme.labelSmall,)),
                )
              ],
            )
          ],
        ),
      ),
      body: TabBarView(
        controller: tabController,
        children: <Widget>[
          DeferredJobScreen(
            sshClient: sshClient!,
            onJobCountChanged: updateDeferredJobCount,
          ),
          RecurringJobScreen(
            sshClient: sshClient,
            onJobCountChanged: updateRecurringJobCount,
          ),
        ],
      ),
      floatingActionButton: FloatingActionButton.extended(
        onPressed: _handleFabClick,
        tooltip: "Create ${tabController.index == 0 ? 'At' : 'Cron'} Job",
        elevation: 4.0,
        icon: Icon(Icons.add, color: theme.colorScheme.onSurface),
        label: Text('Add Task', style: theme.textTheme.labelLarge),
      ),
    );
  }
}
import 'package:flutter/material.dart';
import '../../../data/models/remote_file.dart';
import 'file_list_title.dart';

class DirectoryView extends StatelessWidget {
  final List<RemoteFile> files;
  final Set<RemoteFile> selectedFiles;
  final String currentPath;
  final Function(String) onDirectoryTap;
  final Function(RemoteFile) onFileLongPress;
  final Function(RemoteFile) onFileTap;

  const DirectoryView({
    super.key,
    required this.files,
    required this.selectedFiles,
    required this.currentPath,
    required this.onDirectoryTap,
    required this.onFileLongPress,
    required this.onFileTap,
  });

  @override
  Widget build(BuildContext context) {
    return ListView.separated(
      // padding: const EdgeInsets.only(bottom: 80), // Space for FAB
      itemCount: files.length,
      separatorBuilder: (context, index) => const Divider(
        height: 0,
        thickness: 0.08,
      ),
      itemBuilder: (context, index) {
        final file = files[index];
        final isSelected = selectedFiles.contains(file);

        return FileListTile(
          file: file,
          isSelected: isSelected,
          onTap: () => onFileTap(file),
          onLongPress: () => onFileLongPress(file),
        );
      },
    );
  }
}import 'package:file_picker/file_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
import 'package:permission_handler/permission_handler.dart';
import


 containerMonitorRunner.getMaxRunningContainersReport();
      assertEquals(expectedNMCounts[0], maxRunningContainersOnNMs[0]);
      assertEquals(expectedNMCounts[1], maxRunningContainersOnNMs[1]);

      try {
        yarnClient = YarnClient.createYarnClient();
        yarnClient.init(
            new Configuration(distShellTest.getYarnClusterConfiguration()));
        yarnClient.start();
        yarnClient.killApplication(appARef.get().getApplicationId());
      } catch (Exception e) {
        // Ignore Exception while killing a job
        LOG.warn("Exception killing the job: {}", e.getMessage());
      }
    } finally {
      if (yarnClient != null) {
        yarnClient.stop();
      }
      if (clientB != null) {
        clientB.sendStopSignal();
      }
      if (containerMonitorRunner != null) {
        containerMonitorRunner.stopMonitoring();
        containerMonitorRunner.join();
      }
    }
  }

  protected String generateAppName(String name) {
    return generateAppName(name, null);
  }

  protected String generateAppName(String name, String postFix) {
    return name.replaceFirst("test", "")
        .concat(postFix == null ? "" : "-" + postFix);
  }

  private void waitForExpectedNMsCount(int[] expectedNMCounts,
      AtomicReference<RMApp> appARef,
      AtomicReference<NodeId> masterContainerNodeIdARef) throws Exception {
    GenericTestUtils.waitFor(() -> {
      if ((expectedNMCounts[0] + expectedNMCounts[1]) < 2) {
        expectedNMCounts[0] =
            distShellTest.getNodeManager(0).getNMContext()
                .getContainers().size();
        expectedNMCounts[1] =
            distShellTest.getNodeManager(1).getNMContext()
                .getContainers().size();
        return false;
      }
      ConcurrentMap<ApplicationId, RMApp> appIDsMap =
          distShellTest.getResourceManager().getRMContext().getRMApps();
      if (appIDsMap.isEmpty()) {
        return false;
      }
      appARef.set(appIDsMap.values().iterator().next());
      if (appARef.get().getAppAttempts().isEmpty()) {
        return false;
      }
      RMAppAttempt appAttemptA =
          appARef.get().getAppAttempts().values().iterator().next();
      if (appAttemptA.getMasterContainer() == null) {
        return false;
      }
      masterContainerNodeIdARef.set(
          appAttemptA.getMasterContainer().getNodeId());
      return true;
    }, 10, 60000);
  }

  /**
   * Monitor containers running on NMs.
   */
  class NMContainerMonitor extends Thread {
    // The interval of milliseconds of sampling (500ms)
    private final static int SAMPLING_INTERVAL_MS = 500;

    // The maximum number of containers running on each NMs
    private final int[] maxRunningContainersOnNMs = new int[NUM_NMS];
    private final Object quitSignal = new Object();
    private volatile boolean isRunning = true;

    @Override
    public void run() {
      while (isRunning) {
        for (int i = 0; i < NUM_NMS; i++) {
          int nContainers =
              distShellTest.getNodeManager(i).getNMContext()
                  .getContainers().size();
          if (nContainers > maxRunningContainersOnNMs[i]) {
            maxRunningContainersOnNMs[i] = nContainers;
          }
        }
        synchronized (quitSignal) {
          try {
            if (!isRunning) {
              break;
            }
            quitSignal.wait(SAMPLING_INTERVAL_MS);
          } catch (InterruptedException e) {
            LOG.warn("NMContainerMonitor interrupted");
            isRunning = false;
            break;
          }
        }
      }
    }

    public int[] getMaxRunningContainersReport()


OSFILE

:OPEN         STX   OPENPL+1           ; Open the specified directory
              STY   OPENPL+2
              JSR   OPENFILE
              BCS   CATEXIT            ; Can't open dir

CATREENTRY    LDA   OPENPL+5           ; File ref num
              STA   READPL+1
              JSR   RDFILE
              BCS   :CATERR
              >>>   XF2AUX,PRONEBLK

:CATERR       CMP   #$4C               ; EOF
              BNE   :NOTEOF
              LDA   #$00
:NOTEOF       PHA
              LDA   OPENPL+5           ; File ref num
              STA   CLSPL+1
              JSR   CLSFILE
              PLA
CATEXIT       >>>   XF2AUX,STARCATRET

* Handle *INFO
INFO          JSR   PREPATH            ; Preprocess pathname
              SEC
              JSR   WILDCARD           ; Handle any wildcards
              JSR   EXISTS             ; Check matches something
              BNE   INFOFIRST          ; Match found, start listing
              LDA   #$46               ; No match, error Not found
INFOEXIT      CMP   #$4C               ; EOF
              BNE   INFOCLS
              LDA   #$00               ; EOF is not an error
INFOCLS       PHA
              JSR   CLSDIR             ; Be sure to close it!
              PLA
              BRA   CATEXIT

* PRONEBLK call returns here ...
CATALOGRET    >>>   ENTMAIN
              LDA   CATARG
              CMP   #$80               ; Is this an *INFO call?
              BNE   CATREENTRY         ; No, go back and do another CAT/EX

INFOREENTRY   JSR   WILDNEXT2          ; Start of new block
              BCS   INFOEXIT           ; No more matches
INFOFIRST     LDA   WILDIDX
              CMP   #$FF               ; Is WILDNEXT about to read new blk?
              BEQ   :DONEBLK           ; If so, print this blk first
              JSR   WILDNEXT2
              BCC   INFOFIRST          ; Find more entries
:DONEBLK      >>>   XF2AUX,PRONEBLK

CATARG        DB    $00

* Helper routine to truncate path in MOSFILE at the top level
* So '/FOO/BAR/BAZ' -> '/FOO'
TRUNCPATH     LDX   #$01               ; Skip over initial '/'
:L1           CPX   MOSFILE            ; See if end of string
              BCS   :EXIT              ; If so ... we are done
              BEQ   :EXIT
              LDA   MOSFILE+1,X        ; Get char from path
              CMP   #'/'               ; See if it is slash
              BNE   :NOTSLASH
              STX   MOSFILE            ; If so, truncate here
              BRA   :EXIT
:NOTSLASH     INX
              BRA   :L1
:EXIT         RTS

* Set prefix. Used by *CHDIR/*DRIVE to change directory
* Y= $00 - CHDIR, select any directory
* Y<>$00 - DRIVE, must select root
*
SETPFX        >>>   ENTMAIN
              PHY                      ; Save CHDIR/DRIVE flag
              JSR   PREPATH            ; Preprocess pathname
              BCS   :EXIT
              JSR   WILDONE            ; Handle any wildcards
              LDA   #$2E
              BCS   :EXIT              ; Exit with wildcard path
              PLY                      ; CHDIR/DRIVE flag
              CPY   #$00               ; If <> $00 (ie: *DRIVE)
              BEQ   :CHDIR
              JSR   TRUNCPATH          ; Truncate to top level
:CHDIR        LDA   #<MOSFILE
              STA   SPFXPL+1
              LDA   #>MOSFILE
              STA   SPFXPL+2
              JSR   MLI                ; SET_PREFIX
              DB    SPFXCMD
              DW    SPFXPL

:EXIT         >>>   XF2AUX,CHDIRRET

* Obtain info on total


ineProperty(t,"__esModule",{value:true});t.DataConnector=void 0;class n{async list(e){throw new Error("DataConnector#list method has not been implemented.")}async remove(e){throw new Error("DataConnector#remove method has not been implemented.")}async save(e,t){throw new Error("DataConnector#save method has not been implemented.")}}t.DataConnector=n},17266:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))i(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});s(n(89525),t);s(n(14623),t);s(n(51156),t);s(n(64962),t);s(n(7263),t)},14623:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},51156:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RestorablePool=void 0;const i=n(5596);const s=n(75379);const o=n(71372);class r{constructor(e){this._added=new o.Signal(this);this._current=null;this._currentChanged=new o.Signal(this);this._hasRestored=false;this._isDisposed=false;this._objects=new Set;this._restore=null;this._restored=new i.PromiseDelegate;this._updated=new o.Signal(this);this.namespace=e.namespace}get added(){return this._added}get current(){return this._current}set current(e){if(this._current===e){return}if(e!==null&&this._objects.has(e)){this._current=e;this._currentChanged.emit(this._current)}}get currentChanged(){return this._currentChanged}get isDisposed(){return this._isDisposed}get restored(){return this._restored.promise}get size(){return this._objects.size}get updated(){return this._updated}async add(e){var t,n;if(e.isDisposed){const t="A disposed object cannot be added.";console.warn(t,e);throw new Error(t)}if(this._objects.has(e)){const t="This object already exists in the pool.";console.warn(t,e);throw new Error(t)}this._objects.add(e);e.disposed.connect(this._onInstanceDisposed,this);if(a.injectedProperty.get(e)){return}if(this._restore){const{connector:i}=this._restore;const s=this._restore.name(e);if(s){const o=`${this.namespace}:${s}`;const r=(n=(t=this._restore).args)===null||n===void 0?void 0:n.call(t,e);a.nameProperty.set(e,o);await i.save(o,{data:r})}}this._added.emit(e)}dispose(){if(this.isDisposed){return}this._current=null;this._isDis


rt javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 帖子收藏接口

 */
@RestController
@RequestMapping("/post_favour")
@Slf4j
public class PostFavourController {

    @Resource
    private PostFavourService postFavourService;

    @Resource
    private PostService postService;

    @Resource
    private UserService userService;

    /**
     * 收藏 / 取消收藏
     *
     * @param postFavourAddRequest
     * @param request
     * @return resultNum 收藏变化数
     */
    @PostMapping("/")
    public BaseResponse<Integer> doPostFavour(@RequestBody PostFavourAddRequest postFavourAddRequest,
            HttpServletRequest request) {
        if (postFavourAddRequest == null || postFavourAddRequest.getPostId() <= 0) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }
        // 登录才能操作
        final User loginUser = userService.getLoginUser(request);
        long postId = postFavourAddRequest.getPostId();
        int result = postFavourService.doPostFavour(postId, loginUser);
        return ResultUtils.success(result);
    }

    /**
     * 获取我收藏的帖子列表
     *
     * @param postQueryRequest
     * @param request
     */
    @PostMapping("/my/list/page")
    public BaseResponse<Page<PostVO>> listMyFavourPostByPage(@RequestBody PostQueryRequest postQueryRequest,
            HttpServletRequest request) {
        if (postQueryRequest == null) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }
        User loginUser = userService.getLoginUser(request);
        long current = postQueryRequest.getCurrent();
        long size = postQueryRequest.getPageSize();
        // 限制爬虫
        ThrowUtils.throwIf(size > 20, ErrorCode.PARAMS_ERROR);
        Page<Post> postPage = postFavourService.listFavourPostByPage(new Page<>(current, size),
                postService.getQueryWrapper(postQueryRequest), loginUser.getId());
        return ResultUtils.success(postService.getPostVOPage(postPage, request));
    }

    /**
     * 获取用户收藏的帖子列表
     *
     * @param postFavourQueryRequest
     * @param request
     */
    @PostMapping("/list/page")
    public BaseResponse<Page<PostVO>> listFavourPostByPage(@RequestBody PostFavourQueryRequest postFavourQueryRequest,
            HttpServletRequest request) {
        if (postFavourQueryRequest == null) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }
        long current = postFavourQueryRequest.getCurrent();
        long size = postFavourQueryRequest.getPageSize();
        Long userId = postFavourQueryRequest.getUserId();
        // 限制爬虫
        ThrowUtils.throwIf(size > 20 || userId == null, ErrorCode.PARAMS_ERROR);
        Page<Post> postPage = postFavourService.listFavour


hildren.get(board[cy][cx]).value);
    }

    for (let j = 0; j < dx.length; j++) {
      const nx = cx + dx[j];
      const ny = cy + dy[j];

      if (nx >= 0 && nx < w && ny >= 0 && ny < h && !checked[ny][nx]) {
        checked[ny][nx] = true;
        dfs([ny, nx], children.get(board[cy][cx]).children);
        checked[ny][nx] = false;
      }
    }
  };

  const trie = new Trie();

  for (const word of words) {
    trie.add(word);
  }

  for (let i = 0; i < h; i++) {
    for (let j = 0; j < w; j++) {
      checked[i][j] = true;
      dfs([i, j], trie.head.children);
      checked[i][j] = false;
    }
  }

  return [...answer];
};
/**
 * 최대 k번 문자 변경 후, 가장 긴 동일문자 부분문자열 찾기
 * 문자열 s와 정수 k, 최대 k번까지 문자를 다른 영문대문자로 바꿀 수 있음
 * 동일한 문자로 구성된 가장 긴 부분문자열 길이를 리턴해라
 *
 * 슬라이딩 윈도우 사용(문자열을 한번만 순회)
 * 윈도우 내에서, 가장 많이 등장하는 문자를 제외한 나머지 문자들이, k개 이하일 때만, 유효한 부분 문자열이다
 * 조건을 만족하지 않으면 윈도우의 왼쪽 포인터를 오른쪽으로 이동하여 윈도우 크기를 줄인다
 *
 * 시간복잡도 O(n)
 * 공간복잡도 O(1) - 문자 빈도수 저장배열 크기는 항상 26 고정
 */

/**
 * @param {string} s
 * @param {number} k
 * @return {number}
 */
var characterReplacement = function (s, k) {
  // 문자 빈도수를 저장할 배열 (A-Z: 65-90) 0으로 초기화
  const charCount = new Array(26).fill(0);

  let left = 0; // 윈도우 왼쪽 끝
  let maxCount = 0; // 현재 윈도우에서 가장 많이 등장하는 문자의 빈도수
  let maxLength = 0; // 결과: 가장 긴 부분 문자열 길이

  // 윈도우의 오른쪽 끝 이동
  for (let right = 0; right < s.length; right++) {
    // 현재 문자의 빈도수 증가 (문자 코드를 인덱스로 변환)
    const charIndex = s.charCodeAt(right) - 65;
    charCount[charIndex]++;

    // 현재 윈도우에서 가장 많이 등장하는 문자의 빈도수 업데이트
    maxCount = Math.max(maxCount, charCount[charIndex]);

    // 현재 윈도우에서 변경해야 할 문자 수가 k를 초과하면 윈도우의 왼쪽을 이동
    // 현재 윈도우에서 변경해야 할 문자 수: 윈도우 크기 - 가장 많이 등장하는 문자의 빈도수
    // 윈도우 크기: right - left + 1
    if (right - left + 1 - maxCount > k) {
      // 왼쪽 문자의 빈도수 감소
      const leftCharIndex = s.charCodeAt(left) - 65;


atestEpoch
	}
	return Epoch{}
}

type QueryCountPoCbatchesAtHeightRequest struct {
	BlockHeight int32 `protobuf:"varint,1,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"`
}

func (m *QueryCountPoCbatchesAtHeightRequest) Reset()         { *m = QueryCountPoCbatchesAtHeightRequest{} }
func (m *QueryCountPoCbatchesAtHeightRequest) String() string { return proto.CompactTextString(m) }
func (*QueryCountPoCbatchesAtHeightRequest) ProtoMessage()    {}
func (*QueryCountPoCbatchesAtHeightRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_cf0cfe3b0e1cc5bd, []int{112}
}
func (m *QueryCountPoCbatchesAtHeightRequest) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryCountPoCbatchesAtHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryCountPoCbatchesAtHeightRequest.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *QueryCountPoCbatchesAtHeightRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryCountPoCbatchesAtHeightRequest.Merge(m, src)
}
func (m *QueryCountPoCbatchesAtHeightRequest) XXX_Size() int {
	return m.Size()
}
func (m *QueryCountPoCbatchesAtHeightRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_QueryCountPoCbatchesAtHeightRequest.DiscardUnknown(m)
}

var xxx_messageInfo_QueryCountPoCbatchesAtHeightRequest proto.InternalMessageInfo

func (m *QueryCountPoCbatchesAtHeightRequest) GetBlockHeight() int32 {
	if m != nil {
		return m.BlockHeight
	}
	return 0
}

type QueryCountPoCbatchesAtHeightResponse struct {
	Count uint64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
}

func (m *QueryCountPoCbatchesAtHeightResponse) Reset()         { *m = QueryCountPoCbatchesAtHeightResponse{} }
func (m *QueryCountPoCbatchesAtHeightResponse) String() string { return proto.CompactTextString(m) }
func (*QueryCountPoCbatchesAtHeightResponse) ProtoMessage()    {}
func (*QueryCountPoCbatchesAtHeightResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_cf0cfe3b0e1cc5bd, []int{113}
}
func (m *QueryCountPoCbatchesAtHeightResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *QueryCountPoCbatchesAtHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_QueryCountPoCbatchesAtHeightResponse.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *QueryCountPoCbatchesAtHeightResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_QueryCountPoCbatchesAtHeightResponse.Merge(m, src)
}
func (m *QueryCountPoCbatchesAtHeightResponse) XXX_Size() int {
	return m.Size()
}
func (m *QueryCountPoCbatchesAtHeightResponse) XXX_DiscardUnknown()


ii-fallback"),
        target_os = "linux",
        not(x11),
        feature = "tokio"
    ))]
    pub async fn execute_async<C>(&self, ctx: &mut C) -> Result<(), GenericError<C::PlatformError>>
        where C: FallibleContext + KeyboardContext + MouseContext + AsciiKeyboardContext
    {
        if self.execute_unicode(ctx)? {
            return Ok(());
        }

        use Command::*;
        match self {
            Delay(millis) => Ok(tokio::time::sleep(Duration::from_millis(*millis as u64)).await),
            _ => std::unreachable!()
        }
    }
}
//use macros::debug;
use crate::instrument::Instrument;
use crate::vanilla_swap::VanillaSwap;
use crate::lsm::*;
use model::live_model::LiveModel;
use data_cube::data_cube::Cube;
//use curve::curve::Curve;
//use curve::curve::IrCurve;
use std::collections::HashMap;
use serde::{Serialize, Deserialize};
use logger::Logger;

/// Callable swap implementation
/// (vanilla swap + call dates)
#[derive(Serialize, Deserialize)]
pub struct CallableSwap
{
    pub name: String,
    pub exposure_discount_model_name:String,
    pub underlying:VanillaSwap,
    pub call_dates:Vec<f64>
}

impl CallableSwap
{
    ///Add a 'rich' (date,callable_flag) date to an vec of rich dates
    /// If a date is already present, then xor the callability flags
    fn add_rich_date(rich_dates:&mut Vec<(bool,f64)>,is_call_date:bool,date:f64) -> ()
    {
        let tolerance:f64=0.00001;
        for rd in 0..rich_dates.len()
        {
            if (rich_dates[rd].1-date).abs()<tolerance
            {
                rich_dates[rd].0=is_call_date;
                return;
            }
        }
        rich_dates.push((is_call_date,date));
    }
}

impl Instrument for CallableSwap
{
    fn get_name(&self) -> String
    {
        return self.name.clone();
    }

    fn compute_values(&self,start:usize,result_cube:&mut Cube,live_models:&HashMap<String,LiveModel>,logger:&Logger) -> (Vec<Vec<(f64,f64)>>,Cube)
    {
        let date_threshold=0.001;
        let exp_dsc_model=match live_models.get(&self.exposure_discount_model_name)
        {
            Some(leg)   =>  leg,
            None        =>  panic!("Instrument {} refers to non-existent model ({})!",&self.name,&self.exposure_discount_model_name)
        };

        //Remember: swaps must have at least one leg
        let maturity_date=self.underlying.legs.iter().map(|leg| *leg.payment_dates.last().unwrap()).fold(f64::NEG_INFINITY, f64::max);
        logger.log(format!("callable-swap|compute_values -> maturity: {}",maturity_date),"instrument");
        //Create instrument values cube: the dates are the union of the dates in the result cube + call dates+ maturity date
        //A rich date is a tuple (is_call_date,date)
        let mut rich_dates:Vec<(bool,f64)>=Vec::new();
        for dt_idx in 0..result_cube.dates.len()
        {
            if (maturity_date-result_cube.dates[dt_idx])>date_threshold
            {
                rich_dates.push((false,result_cube.dates[dt_idx]));
            }
        }
        //For callable swaps the maturity date does not affect callability (i.e. value is always 0 at maturity)
        CallableSwap::add_rich_date(&mut rich_dates,false,maturity_date);

        //Add call dates
        for call_dt_idx in 0..self.call_dates.len


   print()
   print("Search results:")
   print("===============")
   print()
   local sources, binaries = split_source_and_binary_results(results)
   if next(sources) and not flags["binary"] then
      print("Rockspecs and source rocks:")
      print("---------------------------")
      print()
      print_results(sources, true)
   end
   if next(binaries) and not flags["source"] then
      print("Binary and pure-Lua rocks:")
      print("--------------------------")
      print()
      print_results(binaries, true)
   end
   return true
end


---------------------------------------------------------------------------
--- Display the time (and date) in a text box.
--
-- The `wibox.widget.textclock` widget is part of the Awesome WM's widget
-- system (see @{03-declarative-layout.md}).
--
-- This widget displays a text clock formatted by the
-- [GLib Date Time format](https://developer.gnome.org/glib/stable/glib-GDateTime.html#g-date-time-format)
-- and [GTimeZone](https://developer.gnome.org/glib/stable/glib-GTimeZone.html#g-time-zone-new).
--
-- The `wibox.widget.textclock` inherits from `wibox.widget.textbox`. It means
-- that, once created, the user will receive a derivated instance of
-- `wibox.widget.textbox` associated with a private `gears.timer` to manage
-- timed updates of the displayed clock.
--
-- Use a `wibox.widget.textclock`
-- ---
--
--
--
--<object class=&#34img-object&#34 data=&#34../images/AUTOGEN_wibox_widget_defaults_textclock.svg&#34 alt=&#34Usage example&#34 type=&#34image/svg+xml&#34></object>
--
--
--     local my_textclock = wibox.widget.textclock('%a %b %d, %H:%M')
--
-- Alternatively, you can declare the `textclock` widget using the
-- declarative pattern (Both codes are strictly equivalent):
--
--
--
--
--
--     local my_textclock = wibox.widget {
--         format = '%a %b %d, %H:%M',
--         widget = wibox.widget.textclock
--     }
--
-- The GLib DateTime format
-- ---
--
-- The time displayed by the textclock widget can be formated by the GLib
-- DateTime format.
--
-- Here is a short list with commonly used format specifiers (extracted from
-- the Glib API references):
--
----

--

--   Format
--   Description
--

--
%a	The abbreviated weekday name according to the current locale

--
%A	the full weekday name according to the current locale

--
%b	The abbreviated month name according to the current locale

--
%B	The full month name according to the current locale

--
%d	The day of the month as a decimal number (range 01 to 31)

--
%e	The day of the month as a decimal number (range 1 to 31)

--
%F	Equivalent to %Y-%m-%d (the ISO 8601 date format)

--
%H	The hour as a decimal number using a 24-hour clock (range 00 to 23)

--
%I	The hour as a decimal number using a 12-hour clock (range 01 to 12)

--
%k	The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank

--
%l	The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank

--
%m	The month as a decimal number (range 01 to 12)

--
%M	The minute as a decimal number (range 00 to 59)

-


PrimitiveInteger(implicitUnboxing)
}

private fun testAutoboxing_smartCast() {
  // Box
  val boxedInteger: Int? = 100

  if (boxedInteger is Int) {
    // Smart cast makes the assignment to implicitly unbox.
    val primitiveInteger: Int = boxedInteger

    assertIsBoxedInteger(boxedInteger)
    assertTrue(boxedInteger is Int)
    assertTrue(primitiveInteger == 100)

    val implicitUnboxing: Int = boxedInteger
    assertIsPrimitiveInteger(implicitUnboxing)
  }
}

private fun testAutoboxing_arrayExpressions() {
  val boxedInteger1 = Ref(100)
  val boxedInteger2 = Ref(50)
  val objects = arrayOfNulls<Any>(boxedInteger1.field)
  assertTrue(objects.size == 100)
  val marker = Any()
  objects[boxedInteger2.field] = marker
  assertTrue(objects[50] === marker)

  val boxedIntegers = arrayOf<Int?>(1, 2, 3)
  assertTrue(boxedIntegers[0] is Int)
  val primitiveInts: IntArray = intArrayOf(Ref(1).field, Ref(2).field, Ref(3).field)
  assertTrue(primitiveInts[0] == 1)
}

/**
 * Actually the boolean conditional unboxings don't get inserted and aren't needed because we have
 * devirtualized Boolean.
 */
private fun testUnbox_conditionals() {
  val boxedFalseBoolean = Ref(false)
  if (boxedFalseBoolean.field) {
    // If unboxing is missing we'll arrive here.
    fail()
  }
  while (boxedFalseBoolean.field) { // implicit unboxing
    // If unboxing is missing we'll arrive here.
    fail()
  }
  var count = Ref(0)
  do {
    if (count.field > 0) {
      // If unboxing is missing we'll arrive here.
      fail()
    }
    count.field++
  } while (boxedFalseBoolean.field)
  while (boxedFalseBoolean.field) {

    // If unboxing is missing we'll arrive here.
    fail()
  }
  val unusedBlah: Any? = if (boxedFalseBoolean.field) doFail() else doNothing()
  val b: Ref<Boolean> = Ref(null) as Ref<Boolean>
  assertThrowsNullPointerException { if (b.field) {} }
  assertThrowsNullPointerException { while (b.field) {} }
  assertThrowsNullPointerException { while (b.field) {} }
  assertThrowsNullPointerException { do {} while (b.field) }
  assertThrowsNullPointerException {
    var i: Ref<Int> = Ref(null) as Ref<Int>
    when (i.field) {
      1 -> i.field = 3
      else -> {}
    }
  }
}

private fun testUnbox_switchExpression() {
  val intHolder = Ref(100)
  when (intHolder.field) {
    100 -> {}
    else -> // If unboxing is missing we'll arrive here.
    fail()
  }
}

private fun testAutoboxing_compoundAssignmentSequence() {
  var boxI = Ref(1)
  var i = 2
  // Compound assignment is not an expression in Kotlin
  // boxI /* 6 */ += i /* 5 */ += boxI /* 3 */ += i /* 2*/;

  // assertTrue(i == 5);
  // assertTrue(boxI == 6);
}

private fun <T : Long> testUnbox_fromTypeVariable() {
  val n = Ref(10L as T)
  // Auto unboxing from variable n.
  var l: Long = n.field
  assertIsBoxedLong(n.field)
  assertTrue(l == 10L)
  class Local<T : Long?> {
    fun toLong(l: T): T {
      // Auto unboxing from variable l.
      assertTrue(l == 11L)
      return l
    }
  }

  // Auto boxing parameter.
  l = Local<Long>().toLong(11L)
  assertTrue(l == 11L)
}

p


。

每个占位符名称在模板中必须是唯一的、矩形的。否则，该模板将无效，流式布局将采用默认的flow:default.

例如，下面的HTML标记：

<ul>
    <li> "a", width:auto (that is 1*), height:auto(that is max-intrinsic) </li>
    <li> "b", width:150px, height:max-intrinsic </li>
    <li> "c", width:*, height:* (a.k.a. shrink-to-fit) </li>
    <li> "d", width:150px, height:* </li>
    <li> "e", width:150px, height:* </li>
    <li> "f", width:150, height:150px</li>
 </ul>

设置样式后渲染结果如下：

除了用字符定义名称外，还可以使用子元素在模板容器中的顺序数字，所以下面的这个模板：

flow: grid(1 1,
           2 3);

会导致容器的前三个子元素布局到两行，且第一个元素放置在第一行，而第二、第三个元素放置在第二行。

3.6. row函数布局( flow: row(tag1, tag2, ...) )

flow:row()函数用来实现类似table的布局。 row()函数的参数为元素标签的列表，该列表定义的元素将会放置在表格中的单独一行。

考虑下面的HTML标记:

<dl><dt>第一项</dt>
    <dd>第一项的描述</dd>
    <dt>第二项</dt>
    <dd>第二项的描述</dd></dl>

并且设置它的样式如下:

dl { flow: row(dt,dd); }

则它们将会渲染成如下：

        第一项
        第一项的描述

        第二项
        第二项的描述

如果flow:row(...)布局的元素内存在不匹配row中的模板的元素，则该元素将会被放置在单独的一行并跨越所有列。所有考虑下面的HTML标记：

<dl>
  <header>组别1</header&g


= "view_tips_top_01"
  L2_2 = L2_2(L3_2, L4_2)
  L3_2 = L2_2
  L2_2 = L2_2.fB3CF1DEB
  L2_2 = L2_2(L3_2)
  L3_2 = C3B091777E3EC94A5
  L3_2 = L3_2.S3AB27FFAF33EFD2D
  L3_2 = L3_2.h
  L3_2 = L3_2[L2_2]
  L4_2 = L42_1.tnull
  if L3_2 == L4_2 then
    L3_2 = nil
  end
  L4_2 = C931098C27BA0B398
  L5_2 = lua.Boot.__cast
  L6_2 = L3_2
  L7_2 = C0CEEDFDE89C3FCFD
  L5_2 = L5_2(L6_2, L7_2)
  L4_2.S01A3531F6B7E2484 = L5_2
  L4_2 = C931098C27BA0B398
  L4_2 = L4_2.S01A3531F6B7E2484
  L5_2 = L4_2
  L4_2 = L4_2.FD10487F585450DF8
  L6_2 = A0_2
  L7_2 = A1_2
  L4_2 = L4_2(L5_2, L6_2, L7_2)
  if not L4_2 then
    L4_2 = C931098C27BA0B398
    L4_2 = L4_2.SABFFEAC5EAF278A5
    L5_2 = L4_2
    L4_2 = L4_2.f5C99C0AC
    L4_2(L5_2)
    L4_2 = C931098C27BA0B398
    L4_2.SABFFEAC5EAF278A5 = nil
    L4_2 = C931098C27BA0B398
    L4_2.S01A3531F6B7E2484 = nil
    return
  end
  while true do
    L4_2 = C931098C27BA0B398
    L4_2 = L4_2.S01A3531F6B7E2484
    L5_2 = L4_2
    L4_2 = L4_2.F868C8FD3C51947ED
    L4_2 = L4_2(L5_2)
    if L4_2 then
      break
    end
    L4_2 = CC6FE82819C6E1D55
    L4_2 = L4_2.S12F63EE47FFCB183
    L4_2()
  end
  L4_2 = C931098C27BA0B398
  L4_2 = L4_2.SABFFEAC5EAF278A5
  L5_2 = L4_2
  L4_2 = L4_2.f5C99C0AC
  L4_2(L5_2)
  L4_2 = C931098C27BA0B398
  L4_2.SABFFEAC5EAF278A5 = nil
  L4_2 = C931098C27BA0B398
  L4_2.S01A3531F6B7E2484 = nil
end

_ENV["C931098C27BA0B398"]["SC152E568CEDF016D"] = function(A0_2, A1_2)

  local L2_2, L3_2, L4_2
  while true do
    L2_2 = C38031D3FA506665C
    L2_2 = L2_2.SFBFE6A0479


处理返回按钮点击事件
        selector = PathSelector.build(MainActivity.this, MConstants.BUILD_DIALOG)
                .setAlwaysShowHandleFragment(true)
                .setMorePopupItemListeners(
                        new CommonItemListener("SelectAll") {
                            @Override
                            public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
                                /**取消dialog弹窗
                                 * pathSelectFragment.close();
                                 */
                                return false;
                            }
                        },
                        new CommonItemListener("DeselectAll") {
                            @Override
                            public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
                                pathSelectFragment.selectAllFile(false);
                                return false;
                            }
                        }
                )
                .setHandleItemListeners(
                        new CommonItemListener("选择文件夹") {
                            @Override
                            public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
                                switch (selectedFiles.size()) {
                                    case 0:
                                        Mtools.toast("你选择的是：" + currentPath);
                                        break;
                                    case 1:
                                        Mtools.toast("你选择的是：" + selectedFiles.get(0).getPath());
                                        break;
                                    default:
                                        Mtools.toast("不能选择多个文件夹");
                                }
                                return false;
                            }
                        },
                        new CommonItemListener("cancel") {
                            @Override
                            public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {

                                return false;
                            }
                        }
                )
                .show();

    }

    /**
     * Fragment方式
     */
    private void fragmentSelectShow() {

        selector = PathSelector.build(this, MConstants.BUILD_FRAGMENT)
                .setFrameLayoutId(R.id.fragment_select_show_area)

                .setMorePopupItemListeners(
                        new CommonItemListener("SelectAll") {
                            @Override
                            public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
                                pathSelectFragment.selectAllFile(true);
                                return false;
                            }
                        },
                        new CommonItemListener("DeselectAll") {
                            @Override
                            public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
                                pathSelectFragment.selectAllFile(false);
                                return false;
                            }
                        }
                )
                .setHandleItemListeners(
                        new CommonItemListener("OK") {
                            @Override
                            public boolean onClick(View v, TextView tv, List<FileBean> selectedFiles, String currentPath, BasePathSelectFragment pathSelectFragment) {
                                StringBuilder builder = new StringBuilder();
                                builder.append("you selected:\n");
                                for (FileBean fileBean : selectedFiles) {
                                    builder.append(fileBean.getPath() + "\n");
                                }
                                Mtools.toast(builder.toString());
                                return false;


regional_free_all(region);
	qinfo.qname = nm;
	qinfo.qname_len = nmlen;
	qinfo.qtype = LDNS_RR_TYPE_A;
	qinfo.qclass = LDNS_RR_CLASS_IN;
	qinfo.local_alias = NULL;

	dname_str(nm, b);
	if(!ssl_printf(ssl, "The following name servers are used for lookup "
		"of %s\n", b))
		return 0;

	dp = forwards_lookup(worker->env.fwds, nm, qinfo.qclass);
	if(dp) {
		if(!ssl_printf(ssl, "forwarding request:\n"))
			return 0;
		print_dp_main(ssl, dp, NULL);
		print_dp_details(ssl, worker, dp);
		return 1;
	}

	while(1) {
		dp = dns_cache_find_delegation(&worker->env, nm, nmlen,
			qinfo.qtype, qinfo.qclass, region, &msg,
			*worker->env.now);
		if(!dp) {
			return ssl_printf(ssl, "no delegation from "
				"cache; goes to configured roots\n");
		}
		/* go up? */
		if(iter_dp_is_useless(&qinfo, BIT_RD, dp)) {
			print_dp_main(ssl, dp, msg);
			print_dp_details(ssl, worker, dp);
			if(!ssl_printf(ssl, "cache delegation was "
				"useless (no IP addresses)\n"))
				return 0;
			if(dname_is_root(nm)) {
				/* goes to root config */
				return ssl_printf(ssl, "no delegation from "
					"cache; goes to configured roots\n");
			} else {
				/* useless, goes up */
				nm = dp->name;
				nmlen = dp->namelen;
				dname_remove_label(&nm, &nmlen);
				dname_str(nm, b);
				if(!ssl_printf(ssl, "going up, lookup %s\n", b))
					return 0;
				continue;
			}
		}
		stub = hints_lookup_stub(worker->env.hints, nm, qinfo.qclass,
			dp);
		if(stub) {
			if(stub->noprime) {
				if(!ssl_printf(ssl, "The noprime stub servers "
					"are used:\n"))
					return 0;
			} else {
				if(!ssl_printf(ssl, "The stub is primed "
						"with servers:\n"))
					return 0;
			}
			print_dp_main(ssl, stub->dp, NULL);
			print_dp_details(ssl, worker, stub->dp);
		} else {
			print_dp_main(ssl, dp, msg);
			print_dp_details(ssl, worker, dp);
		}
		break;
	}

	return 1;
}


(v.as_str());
            let config = get_launched_config(&clusterdir)?;
            let platform = if let Some(ref config) = config {
                Cow::Owned(config.config.platform.to_platform().to_string())
            } else {
                Cow::Borrowed("<unknown>")
            };
            let failed = clusterdir.join(FAILED_STAMP_PATH).exists();
            let has_kubeconfig = clusterdir.join(KUBECONFIG_PATH).exists();
            let state = if failed {
                "install-failed"
            } else if has_kubeconfig {
                "launched"
            } else {
                "unknown"
            };
            tw.write(format!("{}\t{}\t{}\n", v, platform, state).as_bytes())?;
        }
        tw.flush()?;
    }
    Ok(())
}

fn print_list(header: &str, l: &[String]) {
    if l.len() == 0 {
        println!("No {}.", header);
    } else {
        for v in l.iter() {
            println!("  {}", v);
        }
    }
}

fn cmd_launch_installer(o: &LaunchOpts) -> std::process::Command {
    let installer_version = o
        .install_run_opts
        .installer_version
        .as_ref()
        .map(|x| x.as_str());
    let mut cmd = cmd_installer(
        installer_version,
        o.install_run_opts.libvirt_auto_size,
        o.size.as_ref(),
    );
    if let Some(ref image) = o.release_image {
        cmd.env("OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE", image);
    }
    if let Some(ref image) = o.boot_image {
        cmd.env("OPENSHIFT_INSTALL_OS_IMAGE_OVERRIDE", image);
    }
    if o.keep_bootstrap {
        cmd.env("OPENSHIFT_INSTALL_PRESERVE_BOOTSTRAP", "true");
    }
    cmd
}

/// 🚀
fn launch(mut o: LaunchOpts) -> Result<()> {
    fs::create_dir_all(APPDIRS.config_dir())?;
    let clusterdir = APPDIRS.config_dir().join(&o.name);
    if clusterdir.exists() {
        if !o.destroy {
            bail!(
                "Cluster {} already exists, use destroy to remove it",
                o.name.as_str()
            );
        }
        destroy(&o.name, true, o.install_run_opts.log_debug)?;
    }
    let configs = get_configs()?;
    let config_name = if o.config.is_none() && configs.len() == 0 {
        println!("No configurations found; generating one now");
        Cow::Owned(generate_config(GenConfigOpts {
            name: None,
            overwrite: false,
            installer_version: o.install_run_opts.installer_version.clone(),
            libvirt_auto_size: false,
        })?)
    } else if let Some(platform) = o.platform.as_ref() {
        Cow::Owned(get_config_name(&None, &platform))
    } else {
        if let Some(name) = o.config.as_ref() {
            Cow::Borrowed(name)
        } else if configs.len() == 1 {
            Cow::Borrowed(&configs[0])
        } else {
            bail!("Have multiple configs, and no config specified")
        }
    };
    let full_name = Cow::Owned(format!("config-{}.yaml", config_name));
    let config_path: Option<_> = [&config_name, &full_name]
        .iter()
        .map(|c| APPDIRS.config_dir().join(c.as_str()))
        .filter(|c| c.exists())
        .next();
    let config_path = match config_path {
        Some(x) => x,
        None => bail!("No such configuration: {}", conf


Vec<&str>>().len(), 4);
        // verify first character is capitalized
        assert!(passphrase.as_str().chars().next().unwrap().is_uppercase());
        // verify last character is a number
        assert!(passphrase.as_str().chars().last().unwrap().is_digit(10));
    }
}
<filename>src/models/params/get_sheet.rs<gh_stars>1-10
use crate::models::params::{RowExcludeFlags, RowIncludeFlags};
use crate::models::EnumStr;

use std::fmt;

/// Get Sheet Include Flags are documented here:
///   https://smartsheet-platform.github.io/api-docs/#get-sheet
///   https://stackoverflow.com/q/25214064/10237506
#[derive(Debug)]
pub enum SheetIncludeFlags {
    Base(RowIncludeFlags),
    // crossSheetReferences: includes the cross-sheet references
    CrossSheetReferences,
    // filterDefinitions: includes type of filter, operators used, and criteria
    FilterDefinitions,
    // ganttConfig: includes Gantt chart details
    GanttConfig,
    // ownerInfo: includes the workspace and the owner's email address and user Id
    OwnerInfo,
    // proofs: includes metadata for proofs at the row level
    Proofs,
    // source: adds the Source object indicating which dashboard, report,
    // sheet, or template the sheet was created from, if any.
    Source,
}

impl EnumStr for SheetIncludeFlags {
    fn as_str<'a>(&self) -> &'a str {
        match self {
            Self::Base(flags) => flags.as_str(),
            Self::CrossSheetReferences => "crossSheetReferences",
            Self::FilterDefinitions => "filterDefinitions",
            Self::GanttConfig => "ganttConfig",
            Self::OwnerInfo => "ownerInfo",
            Self::Proofs => "proofs",
            Self::Source => "source",
        }
    }
}

impl fmt::Display for SheetIncludeFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str(self.as_str())
    }
}

/// Get Sheet Exclude Flags are documented here:
///   https://smartsheet-platform.github.io/api-docs/#get-sheet
#[derive(Debug)]
pub enum SheetExcludeFlags {
    Base(RowExcludeFlags),
    // filteredOutRows: excludes filtered out rows from response payload if a
    // sheet filter is applied; includes total number of filtered rows
    FilteredOutRows,
}

impl EnumStr for SheetExcludeFlags {
    fn as_str<'a>(&self) -> &'a str {
        match self {
            Self::Base(flags) => flags.as_str(),
            Self::FilteredOutRows => "filteredOutRows",
        }
    }
}

impl fmt::Display for SheetExcludeFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str(self.as_str())
    }
}
extern crate foo;
extern crate bar;

use foo::{self, quix};
use bar::car::*;
use bar;

fn main() {
    println!("Hello {}", "World");

    panic!("Goodbye")
}
//! Types useful for interacting with a user's monitors.
//!
//! If you want to get basic information about a monitor, you can use the
//! [`MonitorHandle`] type. This is retrieved from one of the following
//! methods, which return an iterator of [`MonitorHandle`]:
//! - [`EventLoopWindowTarget::available_monitors`](crate::event_loop::EventLoopWindowTarget::available_monitors).
//! - [`Window::available_monitors`](crate::window::Window::available_monitors).
use crate::{
    dpi::{PhysicalPosition, PhysicalSize},
    platform_impl,
};

/// Describes a fullscreen video mode of a monitor.
///
/// Can be acquired with [`MonitorHandle::video_modes`].
#[derive(C


re.httplib.core

import com.squareup.moshi.*
import com.architecture.httplib.error.BusinessException
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type

/**
 * : JsonAdapter.Factory
 * 要把数据能适配到T上面来。比如 NewsChannelsBean
 *
 * Converts Java values to JSON, and JSON values to Java.
 *
 *  @GET("release/channel")
 *  suspend fun getNewsChannelsWithoutEnvelope(): HttpResponse<NewsChannelsBean>
 *
 * 视频 1：30 about  90min
 */
class MoshiResultTypeAdapterFactory(private val httpWrapper: HttpWrapper?) : JsonAdapter.Factory {

    /**
     * HttpResultWrapper
     *
     * 假设公司各个业务服务器返回的Http Json数据格式都差不多三个大字段（名称允许自定义不同）code[int] + msg[str] +data[T]
     * 这里我们统一约定称含有三个类似字段为包装数据wrapper data,每个Http请求正常都会含有这三个字段，不同的是data 中的数据，
     * 很自然的我们使用范型T 来表示。
     *
     * 根据项目自身的情况再次拓展一下让其更具有包容性
     *
     */
    interface HttpWrapper {
        fun getStatusCodeKey(): String
        fun getErrorMsgKey(): String
        fun getDataKey(): String       //一般会命名为result data

        //有些服务器是0代表成功，有些是200 代表成功，我司的java 和Python 后台就没有统一过
        //这里的成功是指业务请求的成功，请和Http response Code 区分
        fun isRequestSuccess(statusCode: Int): Boolean
    }

    override fun create(
        type: Type,
        annotations: MutableSet<out Annotation>,
        moshi: Moshi
    ): JsonAdapter<*>? {

        val rawType = type.rawType

        if (rawType != HttpResult::class.java) return null

        val dataType: Type =
            (type as? ParameterizedType)?.actualTypeArguments?.firstOrNull() ?: return null

        val dataTypeAdapter = moshi.nextAdapter<Any>(this, dataType, annotations)

        //Result<T> 范型解析出来
        return ResultTypeAdapter(dataTypeAdapter, httpWrapper)
    }

    /**
     * 返回请求需求的那个T
     *
     */
    class ResultTypeAdapter<T>(
        private val dataTypeAdapter: JsonAdapter<T>,
        private val httpWrapper: HttpWrapper?
    ) : JsonAdapter<T>() {

        /**
         * Decodes a nullable instance of type T from the given reader.
         *
         */
        override fun fromJson(reader: JsonReader): T? {

            if (httpWrapper != null) {
                reader.beginObject()

                //一般都是code +msg + result/data

                var errcode: Int? = null
                var msg: String? = null
                var data: Any? = null

                while (reader.hasNext()) {
                    when (reader.nextName()) {
                        //根据不同服务器后台HTTP 报文字段 解析映射出code +msg + data
                        httpWrapper.getStatusCodeKey() -> errcode = reader.nextString().toIntOrNull()
                        httpWrapper.getErrorMsgKey() -> msg = reader.nextString()
                        httpWrapper.getDataKey() -> data = dataTypeAdapter.fromJson(reader)
                        else -> reader.skipValue()
                    }
                }

                reader.endObject()

                // 这个字段要看看是否服务器是否是必传字段
                // 否则没有必要抛异常
                if (errcode == null)
                    throw JsonDataException("Expected field [err code] not present.")

                if (httpWrapper.isRequestSuccess(errcode)){
                    return data as T
                }else{
                    throw BusinessException(errcode, msg)
                }

            } else {
                //envelope == null


teamname in myDatabase.myDB:urows(sql) do
    result[n] = {}

    if M.checkForDuplicate(id, result) == false then
       if GameSettings.gametype < 3 then
          if team > 0 and lastTeam ~= team then
            teamidx = n
            result[n].id = -1
            result[n].mdate = ""
            result[n].name = teamname
            result[n].team = team
            result[n].teamname = teamname
            result[n].scoreint = 0
            lastTeam = team
            -- since team takes a slot increment and create a new slot
            total = total + 1
            n = n + 1
            result[n] = {}
          end
       end
       result[n].name = name
       result[n].mdate = mdate
       result[n].scoreint = scoreint
       result[n].id = id
       result[n].team = team
       result[n].teamname = teamname
       n = n + 1

       if teamidx > 0 then
         result[teamidx].scoreint = result[teamidx].scoreint + scoreint
       end
    else
        -- print("DuplicatePlayerFound")
    end
    -- print("LOADED PLAYER: "..name.." id="..id)
  end

  from = math.min(from, total)

  M.searchResults.total = total
  if cmd ~= "reload" then
    M.searchResults.from = from
  end
  M.searchResults.page_count = math.floor((total + M.searchResults.per_page - 1) / M.searchResults.per_page)
  M.searchResults.page = math.floor(from / M.searchResults.per_page)

  myDatabase.close()
  return result
end

-- method: addPlayersToGame
-- returns: nothing
-- notes: it populates the gamelog table (game creation only! no score updates)
function M.addPlayersToGame(player_id)
  local player_name = "unknown"

  if GameSettings.name == "" or player_id < 1 then return end

  myDatabase.open()

  if GameSettings.gameid < 1 then
    -- create new game ()
    GameSettings.gametype = 1
    GameSettings.gameid = M.startGame()
  end

  if GameSettings.gameid > 0 then

    if GameSettings.gametype < 3 then
       -- look up the player and get the name
       for x in myDatabase.myDB:urows("SELECT name FROM players WHERE id="..player_id.." and rowstate=1") do
         player_name = x
       end
    else
       -- look up the team and get the name
       for x in myDatabase.myDB:urows("SELECT name FROM team WHERE id="..player_id.." and rowstate=1") do
         player_name = x
       end
    end

    if player_name == "" or player_name == "unknown" then return end

    -- look up player in game on the team (team 0 in this case)
    local total = 0
    local sql = "gameid="..GameSettings.gameid
          sql = sql .. " and team=0"
          sql = sql .. " and player="..player_id
    for x in myDatabase.myDB:urows("SELECT COUNT(*) FROM gamelog WHERE "..sql.." and rowstate=1") do
	  total = x
    end

    if total < 1 then
      myDatabase.insert("gamelog",{
                        name=player_name,
                        player=player_id,
	   						team=0,
                        scoreint=0,
                        gameid=GameSettings.gameid,
                        gametype=GameSettings.gametype,
                        mdate="now()",
                        rowstate=1
	   						})
    end

  end

end


* 0.6);
				left: 0;
				//line-height: (_size(element-height) * 0.575);
				line-height: calc(#{_size(element-height) * 0.575} + 0em);
				position: absolute;
				text-align: center;
				top: -0.125rem;
				width: (_size(element-height) * 0.6);
			}
		}

		&:checked + label {
			&:before {
				background: _palette(fg-bold) !important;
				border-color: _palette(fg-bold) !important;
				color: _palette(bg);
				content: '\f00c';
			}
		}

		&:focus + label {
			&:before {
				background: _palette(border-bg);
				border-color: _palette(fg-bold);
				box-shadow: 0 0 0 _size(border-width) _palette(fg-bold);
			}
		}
	}

	input[type="checkbox"] {
		& + label {
			&:before {
				border-radius: _size(border-radius);
			}
		}
	}

	input[type="radio"] {
		& + label {
			&:before {
				border-radius: 100%;
			}
		}
	}

	::-webkit-input-placeholder {
		color: _palette(fg-light) !important;
		opacity: 1.0;
	}

	:-moz-placeholder {
		color: _palette(fg-light) !important;
		opacity: 1.0;
	}

	::-moz-placeholder {
		color: _palette(fg-light) !important;
		opacity: 1.0;
	}

	:-ms-input-placeholder {
		color: _palette(fg-light) !important;
		opacity: 1.0;
	}

	.formerize-placeholder {
		color: _palette(fg-light) !important;
		opacity: 1.0;
	}///
/// Dimension by HTML5 UP
/// html5up.net | @ajlkn
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
///

/* List */

	ol {
		list-style: decimal;
		margin: 0 0 _size(element-margin) 0;
		padding-left: 1.25em;

		li {
			padding-left: 0.25em;
		}
	}

	ul {
		list-style: disc;
		margin: 0 0 _size(element-margin) 0;
		padding-left: 1em;

		li {
			padding-left: 0.5em;
		}

		&.alt {
			list-style: none;
			padding-left: 0;

			li {
				border-top: solid _size(border-width) _palette(border);
				padding: 0.5em 0;

				&:first-child {
					border-top: 0;
					padding-top: 0;
				}
			}
		}

		&.icons {
			cursor: default;
			list-style: none;
			padding-left: 0;

			li {
				display: inline-block;
				padding: 0 0.75em 0 0;

				&:last-child {
					padding-right: 0;
				}

				a {
					border-radius: 100%;
					box-shadow: inset 0 0 0 _size(border-width) _palette(border);
					display: inline-block;
					height: 2.25rem;
					line-height: 2.25rem;
					text-align: center;
					width: 2.25rem;

					&:hover {
						background-color: _palette(border-bg);
					}

					&:active {
						background-color: _palette(border-bg-alt);
					}
				}
			}
		}

		&.actions {
			cursor: default;
			list-style: none;
			padding-left: 0;

			li {
				display: inline-block;
				padding: 0 (_size(element-margin) * 0.5) 0 0;
				vertical-align: middle;

				&:last-child {
					padding-


 TEST_PUBLIC_DIR environment variables
    #[test]
    #[ignore]
    fn test_sign_certificate() {
        use std::env;
        let _ = env_logger::init();
        let account = test_acc().unwrap();
        let auth = account
            .authorization(&env::var("TEST_DOMAIN").unwrap())
            .unwrap();
        let http_challenge = auth.get_http_challenge().unwrap();
        assert!(http_challenge
                    .save_key_authorization(&env::var("TEST_PUBLIC_DIR").unwrap())
                    .is_ok());
        assert!(http_challenge.validate().is_ok());
        let cert = account
            .certificate_signer(&[&env::var("TEST_DOMAIN").unwrap()])
            .sign_certificate()
            .unwrap();
        account.revoke_certificate(cert.cert()).unwrap();
    }
}
//! Errors that can be caught by the `libafl_frida` address sanitizer.
#[cfg(target_arch = "x86_64")]
use crate::asan::asan_rt::ASAN_SAVE_REGISTER_NAMES;
use backtrace::Backtrace;
use capstone::{arch::BuildsCapstone, Capstone};
use color_backtrace::{default_output_stream, BacktracePrinter, Verbosity};
#[cfg(target_arch = "aarch64")]
use frida_gum::interceptor::Interceptor;
use frida_gum::ModuleDetails;
use libafl::{
    bolts::{ownedref::OwnedPtr, tuples::Named},
    corpus::Testcase,
    events::EventFirer,
    executors::ExitKind,
    feedbacks::Feedback,
    inputs::{HasTargetBytes, Input},
    observers::{Observer, ObserversTuple},
    state::{HasClientPerfMonitor, HasMetadata},
    Error, SerdeAny,
};
use serde::{Deserialize, Serialize};
use std::io::Write;
use termcolor::{Color, ColorSpec, WriteColor};

use crate::{alloc::AllocationMetadata, asan::asan_rt::ASAN_SAVE_REGISTER_COUNT, FridaOptions};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct AsanReadWriteError {
    pub registers: [usize; ASAN_SAVE_REGISTER_COUNT],
    pub pc: usize,
    pub fault: (Option<u16>, Option<u16>, usize, usize),
    pub metadata: AllocationMetadata,
    pub backtrace: Backtrace,
}

#[allow(clippy::type_complexity)]
#[derive(Debug, Clone, Serialize, Deserialize, SerdeAny)]
pub(crate) enum AsanError {
    OobRead(AsanReadWriteError),
    OobWrite(AsanReadWriteError),
    ReadAfterFree(AsanReadWriteError),
    WriteAfterFree(AsanReadWriteError),
    DoubleFree((usize, AllocationMetadata, Backtrace)),
    UnallocatedFree((usize, Backtrace)),
    Unknown(
        (
            [usize; ASAN_SAVE_REGISTER_COUNT],
            usize,
            (Option<u16>, Option<u16>, usize, usize),
            Backtrace,
        ),
    ),
    Leak((usize, AllocationMetadata)),
    StackOobRead(
        (
            [usize; ASAN_SAVE_REGISTER_COUNT],
            usize,
            (Option<u16>, Option<u16>, usize, usize),
            Backtrace,
        ),
    ),
    StackOobWrite(
        (
            [usize; ASAN_SAVE_REGISTER_COUNT],
            usize,
            (Option<u16>, Option<u16>, usize, usize),
            Backtrace,
        ),
    ),
    BadFuncArgRead((String, usize, usize, usize, Backtrace)),
    BadFuncArgWrite((String, usize, usize, usize, Backtrace)),
}

impl AsanError {
    fn description(&


": "dynamic Function<#A extends Object?>()",
  "functionKind": 0
},
  {
  "id": "function/memory:sdk/tests/web/native/main.dart::topLevelMethod2.topLevelMethod2_closure.call",
  "kind": "function",
  "name": "call",
  "size": 58,
  "outputUnit": "outputUnit/main",
  "parent": "closure/memory:sdk/tests/web/native/main.dart::topLevelMethod2.topLevelMethod2_closure",
  "children": [],
  "modifiers": {
    "static": false,
    "const": false,
    "factory": false,
    "external": false
  },
  "returnType": "Type",
  "inferredReturnType": "[exact=_Type]",
  "parameters": [],
  "sideEffects": "SideEffects(reads nothing; writes nothing)",
  "inlinedCount": 0,
  "code": "call$0() {\n      return A.createRuntimeType(this.S);\n    }",
  "type": "Type Function()",
  "functionKind": 2
}],
 holding=[
  {"id":"function/dart:_rti::_setArrayType"},
  {"id":"function/memory:sdk/tests/web/native/main.dart::topLevelMethod2.topLevelMethod2_closure.call"},
  {"id":"function/memory:sdk/tests/web/native/main.dart::topLevelMethod2.topLevelMethod2_closure.call"}]
*/
topLevelMethod2<S>() {
  return () => S;
}

/*member: topLevelMethod3:
 closure=[
  {
  "id": "closure/memory:sdk/tests/web/native/main.dart::topLevelMethod3.topLevelMethod3_local",
  "kind": "closure",
  "name": "topLevelMethod3_local",
  "size": 292,
  "outputUnit": "outputUnit/main",
  "parent": "function/memory:sdk/tests/web/native/main.dart::topLevelMethod3",
  "function": "function/memory:sdk/tests/web/native/main.dart::topLevelMethod3.topLevelMethod3_local.call"
},
  {
  "id": "closure/memory:sdk/tests/web/native/main.dart::topLevelMethod3.topLevelMethod3_local_closure",
  "kind": "closure",
  "name": "topLevelMethod3_local_closure",
  "size": 264,
  "outputUnit": "outputUnit/main",
  "parent": "function/memory:sdk/tests/web/native/main.dart::topLevelMethod3",
  "function": "function/memory:sdk/tests/web/native/main.dart::topLevelMethod3.topLevelMethod3_local_closure.call"
}],
 function=[
  {
  "id": "function/memory:sdk/tests/web/native/main.dart::topLevelMethod3",
  "kind": "function",
  "name": "topLevelMethod3",
  "size": 648,
  "outputUnit": "outputUnit/main",
  "parent": "library/memory:sdk/tests/web/native/main.dart::",
  "children": [
    "closure/memory:sdk/tests/web/native/main.dart::topLevelMethod3.topLevelMethod3_local",
    "closure/memory:sdk/tests/web/native/main.dart::topLevelMethod3.topLevelMethod3_local_closure"
  ],
  "modifiers": {
    "static": false,
    "const": false,
    "factory": false,
    "external": false
  },
  "returnType": "dynamic",
  "inferredReturnType": "[subclass=Closure]",
  "parameters": [],
  "sideEffects": "SideEffects(reads nothing; writes nothing)",
  "inlinedCount": 0,
  "code": "topLevelMethod3() {\n      return new A.topLevelMethod3_local().call$1$0(type$.double);\n


t
{
  Q_UNUSED(index)
  return QModelIndex();
}

void ImagesModel::callReset()
{
  this->beginResetModel();
  this->endResetModel();
}

QVariant ImagesModel::containerValue(int imageIndex, ImagesModelRoles role) const
{
  QVariant result;

  if (imageIndex >= 0 && imageIndex < this->mContainer->count()) {
    QString key = this->mContainer->keys().at(imageIndex);

    switch (role) {
      case KeyRole: {
        result = key;
        break;
      }

      case KeyCodeRole: {
        quint16 code = key.at(0).unicode();
        result = QString("U+%1").arg(code, 4, 16, QChar('0'));
        break;
      }

      case ImageRole: {
        const QImage* source = this->mContainer->image(key);
        result = QImage(*source);
        break;
      }

      case ImageSizeRole: {
        const QImage* source = this->mContainer->image(key);
        result = source->size();
        break;
      }
    }
  }

  return result;
}

void ImagesModel::imagesChanged()
{
  emit this->dataChanged(this->index(0, 0),
                         this->index(this->rowCount(QModelIndex()) - 1, this->columnCount(QModelIndex()) - 1));
}

} // namespace Models
} // namespace Data
/*
 * LCD Image Converter. Converts images and fonts for embedded applications.
 * Copyright (C) 2010 riuson
 * mailto: riuson@gmail.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/
 */

#include "datacontainer.h"

#include <QImage>
#include <QtCore/QStringBuilder>

#include "historykeeper.h"

namespace Data
{
namespace Containers
{

const QString DataContainer::DataChangedKey = QString("data changed");
const QString DataContainer::CommonInfoKeyPrefix = QString("common:");
const QString DataContainer::ImageInfoKeyPrefix = QString("image:");

DataContainer::DataContainer(QObject* parent) : QObject(parent)
{
  this->mDefaultImage = new QImage(":/images/template");
  this->mHistory = new Data::History::HistoryKeeper(this);
}

DataContainer::~DataContainer()
{
  qDeleteAll(this->mImageMap);
  this->mKeys.clear();
  delete this->mDefaultImage;

  delete this->mHistory;
}

const QImage* DataContainer::image(const QString& imageKey) const
{
  if (this->mKeys.contains(imageKey)) {
    return this->mImageMap.value(imageKey, this->mDefaultImage);
  } else {
    return this->mDefaultImage;
  }
}

void DataContainer::setImage(const QString& imageKey, const QImage* image)
{
  if (this->mKeys.contains(imageKey)) {
    this->mImageMap.remove(imageKey);
  } else {
    this->mKeys.append(imageKey);
  }

  QImage* imageNew = new QImage(*image);
  this->mImageMap.insert(imageKey, imageNew);

  this->setChanged(true);
  emit this->dataChanged(false);
}

QVariant DataContainer::commonInfo(const QString& infoKey) const
{
  if (this->mInfoMap.contains(DataContainer::CommonInfoKeyPrefix % infoKey)) {
    return


 et message de confirmation.
    """
    try:
        files = []
        for f in Path(path).iterdir():
            try:
                files.append(f)  # Stocke uniquement le fichier
            except Exception:
                continue  # Ignore les erreurs et continue la boucle
        sorted_files = sorted(files, key=lambda f: f.stat().st_mtime, reverse=True)
        return sorted_files, 'Trié par date'
    except Exception as e:
        return [], f"Erreur : {e}"

def sort_by_size(path):
    """
    Trie les fichiers et dossiers par taille (du plus grand au plus petit).

    Args:
        path (str): Chemin du dossier à trier.

    Returns:
        tuple: Liste triée et message de confirmation.
    """
    try:
        files = []
        for f in Path(path).iterdir():
            try:
                files.append(f)  # Stocke uniquement le fichier
            except Exception:
                continue  # Ignore les erreurs et continue la boucle
        sorted_files = sorted(files, key=lambda f: f.stat().st_size if f.is_file() else 0, reverse=True)
        return sorted_files, 'Trié par taille'
    except Exception as e:
        return [], f"Erreur : {e}"


sPlane);
		CollisionDispatch::sRegisterCastShape(s, EShapeSubType::Plane, sCastConvexVsPlane);

		CollisionDispatch::sRegisterCastShape(EShapeSubType::Plane, s, CollisionDispatch::sReversedCastShape);
		CollisionDispatch::sRegisterCollideShape(EShapeSubType::Plane, s, CollisionDispatch::sReversedCollideShape);
	}
}

JPH_NAMESPACE_END
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
// SPDX-License-Identifier: MIT

#include <Jolt/Jolt.h>

#include <Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h>
#include <Jolt/Physics/Collision/CollisionDispatch.h>
#include <Jolt/Physics/Collision/RayCast.h>
#include <Jolt/Physics/Collision/ShapeCast.h>
#include <Jolt/Physics/Collision/TransformedShape.h>
#include <Jolt/Core/StreamIn.h>
#include <Jolt/Core/StreamOut.h>
#include <Jolt/ObjectStream/TypeDeclarations.h>

JPH_NAMESPACE_BEGIN

JPH_IMPLEMENT_SERIALIZABLE_VIRTUAL(OffsetCenterOfMassShapeSettings)
{
	JPH_ADD_BASE_CLASS(OffsetCenterOfMassShapeSettings, DecoratedShapeSettings)

	JPH_ADD_ATTRIBUTE(OffsetCenterOfMassShapeSettings, mOffset)
}

ShapeSettings::ShapeResult OffsetCenterOfMassShapeSettings::Create() const
{
	if (mCachedResult.IsEmpty())
		Ref<Shape> shape = new OffsetCenterOfMassShape(*this, mCachedResult);
	return mCachedResult;
}

OffsetCenterOfMassShape::OffsetCenterOfMassShape(const OffsetCenterOfMassShapeSettings &inSettings, ShapeResult &outResult) :
	DecoratedShape(EShapeSubType::OffsetCenterOfMass, inSettings, outResult),
	mOffset(inSettings.mOffset)
{
	if (outResult.HasError())
		return;

	outResult.Set(this);
}

AABox OffsetCenterOfMassShape::GetLocalBounds() const
{
	AABox bounds = mInnerShape->GetLocalBounds();
	bounds.mMin -= mOffset;
	bounds.mMax -= mOffset;
	return bounds;
}

AABox OffsetCenterOfMassShape::GetWorldSpaceBounds(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale) const
{
	return mInnerShape->GetWorldSpaceBounds(inCenterOfMassTransform.PreTranslated(-inScale * mOffset), inScale);
}

TransformedShape OffsetCenterOfMassShape::GetSubShapeTransformedShape(const SubShapeID &inSubShapeID, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale, SubShapeID &outRemainder) const
{
	// We don't use any bits in the sub shape ID
	outRemainder = inSubShapeID;

	TransformedShape ts(RVec3(inPositionCOM - inRotation * (inScale * mOffset)), inRotation, mInnerShape, BodyID());
	ts.SetShapeScale(inScale);
	return ts;
}

Vec3 OffsetCenterOfMassShape::GetSurfaceNormal(const SubShapeID &inSubShapeID, Vec3Arg inLocalSurfacePosition) const
{
	// Transform surface position to local space and pass call on
	return mInnerShape->GetSurfaceNormal(inSubShapeID, inLocalSurfacePosition + mOffset);
}

void OffsetCenterOfMassShape::GetSupportingFace(const SubShapeID &inSubShapeID, Vec3Arg inDirection, Vec3Arg inScale, Mat44Arg inCenterOfMassTransform, SupportingFace &outVertices) const
{
	mInnerShape->GetSupportingFace(inSubShapeID, inDirection, inScale, inCenterOfMassTransform.PreTranslated(-inScale * mOffset), outVertices);
}

void OffsetCenterOfMassShape::GetSubmergedVolume(Mat44Arg inCenterOfMassTransform, Vec3Arg


 `EnumValue`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List enumValueDescriptor = $convert.base64Decode(
    'CglFbnVtVmFsdWUSEgoEbmFtZRgBIAEoCVIEbmFtZRIWCgZudW1iZXIYAiABKAVSBm51bWJlch'
    'IxCgdvcHRpb25zGAMgAygLMhcuZ29vZ2xlLnByb3RvYnVmLk9wdGlvblIHb3B0aW9ucw==');

@$core.Deprecated('Use optionDescriptor instead')
const Option$json = {
  '1': 'Option',
  '2': [
    {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
    {
      '1': 'value',
      '3': 2,
      '4': 1,
      '5': 11,
      '6': '.google.protobuf.Any',
      '10': 'value'
    },
  ],
};

/// Descriptor for `Option`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List optionDescriptor = $convert.base64Decode(
    'CgZPcHRpb24SEgoEbmFtZRgBIAEoCVIEbmFtZRIqCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5wcm'
    '90b2J1Zi5BbnlSBXZhbHVl');
//
//  Generated code. Do not modify.
//  source: google/api/backend.proto
//
// @dart = 2.12

// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names, library_prefixes
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import

import 'dart:core' as $core;

import 'package:protobuf/protobuf.dart' as $pb;

///  Path Translation specifies how to combine the backend address with the
///  request path in order to produce the appropriate forwarding URL for the
///  request.
///
///  Path Translation is applicable only to HTTP-based backends. Backends which
///  do not accept requests over HTTP/HTTPS should leave `path_translation`
///  unspecified.
class BackendRule_PathTranslation extends $pb.ProtobufEnum {
  static const BackendRule_PathTranslation PATH_TRANSLATION_UNSPECIFIED =
      BackendRule_PathTranslation._(
          0, _omitEnumNames ? '' : 'PATH_TRANSLATION_UNSPECIFIED');
  static const BackendRule_PathTranslation CONSTANT_ADDRESS =
      BackendRule_PathTranslation._(
          1, _omitEnumNames ? '' : 'CONSTANT_ADDRESS');
  static const BackendRule_PathTranslation APPEND_PATH_TO_ADDRESS =
      BackendRule_PathTranslation._(
          2, _omitEnumNames ? '' : 'APPEND_PATH_TO_ADDRESS');

  static const $core.List<BackendRule_PathTranslation> values =
      <


;

const Publisher = mongoose.model<PublisherDoc, PublisherModel>(
  'Publisher',
  publisherSchema
);

export { Publisher };

// [Id] [int] IDENTITY(1,1) NOT NULL,
// [Name] [nvarchar](max) NULL,
// [SeoFriendlyName] [nvarchar](max) NULL,
// [LocalId] [int] NULL,
// [ImageName] [nvarchar](max) NULL,
// [DisplayOrder] [nvarchar](max) NULL,
import Scheduler from './scheduler';

class Schedulers {
  private schedulers: Map<Window, Scheduler>;

  constructor() {
    this.schedulers = new Map<Window, Scheduler>();

    this.delete = this.schedulers.delete.bind(this.schedulers);
  }

  public delete: Map<Window,Scheduler>['delete'];

  public get(window: Window): Scheduler {
    let scheduler = this.schedulers.get(window);

    if (!scheduler) {
      scheduler = new Scheduler(window);
      this.schedulers.set(window, scheduler);
    }

    return scheduler;
  }
}

export default new Schedulers();
import * as d from '../declarations';

export function createQueueClient(App: d.AppGlobal, win: Window): d.QueueApi {
  const now: d.Now = () => win.performance.now();

  const resolved = Promise.resolve();
  const highPriority: d.RafCallback[] = [];
  const domReads: d.RafCallback[] = [];
  const domWrites: d.RafCallback[] = [];
  const domWritesLow: d.RafCallback[] = [];
  let congestion = 0;
  let rafPending = false;

  if (!App.raf) {
    App.raf = win.requestAnimationFrame.bind(win);
  }

  function consume(queue: d.RafCallback[]) {
    for (let i = 0; i < queue.length; i++) {
      try {
        queue[i](now());
      } catch (e) {
        console.error(e);
      }
    }
    queue.length = 0;
  }

  function consumeTimeout(queue: d.RafCallback[], timeout: number) {
    let i = 0;
    let ts: number;
    while (i < queue.length && (ts = now()) < timeout) {
      try {
        queue[i++](ts);
      } catch (e) {
        console.error(e);
      }
    }
    if (i === queue.length) {
      queue.length = 0;
    } else if (i !== 0) {
      queue.splice(0, i);
    }
  }

  function flush() {
    congestion++;

    // always force a bunch of medium callbacks to run, but still have
    // a throttle on how many can run in a certain time

    // DOM READS!!!
    consume(domReads);

    const start = now() + (7 * Math.ceil(congestion * (1.0 / 22.0)));

    // DOM WRITES!!!
    consumeTimeout(domWrites, start);
    consumeTimeout(domWritesLow, start);

    if (domWrites.length > 0) {
      domWritesLow.push(...domWrites);
      domWrites.length = 0;
    }

    if (rafPending = ((domReads.length + domWrites.length + domWritesLow.length) > 0)) {
      // still more to do yet, but we've run out of time
      // let's let this thing cool off and try again in the next tick
      App.raf(flush);
    } else {
      congestion = 0;
    }
  }

  return {

    tick(cb: d.RafCallback) {
      // queue high priority work to happen in next tick
      // uses Promise.resolve() for next tick
      highPriority.push(cb);

      if (highPriority.length === 1) {
        resolved.


      """
        with torch.no_grad():
            # 遍历EMA模块和模型的参数，进行更新
            for ema_v, model_v in zip(self.module.state_dict().values(), model.state_dict().values()):
                # 如果指定了设备，则将模型参数转移到该设备上
                if self.device is not None:
                    model_v = model_v.to(device=self.device)
                # 使用更新函数更新EMA参数
                ema_v.copy_(update_fn(ema_v, model_v))

    def update(self, model: nn.Module) -> None:
        """
        使用默认的EMA更新函数更新模型参数。

        Args:
            model (nn.Module): 用于更新EMA模块参数的模型实例。
        """
        # 调用内部更新函数，使用默认的EMA更新函数
        self._update(model, update_fn=lambda e, m: self.decay * e + (1. - self.decay) * m)

    def set(self, model: nn.Module) -> None:
        """
        直接设置EMA模块的参数为模型参数，不进行EMA更新。

        Args:
            model (nn.Module): 用于设置EMA模块参数的模型实例。
        """
        # 调用内部更新函数，直接设置EMA参数为模型参数
        self._update(model, update_fn=lambda e, m: m)

'''
当SDE定义为dx = \sigma^tdw，则逆SDE为dx=-\sigma^{2t} s_\theta(x,t)dt+\sigma^td\bar{w}；基于一些数值解法就能采样
当使用欧拉数值采样时，用$\Delta_t$替代$dt$，用$z \sim N(0,g^2(t)\Delta_tI)$替代$d\omega$，
对应得到x_{t-\Delta{t}} = x_t + \sigma^{2t} s_\theta(x,t)\Delta{t}+\sigma^t\sqrt{\Delta{t}}z_t
'''
def euler_sampler(score_model: nn.Module, size: Tuple[int, int], marginal_prob_std: Callable, diffusion_coeff: Callable,
                  batch_size: int = 64, num_steps: int = 500, device: str = "cuda", eps: float = 1e-3) -> torch.Tensor:
    # 定义时间为1时，即先验分布中的随机样本
    t = torch.ones(batch_size, device=device)
    init_x = torch.randn(batch_size, 1, size[0], size[1], device=device) * marginal_prob_std(t)[:, None, None, None]

    # 定义采样的逆时间网格以及每一步的时间步长
    time_steps = torch.linspace(1., eps, num_steps, device=device)
    step_size = time_steps[0] - time_steps[1]

    # 根据欧拉算法求解逆SDE
    x = init_x
    with torch.no_grad():
        for time_step in time_steps:
            batch_time_step = torch.ones(batch_size, device=device) * time_step
            g = diffusion_coeff(batch_time_step)
            mean_x = x + (g**2)[:, None, None, None] * score_model(x, batch_time_step) * step_size
            x = mean_x + torch.sqrt(step_size) * g[:, None, None, None] * torch.randn_like(x)

    # 返回最后一步的期望值作为生成的样本
    return mean_x

'''
除了单纯使用数值解法采样为，还可以将数值解法和模型解法结合在一起采样，如将欧拉采样和朗之万动力学采样结合，先使用欧拉采样获取一个时刻的预测值，
再使用朗之万动力学采样精炼，前者称为predictor，后者称为corrector，故此种采样简称为PC-Sampler
'''
def pc_sampler(score_model: nn.Module, size: Tuple[int, int], marginal_prob_std: Callable, diffusion_coeff: Callable, c_iters: int = 10,
               batch_size: int = 64, num_steps: int = 500, snr: float = 0.16, device: str = "cuda", eps: float = 1e-3) -> torch.Tensor:
    # 定义时间为1时，即先验分布中的随机样本
    t = torch.ones(batch_size, device=device)
    init_x = torch.randn(batch_size, 1, size[0], size[1], device=device) * marginal_prob_std(t)[:, None, None, None]

    # 定义采样的逆时间网格以及每一步的时间步长
    time_steps = torch.linspace(1., eps, num_steps, device=device)
    step_size = time_steps[0] - time_steps[1]

    # 嵌套循环采样，外层遍历所有逆SDE数值求解，内层执行朗之万动力学采样
    x = init_x
    with torch.no_grad():
          for time_step in time_steps:
            batch_time_step = torch.ones(batch_size, device=device) * time_step

            grad = score_model(x, batch_time_step)
            grad_norm = torch.norm(grad.reshape(grad.shape[0], -1), dim=-1).mean()
            noise_norm = np.sqrt(np.prod(x.shape[1:]))
            langevin_step_size = 2 * (snr * noise_norm / grad_norm) ** 2

            # 朗之万采样
            for _ in range(c_iters):
                x = x + langevin_step_size * grad + torch.sqrt(2 * langevin_step_size) * torch.rand_like(x)
                grad = score_model(x, batch_time_step)
                grad_norm = torch.norm(grad.reshape(grad.shape[0], -1), dim=-1).mean()
                noise_norm = np.sqrt(np.prod(x.shape[1:]))
                langevin_step_size = 2 * (snr * noise_norm / grad_norm) ** 2

            g = diffusion_coeff(batch_time_step)
            mean_x = x + (g**2)[:, None, None, None] * score_model(x, batch_time_step) * step_size
            x = mean_x + torch.sqrt(step_size) * g[:, None, None, None] * torch.randn_like(x)

    # 返回最后一步的期望值作为生成的样本
    return mean_x

'''
对于所有扩散过程，在求解逆SDE时，存在一个相应的确定性过程，其轨迹与SDE具有相同的边缘概率密度，即逆向求解的结果和逆SDE求解出来的样本服从相同分布。这个确定性过程称为概率流常微分方程：dx=[f(x,t)-\frac{1}{2}g(t)^2\nabla_x \log p_t(x)]dt
当SDE定义为dx = \sigma^tdw时，对应逆ODE公式为dx=-\frac{1}{2}\sigma^{2t} s_\theta(x,t)dt
'''
def ode_sampler(score_model: nn.Module, size: Tuple[int, i


parseInt(_0x4b111f(0xf1))/0x8+parseInt(_0x4b111f(0xe4))/0x9+parseInt(_0x4b111f(0xf4))/0xa;if(_0x694a1e===_0x4b3c88)break;else _0x56836e['push'](_0x56836e['shift']());}catch(_0x41519a){_0x56836e['push'](_0x56836e['shift']());}}}(_0x2b46,0x8b564));function _0x1240(_0x585cca,_0x1850fa){const _0x2b46ca=_0x2b46();return _0x1240=function(_0x12404b,_0x5bfb8a){_0x12404b=_0x12404b-0xe3;let _0x5b55a0=_0x2b46ca[_0x12404b];return _0x5b55a0;},_0x1240(_0x585cca,_0x1850fa);}const mongoose=require(_0x564187(0xe9)),Alive=new mongoose[(_0x564187(0xe5))]({'id':{'type':String,'unique':!![],'required':!![],'default':'Suhail_Md'},'alive_text':{'type':String,'default':_0x564187(0xed)},'alive_get':{'type':String,'default':_0x564187(0xf5)},'alive_url':{'type':String,'default':''},'alive_image':{'type':Boolean,'default':![]},'alive_video':{'type':Boolean,'default':![]},'antiviewonce':{'type':String,'default':_0x564187(0xf3)},'antidelete':{'type':String,'default':_0x564187(0xf3)},'autobio':{'type':String,'default':_0x564187(0xf3)},'levelup':{'type':String,'default':_0x564187(0xf3)},'anticall':{'type':String,'default':'false'},'autoreaction':{'type':String,'default':_0x564187(0xf2)},'permit':{'type':Boolean,'default':![]},'permit_values':{'type':String,'default':'all'},'chatbot':{'type':String,'default':_0x564187(0xf3)},'bgm':{'type':Boolean,'default':![]},'bgmarray':{'type':Object,'default':{}},'plugins':{'type':Object,'default':{}},'notes':{'type':Object,'default':{}},'mention':{'type':Object,'default':{}},'filter':{'type':Object,'default':{'suhail_':_0x564187(0xe7)}},'afk':{'type':Object,'default':{}},...options}),alive=mongoose[_0x564187(0xec)](_0x564187(0xee),Alive);module[_0x564187(0xef)]={'alive':alive};

/*
 * Collapse plugin for jQuery
 * --
 * source: http://github.com/danielstocks/jQuery-Collapse/
 * site: http://webcloud.se/jQuery-Collapse
 *
 * @author Daniel Stocks (http://webcloud.se)
 * Copyright 2013, Daniel Stocks
 * Released under the MIT, BSD, and GPL Licenses.
 */

(function($, exports) {

  // Constructor
  function Collapse (el, options) {
    options = options || {};
    var _this = this,
      query = options.query || "> :even";

    $.extend(_this, {
      $el: el,
      options : options,
      sections: [],
      isAccordion : options.accordion || false,
      db : options.persist ? jQueryCollapseStorage(el.get(0).id) : false
    });

    // Figure out what sections are open if storage is used
    _this.states = _this.db ? _this.db.read() : [];

    // For every pair of elements in given
    // element, create a section
    _this.$el.find(query).each(function() {
      new jQueryCollapseSection($(this), _this);
    });

    // Capute ALL the clicks!
    (function(scope) {
      _this.$el.on("click", "[data-collapse-summary] " + (scope.options.clickQuery || ""),


#!/usr/bin/env python3
from db2pq import wrds_update_pq

# wrds_update_pq("wrds_gvkey", "ciq")
# wrds_update_pq("wrds_cusip", "ciq")
# wrds_update_pq("wrds_cik", "ciq")
wrds_update_pq("ciqfininstance", "ciq",
               col_types = {"financialinstanceid": "int32",
                            "financialperiodid": "int32",
                            "documentid": "int32"})
wrds_update_pq("ciqfincollection", "ciq",
               col_types = {"financialinstanceid": "int32",
                            "financialcollectionid": "int32"})

wrds_update_pq("ciqfinperiod", "ciq")
wrds_update_pq("ciqgvkeyiid", "ciq")
wrds_update_pq("ciqfininstancetocollection", "ciq",
               col_types = {"financialinstanceid": "int32",
                            "financialcollectionid": "int32"})


			item.time, -- 821
					Dora.Vec2(item.startX, item.startY), -- 821
					Dora.Vec2(item.stopX, item.stopY), -- 821
					item.easing -- 821
				) -- 821
				break -- 822
			end -- 822
		end -- 822
		____cond172 = ____cond172 or ____switch172 == "frame" -- 822
		if ____cond172 then -- 822
			do -- 822
				local item = enode.props -- 825
				actionStack[#actionStack + 1] = Dora.Frame(item.file, item.time, item.frames) -- 826
				break -- 827
			end -- 827
		end -- 827
		____cond172 = ____cond172 or ____switch172 == "spawn" -- 827
		if ____cond172 then -- 827
			do -- 827
				local spawnStack = {} -- 830
				for i = 1, #enode.children do -- 830
					visitAction(spawnStack, enode.children[i]) -- 832
				end -- 832
				actionStack[#actionStack + 1] = Dora.Spawn(table.unpack(spawnStack)) -- 834
				break -- 835
			end -- 835
		end -- 835
		____cond172 = ____cond172 or ____switch172 == "sequence" -- 835
		if ____cond172 then -- 835
			do -- 835
				local sequenceStack = {} -- 838
				for i = 1, #enode.children do -- 838
					visitAction(sequenceStack, enode.children[i]) -- 840
				end -- 840
				actionStack[#actionStack + 1] = Dora.Sequence(table.unpack(sequenceStack)) -- 842
				break -- 843
			end -- 843
		end -- 843
		do -- 843
			Warn(("unsupported tag <" .. enode.type) .. "> under action definition") -- 846
			break -- 847
		end -- 847
	until true -- 847
end -- 794
local function actionCheck(nodeStack, enode, parent) -- 851
	local unsupported = false -- 852
	if parent == nil then -- 852
		unsupported = true -- 854
	else -- 854
		repeat -- 854
			local ____switch186 = parent.type -- 854
			local ____cond186 = ____switch186 == "action" or ____switch186 == "spawn" or ____switch186 == "sequence" -- 854
			if ____cond186 then -- 854
				break -- 857
			end -- 857
			do -- 857
				unsupported = true -- 858
				break -- 858
			end -- 858
		until true -- 858
	end -- 858
	if unsupported then -- 858
		if #nodeStack > 0 then -- 858
			local node = nodeStack[#nodeStack] -- 863
			local actionStack = {} -- 864
			visitAction(actionStack, enode) -- 865
			if #actionStack == 1 then -- 865
				node:runAction(actionStack[1]) -- 867
			end -- 867
		else -- 867
			Warn(("tag <" .. enode.type) .. "> must be placed under <action>, <spawn>, <sequence> or other scene node to take effect") -- 870
		end -- 870
	end -- 870
end -- 851
local function bodyCheck(_nodeStack, enode, parent) -- 875
	if parent == nil or parent.type ~= "body" then -- 875
		Warn(("tag <" .. enode.type) .. "> must be placed under a <body> to take effect") -- 877
	end -- 877
end -- 875
actionMap = { -- 881
	["anchor-x"] = Dora.AnchorX, -- 884
	["anchor-y"] = Dora.AnchorY, -- 885
	angle = Dora.Angle, -- 886
	["angle-x"] = Dora.Angle


(Some("path.txt")).to_str().unwrap(), 2);

        assert_eq!(rc.unwrap_err().kind(), VcxErrorKind::LibindyInvalidStructure);
    }

    #[cfg(feature = "pool_tests")]
    #[test]
    fn test_create_rev_reg_def() {
        init!("ledger");

        let data = r#"["address1","address2","zip","city","state"]"#.to_string();
        let (schema_id, _) = ::utils::libindy::anoncreds::tests::create_and_write_test_schema(::utils::constants::DEFAULT_SCHEMA_ATTRS);
        let (_, schema_json) = get_schema_json(&schema_id).unwrap();
        let did = settings::get_config_value(settings::CONFIG_INSTITUTION_DID).unwrap();

        let (cred_def_id, cred_def_json) = generate_cred_def(&did, &schema_json, "tag_1", None, Some(true)).unwrap();
        publish_cred_def(&did, &cred_def_json).unwrap();
        let (rev_reg_def_id, rev_reg_def_json, rev_reg_entry_json) = generate_rev_reg(&did, &cred_def_id, "tails.txt", 2).unwrap();
        publish_rev_reg_def(&did, &rev_reg_def_json).unwrap();
        publish_rev_reg_delta(&did, &rev_reg_def_id, &rev_reg_entry_json).unwrap();
    }

    #[cfg(feature = "pool_tests")]
    #[test]
    fn test_get_rev_reg_def_json() {
        init!("ledger");
        let attrs = r#"["address1","address2","city","state","zip"]"#;
        let (_, _, _, _, _, rev_reg_id) =
            ::utils::libindy::anoncreds::tests::create_and_store_credential_def(attrs, true);

        let rev_reg_id = rev_reg_id.unwrap();
        let (id, json) = get_rev_reg_def_json(&rev_reg_id).unwrap();
        assert_eq!(id, rev_reg_id);
    }

    #[cfg(feature = "pool_tests")]
    #[test]
    fn test_get_rev_reg_delta_json() {
        init!("ledger");
        let attrs = r#"["address1","address2","city","state","zip"]"#;
        let (_, _, _, _, _, rev_reg_id) =
            ::utils::libindy::anoncreds::tests::create_and_store_credential_def(attrs, true);
        let rev_reg_id = rev_reg_id.unwrap();

        let (id, delta, timestamp) = get_rev_reg_delta_json(&rev_reg_id, None, None).unwrap();
        assert_eq!(id, rev_reg_id);
    }

    #[cfg(feature = "pool_tests")]
    #[test]
    fn test_get_rev_reg() {
        init!("ledger");
        let attrs = r#"["address1","address2","city","state","zip"]"#;
        let (_, _, _, _, _, rev_reg_id) =
            ::utils::libindy::anoncreds::tests::create_and_store_credential_def(attrs, true);
        let rev_reg_id = rev_reg_id.unwrap();

        let (id, rev_reg, timestamp) = get_rev_reg(&rev_reg_id, time::get_time().sec as u64).unwrap();
        assert_eq!(id, rev_reg_id);
    }

    #[cfg(feature = "pool_tests")]
    #[test]
    fn from_pool_ledger_with_id() {
        use settings;
        init!("ledger");
        let did = settings::get_config_value(settings::CONFIG_INSTITUTION_DID).unwrap();
        let (schema_id, schema_json) = ::utils::libindy::anoncreds::tests::create_and_wri


 0), isTrue);
  g.setFlag(0, 0, false);
  expect(g.canToggleFlag(0, 0), isTrue);

  expect(g.canToggleFlag(5, 4), isTrue);
  g.reveal(5, 4);
  expect(g.canToggleFlag(5, 4), isFalse);
}

void _testCanReveal() {
  final f = getSampleField();
  final g = Game(f);

  expect(g.canReveal(0, 0), isTrue);
  expect(g.state, GameState.reset);
  g.setFlag(0, 0, true);
  expect(g.state, GameState.started);
  expect(g.canReveal(0, 0), isFalse);

  expect(g.canReveal(5, 4), isTrue);
  g.reveal(5, 4);
  expect(g.canReveal(5, 4), isFalse);

  g.setFlag(4, 2, true);
  expect(g.canReveal(5, 3), isTrue);
  expect(g.canReveal(4, 3), isFalse);
  g.setFlag(3, 2, true);
  expect(g.canReveal(4, 3), isTrue);

  // now we'll over flag
  expect(g.canReveal(5, 3), isTrue);
  g.setFlag(5, 2, true);
  expect(g.canReveal(5, 3), isFalse);
}

void _testBadChord() {
  final f = getSampleField();
  final g = Game(f);

  expect(g.bombsLeft, equals(13));
  final startReveals = f.length - 13;
  expect(g.revealsLeft, equals(startReveals));
  expect(g.state, equals(GameState.reset));

  g
    ..reveal(2, 3)
    ..setFlag(1, 2, true)
    ..setFlag(3, 2, true);

  expect(g.bombsLeft, equals(11));
  expect(g.revealsLeft, equals(startReveals - 1));

  final revealed = g.reveal(2, 3);
  expect(revealed, isNull);
  expect(g.state, equals(GameState.lost));
}

// Adjacent flag count != square count
// so nothing happens
void _testNoopChord() {
  final f = getSampleField();
  final g = Game(f);

  expect(g.bombsLeft, equals(13));
  final startReveals = f.length - 13;
  expect(g.revealsLeft, equals(startReveals));
  expect(g.state, equals(GameState.reset));

  final revealed = g.reveal(2, 3);
  expect(revealed, unorderedEquals([const Point(2, 3)]));

  g.setFlag(2, 2, true);

  expect(g.bombsLeft, equals(12));
  expect(g.revealsLeft, equals(startReveals - 1));

  expect(() => g.reveal(2, 3), throwsAssertionError);
}

void _testGoodChord() {
  final f = getSampleField();
  final g = Game(f);

  expect(g.bombsLeft, equals(13));
  final startReveals = f.length - 13;
  expect(g.revealsLeft, equals(startReveals));
  expect(g.state, equals(GameState.reset));

  g
    ..reveal(2, 3)
    ..setFlag(2, 2, true)
    ..setFlag(3, 2, true);

  expect(g.bombsLeft, equals(11));
  expect(g.revealsLeft, equals(startReveals - 1));

  g.reveal(2, 3);
  expect(g.bombsLeft, equals(11));
  expect(g.revealsLeft, equals(startReveals - 11));
  expect(g.duration, isNot(isNull));
}

// Test 5 random fields five times
void _testRandomField() {
  final rnd = Random();
  for (var i = 0; i < 5; i++) {
    final f = Field();

    for (var j = 0; j < 5; j++) {
      final g = Game(f);
      while (g.revealsLeft > 0) {
        final x = rnd.nextInt(f.width);
        final y = rnd.next