Skip to content

Instantly share code, notes, and snippets.

View DhruvaG2000's full-sized avatar
:atom:
Open Source all the way!

Dhruva Gole DhruvaG2000

:atom:
Open Source all the way!
View GitHub Profile
The following Python requirements are not satisfied:
click>=5.0
pyserial>=3.0
future>=0.15.2
cryptography>=2.1.4
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
gdbgui>=0.13.2.0
pygdbmi<=0.9.0.2
reedsolo==1.5.3
/*
PROBLEM 2:
Each new term in the Fibonacci sequence is generated by adding
the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By considering the terms in the Fibonacci sequence whose values do not
exceed four million, find the sum of the even-valued terms.
*/
@DhruvaG2000
DhruvaG2000 / 3.cpp
Created July 30, 2020 13:07
why wont it run???
/*
PROBLEM 3
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
*/
#include<iostream>
#include<stdint.h>
#include <iostream>
long long max_prime_factor(long long num);
int main(void) {
std::cout << max_prime_factor(600851475143LL) << std::endl;
return 0;
}
long long max_prime_factor(long long num) {
@DhruvaG2000
DhruvaG2000 / error.terminal
Created August 8, 2020 09:58
``vmon setup`` command error
Adding proflie for 600 x 960
X Error of failed request: BadName (named color or font does not exist)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 16 (RRCreateMode)
Serial number of failed request: 28
Current serial number in output stream: 28
xrandr: cannot find output "VIRTUAL1"
Adding proflie for 720 x 1080
X Error of failed request: BadName (named color or font does not exist)
Major opcode of failed request: 140 (RANDR)
@DhruvaG2000
DhruvaG2000 / darknetpythonerror
Last active August 15, 2020 07:04
This error keeps coming but I a not able to find a solution to this online neither do I know the source of this error. maybe I am importing it wrong?
(torch) > $ python classifier.py [±master ●●]
Traceback (most recent call last):
File "classifier.py", line 3, in <module>
from Final import *
File "/home/dhruva/airpix/darknet/Final.py", line 8, in <module>
import darknet
File "/home/dhruva/airpix/darknet/darknet.py", line 127, in <module>
lib = CDLL("./libdark.so", RTLD_GLOBAL)
File "/home/dhruva/miniconda2/envs/torch/lib/python3.8/ctypes/__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
@DhruvaG2000
DhruvaG2000 / leeetcode.cpp
Created September 1, 2020 17:45
cpp code
#include<iostream>
// using namespace std;
int main(){
// declarations
int nums[]={2,7,11,15}, target = 9;
/*
return the indices of the two numbers such that they add up to target
*/
int* twoSum(int* nums, int numsSize, int target, int* returnSize){
int first_num=nums[0], second_num=nums[1], index_of_first_num=0, index_of_second_num=1;
for (int i = 0; i < sizeof(nums); i++)
{
first_num=nums[i];
for (int j = 0; j < sizeof(nums); j++)
{
second_num=nums[j];
/* code */
@DhruvaG2000
DhruvaG2000 / error
Created October 14, 2020 13:15
catkin make err
[ 33%] Built target gazebo_light_sensor_plugin_generate_messages_eus
Scanning dependencies of target gazebo_light_sensor_plugin_generate_messages
[ 33%] Built target gazebo_light_sensor_plugin_generate_messages
[ 66%] Building CXX object Camera_Maunil/CMakeFiles/gazebo_light_sensor_plugin.dir/src/light_sensor_plugin.cpp.o
/home/dhruva/catkin_ws_sra/src/Camera_Maunil/src/light_sensor_plugin.cpp: In member function ‘virtual void gazebo::GazeboRosLight::OnNewFrame(const unsigned char*, unsigned int, unsigned int, unsigned int, const string&)’:
/home/dhruva/catkin_ws_sra/src/Camera_Maunil/src/light_sensor_plugin.cpp:67:54: error: ‘using element_type = class gazebo::sensors::Sensor’ {aka ‘class gazebo::sensors::Sensor’} has no member named ‘GetLastUpdateTime’; did you mean ‘LastUpdateTime’?
this->sensor_update_time_ = this->parentSensor_->GetLastUpdateTime();
^~~~~~~~~~~~~~~~~
LastUpdateTime
/home/dhruv
/*
* Device Tree Overlay for Robotics Cape SD-101D
* Strawson Design 2015
*
*/
/dts-v1/;
/plugin/;