repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
Bungarch/meta | include/meta/util/random.h | /**
* @file random.h
* @author <NAME>
*
* All files in META are dual-licensed under the MIT and NCSA licenses. For more
* details, consult the file LICENSE.mit and LICENSE.ncsa in the root of the
* project.
*/
#ifndef META_UTIL_RANDOM_H_
#define META_UTIL_RANDOM_H_
#include <cstdint>
#include <functional>
#inc... |
Bungarch/meta | src/utf/detail.h | /**
* @file detail.h
* @author <NAME>
*
* All files in META are released under the MIT license. For more details,
* consult the file LICENSE in the root of the project.
*/
#ifndef META_UTF_DETAIL_H_
#define META_UTF_DETAIL_H_
#include <array>
#include <stdexcept>
// ICU generates conversion warnings from code ... |
Bungarch/meta | include/meta/topics/topic_model.h | /**
* @file topic_model.h
* @author <NAME>
*
* All files in META are dual-licensed under the MIT and NCSA licenses. For more
* details, consult the file LICENSE.mit and LICENSE.ncsa in the root of the
* project.
*/
#ifndef META_TOPICS_TOPICS_H_
#define META_TOPICS_TOPICS_H_
#include <istream>
#include <vector>... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/mpp/module_init/src/sdk_init.c | /*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/ddr_init/include/types.h | <reponame>openharmony-gitee-mirror/device_hisilicon_hispark_aries
#ifndef __TYPES_H__
#define __TYPES_H__
typedef signed char s8;
typedef unsigned char u8;
typedef signed short s16;
typedef unsigned short u16;
typedef signed int s32;
typedef unsigned int u32;
typedef signed long long s64;
typedef uns... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/board/include/hisoc/timer.h | <reponame>openharmony-gitee-mirror/device_hisilicon_hispark_aries
/*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/ddr_init/include/common.h | #ifndef __COMMON_H_
#define __COMMON_H_
#include "types.h"
/*-----------------------------------------------------------------
* set cpu mode interface
------------------------------------------------------------------*/
void set_mod_normal();
void set_mod_slow();
/*--------------------------------------------------... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/board/include/hisoc/spinor.h | <reponame>openharmony-gitee-mirror/device_hisilicon_hispark_aries<filename>sdk_liteos/board/include/hisoc/spinor.h
/*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licens... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/board/include/hisoc/mmc.h | /*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/board/include/hisoc/spinand.h | <reponame>openharmony-gitee-mirror/device_hisilicon_hispark_aries<gh_stars>1-10
/*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the ... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/board/include/asm/hal_platform_ints.h | /*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/ddr_init/include/platform.h | <reponame>openharmony-gitee-mirror/device_hisilicon_hispark_aries
#ifndef __HI_CHIP_REGS_H__
#define __HI_CHIP_REGS_H__
//#define CONFIG_DDR_TRAINING_V2
#define BIT(nr) (1 << (nr))
#define RAM_START_ADRS 0x04010500
#define STACK_TRAINING 0x04018000
#define DDR_DDRT_REG_BASE 0x11330000
#define TIME... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/board/include/hisoc/nand.h | /*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/board/include/board.h | <gh_stars>1-10
/*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/ddr_init/drv/ddr_training_boot.c | // SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
*
* Description:Special function for ddr training when power up.
*/
#include "ddr_training_impl.h"
#include "ddr_interface.h"
#ifdef DDR_TRAINING_UART_CONFIG
extern void uart_early_put_hex(int hex);
extern ... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/mpp/module_init/src/hi_module_param.h | /*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/ddr_init/boot/hi3518ev300/lowlevel_init_v300.c | <reponame>openharmony-gitee-mirror/device_hisilicon_hispark_aries
// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
#include <ddr_interface.h>
#include <platform.h>
#include <ddr_training_impl.h>
static inline void delay(unsigned int num)
{
volatile unsign... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/ddr_init/include/io.h | <reponame>openharmony-gitee-mirror/device_hisilicon_hispark_aries<gh_stars>1-10
#ifndef __ASM_ARM_IO_H
#define __ASM_ARM_IO_H
#include <types.h>
#include <barriers.h>
#define __arch_getl(a) (*(volatile unsigned int *)(a))
#define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v))
#define mb() dsb... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/ddr_init/drv/ddr_training_ctl.c | // SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
*
* Description:DDR training control
*/
#include "ddr_interface.h"
#include "ddr_training_impl.h"
#ifdef DDR_SW_TRAINING_FUNC_PUBLIC
#ifdef DDR_TRAINING_CUT_CODE_CONFIG
/**
* Cut ddr training control code ... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/board/include/hisoc/dmac.h | /*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/board/include/reset_shell.h | /*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/ddr_init/drv/ddr_ddrc_v500.h | /* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
*
* ddr_ddrc_v500.h
*
* DDRC V500 register define.
*/
/******** DMC **************************/
/* base address: DDR_REG_BASE_DMC0 DDR_REG_BASE_DMC1 */
/* register offset address */
#define DDR_DMC_CTR... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/aeskey2reg.c | // SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#define MaxCols 80
int getline... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/hash_modify.c | // SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char **argv)
... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/uboot/secureboot_release/ddr_init/drv/ddr_ddrt_v2_0_shf2.h | <reponame>openharmony-gitee-mirror/device_hisilicon_hispark_aries<filename>sdk_liteos/uboot/secureboot_release/ddr_init/drv/ddr_ddrt_v2_0_shf2.h<gh_stars>1-10
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
*
* ddr_ddrt_v2_0_shf2.h
*
* DDRT register of... |
openharmony-gitee-mirror/device_hisilicon_hispark_aries | sdk_liteos/mpp/module_init/src/sdk_exit.c | <reponame>openharmony-gitee-mirror/device_hisilicon_hispark_aries
/*
* Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... |
hrnr/qsurf | config.h | // user process that is spawned to handle actions specified in spawnshortcuts
auto userprocess = "/home/henry/.config/qsurf/usr.sh";
// this script is injected to all pages
auto scriptfile = "/home/henry/.config/qsurf/script.js";
// this action will be executed on startup, when no url is provided.
// Action is identif... |
zhouxj6112/ARKit | ARHome/ARHome/Utilities/ReplayKitUtil.h | <reponame>zhouxj6112/ARKit
//
// ReplayKitUtil.h
// ARHome
//
// Created by MrZhou on 2017/11/19.
// Copyright © 2017年 vipme. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface ReplayKitUtil : NSObject
+ (void)startRecoder:(UIViewController *)parentViewController;
+ (voi... |
zhouxj6112/ARKit | ARKit/ARKit/ViewController.h | //
// ViewController.h
// ARKit
//
// Created by MrZhou on 2017/9/24.
// Copyright © 2017年 MrZhou. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <SceneKit/SceneKit.h>
#import <ARKit/ARKit.h>
@interface ViewController : UIViewController
@end
|
zhouxj6112/ARKit | ARHome/ARHome/Resources/PrefixHeader.h | //
// PrefixHeader.pch
// ARHome
//
// Created by MrZhou on 2017/11/17.
// Copyright © 2017年 vipme. All rights reserved.
//
#ifndef PrefixHeader_pch
#define PrefixHeader_pch
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the ... |
zhouxj6112/ARKit | ARHome/ARHome/objc/StaticNavigationViewController.h | <filename>ARHome/ARHome/objc/StaticNavigationViewController.h
//
// StaticNavigationViewController.h
// ARHome
//
// Created by MrZhou on 2018/3/2.
// Copyright © 2018年 vipme. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface StaticNavigationViewController : UINavigationController
@end
|
zhouxj6112/ARKit | ARHome/ARHome/objc/BatchDownloadViewController.h | <gh_stars>1-10
//
// BatchDownloadViewController.h
// ARHome
//
// Created by MrZhou on 2018/2/25.
// Copyright © 2018年 vipme. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BatchDownloadViewController : UIViewController
@end
|
zhouxj6112/ARKit | ARHome/ARHome/objc/SettingViewController.h | //
// SettingViewController.h
// ARHome
//
// Created by MrZhou on 2017/12/22.
// Copyright © 2017年 vipme. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SettingViewController : UIViewController
@end
|
zhouxj6112/ARKit | ARHome/ARHome/VR/VREditViewController.h | //
// VREditViewController.h
// ARHome
//
// Created by MrZhou on 2018/5/6.
// Copyright © 2018年 vipme. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface VREditViewController : UIViewController
@end
|
zhouxj6112/ARKit | ARHome/ARHome/objc/ChooseHistoryViewController.h | <reponame>zhouxj6112/ARKit
//
// ChooseHistoryViewController.h
// ARHome
//
// Created by MrZhou on 2018/5/27.
// Copyright © 2018年 vipme. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ChooseHistoryViewController : UIViewController
@end
|
duxingren14/IslandPerimeter | main.c | int islandPerimeter(int** grid, int gridRowSize, int gridColSize) {
int sum=0;
for(int i=0;i<gridRowSize;i++){
for(int j=0;j<gridColSize;j++){
int value = grid[i][j];
if(value){
if(i) sum += (value - grid[i-1][j]);
if(i+1-gridRowSize)sum += (value ... |
vyatu/AmbientColorScheme | src/lmu.c | <gh_stars>1-10
#include <stdio.h>
#include <string.h>
#import <IOKit/IOKitLib.h>
#define kGetSensorReadingID 0
#define calibrationConstant 25064
static uint64_t max (uint64_t x, uint64_t y) {
return x ^ ((x ^ y) & -(x < y));
};
uint64_t readSensor () {
io_connect_t dataPort;
kern_return_t kr = KERN_FAI... |
sandeepdas05/lsm-crack-width | lsml/util/_cutil/masked_gradient.c | <gh_stars>10-100
/*
* Masked gradient
* ---------------
* Routines for computing gradients over masked regions.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include "helpers.c"
void gradient_centered3d(int m, int n, int p, double * A, bool * mask,
doub... |
sandeepdas05/lsm-crack-width | lsml/initializer/provided/util/_radii_from_mask.c | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include "../../util/helpers.h"
#include "./trilinear.c"
/* Compute the radial distance from provided 3d `seed`
* in direction given by theta and phi angles until a
* value of `false` is encountered in `mask`.
*/
void radii_from_mask(in... |
sandeepdas05/lsm-crack-width | lsml/initializer/provided/util/trilinear.c | <reponame>sandeepdas05/lsm-crack-width<gh_stars>10-100
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include "../../util/helpers.h"
/* A big ugly function for performing trilinear interpolation on
* a 3d scalar field.
*/
double interpolate_point(double i, double j, double k, double ... |
sandeepdas05/lsm-crack-width | lsml/util/_cutil/helpers.c | /*
* Helper utilities for C libraries
* --------------------------------
* Mostly, index mappers into flattened multi-dimensional arrays
*/
#ifndef C_HELPERS
#define C_HELPERS
#include <stdlib.h>
#define PI 3.14159265358979311599796346854419
#define TWOPI 6.28318530717958623199592693708837
// Map the index (... |
sandeepdas05/lsm-crack-width | lsml/util/_cutil/com_ray_sample.c | <filename>lsml/util/_cutil/com_ray_sample.c
/*
* COM (center of mass) ray samples
* --------------------------------
* This function samples image values along the "COM ray" from each point.
* I.e., connecting any given location to the center of mass provided
* yields a ray, along which we can sample the underlyin... |
sazus/QtTranslatorSample | 02_DynamicTranslationNG/src/uicontrol.h | <reponame>sazus/QtTranslatorSample<gh_stars>0
#ifndef UICONTROL_H
#define UICONTROL_H
#include <QObject>
class UiControlPrivate;
class UiControl : public QObject
{
Q_OBJECT
public:
explicit UiControl(QObject *parent = 0);
~UiControl();
void show();
private:
Q_DECLARE_PRIVATE(UiControl)
UiCo... |
sazus/QtTranslatorSample | 03_DynamicTranslation/src/uicontrol.h | <filename>03_DynamicTranslation/src/uicontrol.h
#ifndef UICONTROL_H
#define UICONTROL_H
#include <QObject>
class UiControlPrivate;
class UiControl : public QObject
{
Q_OBJECT
Q_PROPERTY(QString qtr READ qtr NOTIFY languageChanged)
public:
explicit UiControl(QObject *parent = 0);
~UiControl();
vo... |
matutem/opentitan | sw/device/lib/dif/dif_base.c | <filename>sw/device/lib/dif/dif_base.c
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "sw/device/lib/dif/dif_base.h"
#include <stdbool.h>
#include "sw/device/lib/base/multibits.h"
// `extern` declarations... |
matutem/opentitan | sw/device/silicon_creator/lib/sigverify_mod_exp_otbn_functest.c | // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "sw/device/lib/base/memory.h"
#include "sw/device/silicon_creator/lib/base/sec_mmio.h"
#include "sw/device/silicon_creator/lib/sigverify_mod_exp.h"
#include "sw... |
thierryseegers/expression_tree | include/expression_tree.h | /*
(C) Copyright <NAME> 2010-2014. Distributed under the following license:
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Sof... |
NEUbugmakers/HeadFile | stack/head.h | <reponame>NEUbugmakers/HeadFile
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <string>
using namespace std;
struct LNode{
int data;
struct LNode * next;
};
struct SNode{
int data;
struct SNode *next;
};
struct LStack{
struct SNode * bas... |
NEUbugmakers/HeadFile | stack/stack_line.h | <filename>stack/stack_line.h
//
// Created by 46172 on 2020/12/18.
//
#ifndef HEADFILE_STACK_LINE_H
#define HEADFILE_STACK_LINE_H
#include <stdlib.h>
#include <string.h>
#define STACK_DEFAULT_CAPACITY 4
typedef struct {
int *num;
int size;
int capacity;
} Stack;
Stack *creatStack();//栈创建
void expand(Sta... |
hbenl/protocol | inspector_protocol/crdtp/find_by_first.h | <reponame>hbenl/protocol
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CRDTP_FIND_BY_FIRST_H_
#define CRDTP_FIND_BY_FIRST_H_
#include <algorithm>
#include <cstdint>
#include <memory>
#include... |
hbenl/protocol | inspector_protocol/crdtp/span.h | <gh_stars>100-1000
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CRDTP_SPAN_H_
#define CRDTP_SPAN_H_
#include <cstdint>
#include <cstring>
#include <string>
#include "export.h"
namespace cr... |
hbenl/protocol | inspector_protocol/crdtp/frontend_channel.h | <reponame>hbenl/protocol
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CRDTP_FRONTEND_CHANNEL_H_
#define CRDTP_FRONTEND_CHANNEL_H_
#include <cstdint>
#include <memory>
#include "export.h"
#in... |
Giperion/The-Forge | Common_3/Renderer/IRenderer.h | /*
* Copyright (c) 2018-2020 The Forge Interactive Inc.
*
* This file is part of The-Forge
* (see https://github.com/ConfettiFX/The-Forge).
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional in... |
Giperion/The-Forge | Common_3/Renderer/IResourceLoader.h | <reponame>Giperion/The-Forge
/*
* Copyright (c) 2018-2020 The Forge Interactive Inc.
*
* This file is part of The-Forge
* (see https://github.com/ConfettiFX/The-Forge).
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed wit... |
Kiandr/dataStructure | interviews/LifeLabs/IsPowerOfTow.c | <filename>interviews/LifeLabs/IsPowerOfTow.c<gh_stars>0
#include<stdio.h>
#include<stdbool.h>
/* Function to check if x is power of 2*/
bool isPowerOfTwo(int n)
{
if (n == 0)
return 0;
while (n != 1)
{
if (n%2 != 0)
return 0;
n = n/2;
}
return 1;
}
/*Driver program to test above f... |
Kiandr/dataStructure | crackingCodingInterview/C++/Tree/LowestCommonAncestor/interation.c | Node *lca(Node *root, int a,int b) {
if (root == NULL) return NULL;
Node *prtR = root;
while (prtR!=NULL)
{
if (prtR->data >a && prtR->data>b && prtR->left !=NULL)
prtR = prtR->left;
else if (prtR->data <a && prtR->data<b && prtR->right !=NULL)
... |
Kiandr/dataStructure | crackingCodingInterview/C++/Mathematics/Fibonacci/Recursive.c | <gh_stars>0
#include<stdio.h>
#include <stdbool.h>
int Fib(int val){
// if (val==0) return 0;
// if (val==1) return 1;
if (val<=1) return val;
return Fib(val-1)+Fib(val-2);
}
int main(){
int FibArray[20]= {0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765};
for (int i=0;i<20;i++){
printf... |
Kiandr/dataStructure | hackerRank/30DaysOfCodeChallenges/Day6LetsReview/main.c | #include "stdio.h"
#include "string.h"
void foo(char *head, int len)
{
// debugging
// printf("[%d\n",&, len);
char *prtH = head;
int lenEv =0;
int lenOd =0;
{
while (prtH<=(head+len) && *prtH != '\n')
{
if (*prtH%2 == 0)
lenEv++;
else
lenOd++;
prtH++;
}
// printf("sizeof odd = %d\n", l... |
Kiandr/dataStructure | hackerRank/30DaysOfCodeChallenges/Round/main.c | <gh_stars>0
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
void calculateTotal (float *head, int len){
float total = 0;
total = head[0] +(head[0]*head[1]/100)+(head[0]*head[2]/100);
int totalRounded = round(total);
printf ("The total meal cost is %d dollars.",totalRounded);
... |
Kiandr/dataStructure | crackingCodingInterview/C++/Tree/LowestCommonAncestor/recursive.c | Node *lca(Node *root, int a,int b) {
// Write your code here.
Node *prt = root;
//if (root == NULL) return root;
if ( prt->data>a && prt->data > b && prt->left != NULL)
prt = lca(prt->left,a,b);
if ( prt->data<a && prt->data < b && prt->right != NULL)
prt =lca(prt->right,a,b);
ret... |
Kiandr/dataStructure | hackerRank/30DaysOfCodeChallenges/Day8DictionariesandMaps/main.c | #include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include <stdio.h>
#include <string.h>
typedef struct node {
char *key;
int data[8];
}node;
void addNewNode(char* inputString){
char *prtH = inputString;
char *key;
int val [8];
int i=0;
printf("%s--\n",(prtH));
while (*prtH !=' '&& *prtH !='\n... |
Kiandr/dataStructure | crackingCodingInterview/C++/Mathematics/Fibonacci/DynamicProgramming .c | #include <stdio.h>
int Fib(int val){
// Adding space for 0
int Fib[val+1];
int i=0;
// Dynamic Programming setting 0 and 1 case manually.
Fib[0] = 0;
Fib[1] = 1;
for ( i=2;i<=val;i++)
Fib[i]= Fib[i-1]+Fib[i-2];
return Fib[val];
}
int main(){
int FibArray[20]= {0,1,1,2,3,5,8,13,21,34,55,89,144,233,377... |
Kiandr/dataStructure | hackerRank/30DaysOfCodeChallenges/Factorial/main.c | <filename>hackerRank/30DaysOfCodeChallenges/Factorial/main.c
#include "stdio.h"
unsigned int factorial(long int n){
if (n >= 1)
return n* factorial(n-1);
else
return 1;
}
int factorialFor(int n){
unsigned long long factorial = 1;
for(int i=1; i<=n; ++i)
{
factorial... |
Kiandr/dataStructure | hackerRank/30DaysOfCodeChallenges/Day9Recursion/main.c | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int Factorial(int n) {
// Complete this function
// base class
if (n<=1)
return 1;
else {
// recusrive method
return n*Factorial(n-1);
}
}
int main() {
int... |
Kiandr/dataStructure | crackingCodingInterview/C++/Mathematics/IsPowerOfTwo/main.c | #include<stdio.h>
int IsPowerOfTwo(int val){
if (val ==0) return 0;
while (val!=1){
if (val%2!=0)
return 0;
val=val/2;
}
return 1;
}
int main (){
printf("[%d]\n",IsPowerOfTwo(8));
printf("[%d]\n",IsPowerOfTwo(0));
printf("[%d]\n",IsPowerOfTwo(7));
return 0;
} |
Kiandr/dataStructure | hackerRank/30DaysOfCodeChallenges/Day1DataTypes/main.c | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
int i = 4;
double d = 4.0;
char s[] = "HackerRank";
// Declare second integer, double, and String variables.
int ii =0;
float f =0;
char ss[50];
// Read and save an integer, double, and String t... |
Kiandr/dataStructure | crackingCodingInterview/C++/Mathematics/ThePowerSum/main.c | <filename>crackingCodingInterview/C++/Mathematics/ThePowerSum/main.c
#include<stdio.h>
/*https://www.geeksforgeeks.org/write-a-c-program-to-calculate-powxn/*/
/* Function to calculate x raised to the power y */
int power(int x, unsigned int y)
{
if (y == 0)
return 1;
else if (y%2 == 0)
return p... |
Kiandr/dataStructure | hackerRank/30DaysOfCodeChallenges/OddNumber/main.c | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
void isOdd (int n ){
if (n%2 == 0)
printf("Not Weird\n");
else
printf("Weird\n");
}
int main(){
// int N;
// scanf("%d",&... |
Kiandr/dataStructure | crackingCodingInterview/C++/Mathematics/IsPrimeNumber/main.c | <gh_stars>0
// A school method based C++ program to
// check if a number is prime
#include <stdio.h>
using namespace std;
// function check whether a number
// is prime or not
bool isPrime(int n)
{
// Corner case
if (n <= 1)
return false;
// Check from 2 to n-1
for (int i = 2... |
Kiandr/dataStructure | crackingCodingInterview/C++/Mathematics/Factorial/FactorialIterative.c | <reponame>Kiandr/dataStructure<filename>crackingCodingInterview/C++/Mathematics/Factorial/FactorialIterative.c
#include <stdio.h>
int Factorial( int val ){
if (val == 0) return 1;
int temp =1;
for (int i=2;i<=val;i++)
temp=temp*i;
return temp;
}
int main ()
{
int FactorialArray[10] =
... |
Kiandr/dataStructure | hackerRank/30DaysOfCodeChallenges/Day20Sorting/main.c | <reponame>Kiandr/dataStructure
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main() {
int n;
scanf("%d", &n);
int *a = malloc(sizeof(int) * n);
int *prtS = a;
for(int i = 0; i < n; i++){
scanf("%d",prt... |
y1024/SensorsAnalyticsSDK | SensorsAnalyticsSDK/SensorsAnalyticsSDK/UIWindow+SASnapshotImage/UIWindow+SASnapshotImage.h | <filename>SensorsAnalyticsSDK/SensorsAnalyticsSDK/UIWindow+SASnapshotImage/UIWindow+SASnapshotImage.h<gh_stars>1-10
//
// UIWindow+SnapshotImage.h
// SensorsAnalyticsSDK
//
// Created by 杜晓星 on 2017/11/29.
// Copyright © 2017年 SensorsData. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIWindow (SASna... |
aloknnikhil/folly | folly/experimental/QuotientMultiSet.h | <reponame>aloknnikhil/folly<gh_stars>1-10
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/L... |
aloknnikhil/folly | folly/python/iobuf.h | <gh_stars>1-10
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
aloknnikhil/folly | folly/experimental/observer/Observer-inl.h | <filename>folly/experimental/observer/Observer-inl.h
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org... |
aloknnikhil/folly | folly/container/detail/F14Policy.h | <filename>folly/container/detail/F14Policy.h
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/license... |
aloknnikhil/folly | folly/logging/LogName.h | <reponame>aloknnikhil/folly
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
... |
aloknnikhil/folly | folly/logging/LogHandlerConfig.h | <gh_stars>1-10
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... |
aloknnikhil/folly | folly/futures/SharedPromise.h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... |
aloknnikhil/folly | folly/logging/CustomLogFormatter.h | <filename>folly/logging/CustomLogFormatter.h
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/license... |
aloknnikhil/folly | folly/test/SynchronizedTestLib-inl.h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... |
aloknnikhil/folly | folly/experimental/symbolizer/ElfCache.h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... |
aloknnikhil/folly | folly/container/test/F14TestUtil.h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... |
AndyM129/AMKPromptView | Example/AMKPromptView/AMKPlaceholderView+Factory.h | //
// AMKPlaceholderView+Factory.h
// AMKPromptView_Example
//
// Created by 孟昕欣 on 2019/7/3.
// Copyright © 2019 https://github.com/AndyM129. All rights reserved.
//
#import <AMKPromptView/AMKPlaceholderView.h>
#import <YYCategories/YYCategories.h>
#import <Masonry/Masonry.h>
/// 占位视图:工厂类
@interface AMKPlacehold... |
AndyM129/AMKPromptView | AMKPromptView/Classes/AMKPlaceholderView/AMKPlaceholderView.h | <gh_stars>0
//
// AMKPlaceholderView.h
// Pods
//
// Created by Andy on 2017/11/4.
//
#import <UIKit/UIKit.h>
/// 占位视图
@interface AMKPlaceholderView : UIView
@property(nonatomic, strong, nullable) UIView *contentView; //!< 内容视图(可指定该视图height或width, 取0则为自动布局)
@property(nonatomic, ... |
AndyM129/AMKPromptView | Example/AMKPromptView/AMKDemoViewController.h | <filename>Example/AMKPromptView/AMKDemoViewController.h
//
// AMKDemoViewController.h
// AMKPromptView_Example
//
// Created by 孟昕欣 on 2019/7/4.
// Copyright © 2019 https://github.com/AndyM129. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AMKPromptView+Factory.h"
#import <AMKPromptView/UIViewController... |
AndyM129/AMKPromptView | Example/AMKPromptView/AMKAppDelegate.h | <reponame>AndyM129/AMKPromptView
//
// AMKAppDelegate.h
// AMKPromptView
//
// Created by AndyM129 on 07/03/2019.
// Copyright (c) 2019 https://github.com/AndyM129 . All rights reserved.
//
@import UIKit;
@interface AMKAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *wind... |
AndyM129/AMKPromptView | AMKPromptView/Classes/UIViewControllerExtensionMethods/UIViewController+AMKPromptView.h | //
// UIViewController+AMKPromptView.h
// AMKPromptView
//
// Created by 孟昕欣 on 2019/7/4.
//
#import <UIKit/UIKit.h>
#import "AMKPromptView.h"
/// 可通过预定义 AMKPV_SHORTHAND_GLOBALS 宏,来实现省略前缀来调用
#ifdef AMKPV_SHORTHAND_GLOBALS
#define amk_promptView promptView
#define setAmk_promptView setPromptView
#define amk_placeho... |
AndyM129/AMKPromptView | AMKPromptView/Classes/AMKPromptView/AMKPromptView.h | <reponame>AndyM129/AMKPromptView
//
// AMKPromptView.h
// Pods
//
// Created by Andy on 2017/11/4.
//
#import <UIKit/UIKit.h>
#import "AMKPlaceholderView.h"
@class AMKPromptView;
/// 提示状态
typedef NS_ENUM(NSInteger, AMKPromptStatus) {
AMKPromptStatusHidden = 0, //!< 无提示视图
AMKPromptStatusRestricted, //!< 未... |
AndyM129/AMKPromptView | Example/AMKPromptView/AMKPromptView+Factory.h | //
// AMKPromptView+Factory.h
// AMKPromptView_Example
//
// Created by 孟昕欣 on 2019/7/3.
// Copyright © 2019 https://github.com/AndyM129. All rights reserved.
//
#import <AMKPromptView/AMKPromptView.h>
#import "AMKPlaceholderView+Factory.h"
typedef NS_ENUM(NSInteger, AMKPromptType) {
AMKPromptTypeEmptyViewFor... |
AndyM129/AMKPromptView | Example/AMKPromptView/AMKCustomViewController.h | <gh_stars>0
//
// AMKCustomViewController.h
// AMKPromptView_Example
//
// Created by 孟昕欣 on 2019/7/4.
// Copyright © 2019 https://github.com/AndyM129. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AMKPromptView+Factory.h"
/// 自定义页面,查看不同样式的提示视图
@interface AMKCustomViewController : UIViewController
- (... |
AndyM129/AMKPromptView | Example/AMKPromptView/AMKViewController.h | <gh_stars>0
//
// AMKViewController.h
// AMKPromptView
//
// Created by AndyM129 on 07/03/2019.
// Copyright (c) 2019 https://github.com/AndyM129 . All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AMKViewController : UIViewController
@end
|
danesh-d/do-sort | src/cocktail_sort.h | #ifndef COCKTAIL_SORT_H
#define COCKTAIL_SORT_H
#include "do_sort.h"
using namespace std;
namespace do_sort {
// --- Cocktail sort.
template <class T>
class cocktail_sort : public sort<T> {
protected:
void specific_do_sort() {
LL n = sort<T>::size();
if (n <= 1) {
return;
... |
danesh-d/do-sort | src/heap_sort.h | <reponame>danesh-d/do-sort<filename>src/heap_sort.h
#ifndef HEAP_SORT_H
#define HEAP_SORT_H
#include "do_sort.h"
using namespace std;
namespace do_sort {
// --- Heap sort.
template <class T>
class heap_sort : public sort<T> {
protected:
void specific_do_sort() {
LL n = sort<T>::size();
... |
danesh-d/do-sort | src/insertion_sort.h | #ifndef INSERTION_SORT_H
#define INSERTION_SORT_H
#include "do_sort.h"
using namespace std;
namespace do_sort {
// --- Insertion sort.
template <class T>
class insertion_sort : public sort<T> {
protected:
void specific_do_sort() {
LL n = sort<T>::size();
if (n <= 1) {
retur... |
danesh-d/do-sort | src/tree_sort.h | #ifndef TREE_SORT_H
#define TREE_SORT_H
#include "do_sort.h"
#include "BST.h"
using namespace std;
namespace do_sort {
// --- Tree sort.
template <class T>
class tree_sort : public sort<T>, private BST<T> {
private:
void create_tree(vector<T>& v, LL n) {
// Construct the BST from the input da... |
danesh-d/do-sort | src/quick_sort.h | #ifndef QUICK_SORT_H
#define QUICK_SORT_H
#include "do_sort.h"
using namespace std;
namespace do_sort {
// --- Quick sort implementation.
template <class T>
class quick_sort : public sort<T> {
private:
LL partition(vector<T>& v, LL left, LL right, bool asc) {
T piv = v[right]; // Initial g... |
danesh-d/do-sort | src/do_sort.h | <gh_stars>0
#ifndef DO_SORT_H
#define DO_SORT_H
#include <vector>
#include <list>
#include <ctime>
#include <string.h>
#include <stdlib.h>
typedef long L;
typedef long long LL;
typedef unsigned long UL;
typedef unsigned long long ULL;
typedef long double LD;
using namespace std;
namespace do_sort {
// Abstract c... |
danesh-d/do-sort | src/selection_sort.h | #ifndef SELECTION_SORT_H
#define SELECTION_SORT_H
#include "do_sort.h"
using namespace std;
namespace do_sort {
// --- Selection sort.
template <class T>
class selection_sort : public sort<T> {
protected:
void specific_do_sort() {
LL n = sort<T>::size();
if (n <= 1) {
retur... |
danesh-d/do-sort | src/shell_sort.h | <filename>src/shell_sort.h
#ifndef SHELL_SORT_H
#define SHELL_SORT_H
#include "do_sort.h"
#define MAX_GAPS 9
using namespace std;
namespace do_sort {
// --- Shell sort implementation.
template <class T>
class shell_sort : public sort<T> {
private:
vector<LL> gaps;
// This function generates t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.