Skip to content

Instantly share code, notes, and snippets.

View Shubhra22's full-sized avatar
🎯
Focusing

Shubhra Sarker Shubhra22

🎯
Focusing
View GitHub Profile
@Shubhra22
Shubhra22 / ScreenshotNow.cs
Last active April 25, 2024 12:45
Screen Capture of particular UI elements
using UnityEngine;
using System.Collections;
using System.IO;
using UnityEngine.UI;
public class ScreenshotNow : MonoBehaviour
{
public RectTransform rectT; // Assign the UI element which you wanna capture
public Image img;
int width; // width of the object to capture
int height; // height of the object to capture
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//using UnityStandardAssets._2D;
namespace UnityStandardAssets._2D
{
public class FollowPlayer : MonoBehaviour
{
public GameObject Player;
float speed;
/*==============================================================================
Copyright (c) 2017 PTC Inc. All Rights Reserved.
Copyright (c) 2010-2014 Qualcomm Connected Experiences, Inc.
All Rights Reserved.
Confidential and Proprietary - Protected under copyright and other laws.
==============================================================================*/
using UnityEngine;
using Vuforia;
@Shubhra22
Shubhra22 / freeze.py
Created March 7, 2019 03:46
Freeze Existing ML Model to Unity 3d Python Code
# IMPORTS
import tensorflow as tf
# freeze_graph "screenshots" the graph
from tensorflow.python.tools import freeze_graph
# optimize_for_inference lib optimizes this frozen graph
from tensorflow.python.tools import optimize_for_inference_lib
# os and os.path are used to create the output file where we save our frozen graphs
import os
using UnityEngine;
public class Enemy : MonoBehaviour
{
public float health; // keep the health of the enemey
[HideInInspector]
public Vector2 direction; // direction where the enemy is now facing.
public GameObject bullet; // Bullet object what the enemy is gonna shoot.
@Shubhra22
Shubhra22 / Problem 1
Last active January 19, 2020 00:33
DP UGUI_101
Problem Statement: On a positive integer, you can perform any one of the following 3 steps.
1.) Subtract 1 from it. ( n = n - 1 ) ,
2.) If its divisible by 2, divide by 2. ( if n % 2 == 0 , then n = n / 2 ) ,
3.) If its divisible by 3, divide by 3. ( if n % 3 == 0 , then n = n / 3 ).
Now the question is, given a positive integer n, find the minimum number of steps that takes n to 1
eg:
1.)For n = 1 , output: 0
2.) For n = 4 , output: 2 ( 4 /2 = 2 /2 = 1 )
3.) For n = 7 , output: 3 ( 7 -1 = 6 /3 = 2 /2 = 1 )
@Shubhra22
Shubhra22 / ArrayMid.md
Last active October 24, 2020 18:27
Arrays

Problem 1

How do you find the missing number in a given integer array of 1 to 10?

Problem 2

How do you find the duplicate number on a given integer array?

Problem 3

@Shubhra22
Shubhra22 / 1
Last active December 12, 2022 21:16
Write a method
public static int max(int[][] a)
that returns the maximum value in the 2d parameter array a.
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=944
https://www.spoj.com/problems/MIXTURES/
https://leetcode.com/problems/burst-balloons/
Write a C program to find maximum between two numbers.
Write a C program to find maximum between three numbers.
Write a C program to check whether a number is negative, positive or zero.
Write a C program to check whether a number is divisible by 5 and 11 or not.
Write a C program to input week number and print week day.