Posts

Showing posts from February, 2001

Cookie Clicker Auto Clicker Code Example

Example 1: cookie clicker #Hacks: # Type these in your console which you can open by # pressing STRG + SHIFT + J (Chrome) or STRG + SHIFT + K (Firefox) # changes the amount of cookies Game.cookies = amount in int # unlimted cookies Game.cookies = Infinity # If you want to get out of Infinity cookies Game.cookiesd = 0 # set up the CookiesPerSecond Rate by the number you want Game.cookiesPS= amount in int # clicks on cookie forever without moving your mouse in the highest speed var autoclicker = setInterval(function() { Game.ClickCookie(); }, 10); # stoping autoclicker clearInterval(autoClicker) # clicks on golden cookie without moving your mouse setInterval(Game.goldenCookie.click, 500) # Get the achievement you want by changing it to the achievement name you want # Game.Win(‚ACHIEVEMENT‘) Example 2: cookie clicker haha dopamine go brrrrrrrr Example 3: cookie clicker edit : getting out of infinity cookies doe

Css Databales Code Example

Example: table border css table, th, td { border: 1px solid black; }

Create File C # Code Example

Example: how to create a file in c /** * C program to create a file and write data into file. */ #include < stdio . h > #include < stdlib . h > #define DATA_SIZE 1000 int main ( ) { /* Variable to store user content */ char data [ DATA_SIZE ] ; /* File pointer to hold reference to our file */ FILE * fPtr ; /* * Open file in w (write) mode. * "data/file1.txt" is complete path to create file */ fPtr = fopen ( "data/file1.txt" , "w" ) ; /* fopen() return NULL if last operation was unsuccessful */ if ( fPtr == NULL ) { /* File not created hence exit */ printf ( "Unable to create file.\n" ) ; exit ( EXIT_FAILURE ) ; } /* Input contents from user to store in file */ printf ( "Enter contents to store in file : \n" ) ; fgets ( data , DATA_SIZE , stdin ) ; /* Write data to file */ fputs ( data , fPtr ) ; /* Close file

Bootstrap Search Bar With Dropdown Code Example

Example: searchable dropdown bootstrap < select class = " selectpicker " data-live-search = " true " > < option data-tokens = " ketchup mustard " > Hot Dog, Fries and a Soda </ option > < option data-tokens = " mustard " > Burger, Shake and a Smile </ option > < option data-tokens = " frosting " > Sugar, Spice and all things nice </ option > </ select >

Kotlin For Each Loop Code Example

Example 1: for loop kotlin val array = arrayOf ( 1 , 3 , 9 ) for ( item in array ) { //loops items } for ( index in 0. .array .size - 1 ) { //loops all indices } for ( index in 0 untill array .size ) { //loops all indices } for ( index in array .indices ) { //loops all indices ( performs just as well as two examples above ) } Example 2: kotlin for loop val list = listOf ( "A" , "B" , "C" ) for ( element in list ) { println ( element ) } Example 3: kotlin iterate array val names = listOf ( "Anne" , "Peter" , "Jeff" ) for ( name in names ) { println ( name ) } Example 4: for loop kotlin for ( x in 0 ..10 ) println ( x )

AnalogRead(0) Or AnalogRead(A0)

Answer : To answer Tyilo's specific questions: analogRead(5) and digitalRead(5) will read from two different places. The former will read from analog channel 5 or A5 and the latter will read from pin 5 which happens to be a digital pin. So yes, if you want to read an analog pin with digitalRead you should be using A5 . Why? analogRead requires a channel number internally but it will allow you to give it a pin number too. If you do give it a pin number it will convert it to its corresponding channel number. As far as I can tell analogRead is the only function which uses a channel number internally, is the only one to allow a channel number, and is the only function with this undocumented pin-to-channel conversion. To understand this let's start off with some examples. If you want to use analogRead on the first analog pin A0 you can do analogRead(0) which uses the channel number or analogRead(A0) which uses the pin number. If you were to use the pin number

Download Font Awesome Free Version Code Example

Example: download font awesome icons View the icons here : https : //fontawesome.com/icons?d=gallery Download SVG files here : https : //github.com/FortAwesome/Font-Awesome/tree/master/svgs

Onclicklistener Javascript Code Example

Example 1: javascript onclick event listener document .getElementById ( "myBtn" ) .addEventListener ( "click" , function ( ) { alert ( "Hello World!" ) ; } ) ; Example 2: HTML button onclick <!DOCTYPE html > <html > <head > <title > Title of the document</title > </head > <body > <p > There is a hidden message for you. Click to see it.</p > <button onclick="myFunction ( ) " > Click me!</button > <p id="demo" > </p > <script > function myFunction ( ) { document. getElementById ( "demo" ) .innerHTML = "Hello Dear Visitor!</br> We are happy that you've chosen our website to learn programming languages. We're sure you'll become one of the best programmers in your country. Good luck to you!" ; } </script> </body> </html> Example 3: javascript on

Crypto Key Generate Rsa Key Code Example

Example: how to generate my RSA key pair myLocalHost% ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key(/home/johndoe/.ssh/id_rsa):

Error: 'memset' Was Not Declared In This Scope Memset(Frq, 0, Sizeof(Frq)) Code Example

Example: error: ‘memset’ was not declared in this scope in cpp C : #include < string . h > C ++ : #include < cstring > NOTE : inclusion of above headers works fine

7-Zip Command Line: Extract Silently/quietly

Answer : 7-Zip does not have an explicit "quiet" or "silent" mode for command line extraction. A similar question over at Stack Overflow, Extracting a 7-Zip file "silently" - command line option , gives a possible solution using Python scripting code: One possibility would be to spawn the child process with popen, so its output will come back to the parent to be processed/displayed (if desired) or else completely ignored (create your popen object with stdout=PIPE and stderr=PIPE to be able to retrieve the output from the child). And then a similar question here on Super User, Redirect 7-Zip's command-line output to /dev/null on Windows when extracting a .7z file reports that the issue is mostly the output, and that by sending the output to NULL, you make the system run essentially silent: Try doing this: %COMSPEC% /c "%ProgramFiles%\7-Zip\7z.exe" ... Yes, it does support command line use. Open a command prompt and n

Mongodb Docker Hub Code Example

Example: mongodb docker docker run - d - p 27017 - 27019 : 27017 - 27019 -- name mongodb mongo : 4.0 .4

Connect The SMS Send Log To The SMSMessageTracking Data View

Answer : The short answer is that currently there is no way to accomplish this and there is no existing effort on SFMC end to correct this. The best you can do is soft matches on data and leave open the risk of potential data corruption due to mismatched records. I created an 'idea' in the Trailblazer community - please add support to this and hopefully we can get some movement to resolve this issue.

Convert Python Datetime To Epoch With Strftime

Answer : If you want to convert a python datetime to seconds since epoch you could do it explicitly: >>> (datetime.datetime(2012,04,01,0,0) - datetime.datetime(1970,1,1)).total_seconds() 1333238400.0 In Python 3.3+ you can use timestamp() instead: >>> datetime.datetime(2012,4,1,0,0).timestamp() 1333234800.0 Why you should not use datetime.strftime('%s') Python doesn't actually support %s as an argument to strftime (if you check at http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior it's not in the list), the only reason it's working is because Python is passing the information to your system's strftime, which uses your local timezone. >>> datetime.datetime(2012,04,01,0,0).strftime('%s') '1333234800' I had serious issues with Timezones and such. The way Python handles all that happen to be pretty confusing (to me). Things seem to be working fine using the calendar module (see links 1, 2, 3 and

Yootube To Mp3 Code Example

Example: yt to mp3 Youtube - DL works great . Download from https : //youtube-dl.org/. To use, type youtube-dl <url> --audio-format mp3

4k Youtube To Mp4 Code Example

Example 1: youtube to mp4 ytmp3.cc is the best by far Example 2: youtube to mp4 flvto.biz is great for it

Animation Script Unity Code Example

Example 1: how to play animation with code in unity public GameObject ExampleNPC ; void Update ( ) { if ( Input . GetButtonDown ( "Animation" ) ) // Make sure to refrence this in Input settings { ExampleNPC . GetComponent < Animator > ( ) . Play ( "Anim name" ) ; } } Example 2: play animation through script unity animator . Play ( "StateName" ) ;

"Allow All The Time" Location Prompt Not Coming In Android SDK 29

Answer : In order to access the location in background on device running Android 10 (API level 29) or higher, you also need to use below permission in the manifest file <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> please refer the below link for more information https://developer.android.com/training/location/permissions?hl=fr Add "ACCESS_BACKGROUND_LOCATION" in manifest and permissions array. If you only add permission in manifest then "Allow all the time" options will not be shown. You need to add in array to ask users to grant at runtime. In manifest: <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> In your activity: if (ContextCompat.checkSelfPermission( this.applicationC

Length Of Array Python Code Example

Example 1: how to loop the length of an array pytoh array = range ( 10 ) for i in range ( len ( array ) ) : print ( array [ i ] ) Example 2: size array python size = len ( myList ) Example 3: python get array length # To get the length of a Python array , use 'len()' a = arr . array ( ‘d’ , [ 1.1 , 2.1 , 3.1 ] ) len ( a ) # Output : 3 Example 4: find array length python array = [ 1 , 2 , 3 , 4 , 5 ] print ( len ( arr ) ) Example 5: python array length len ( my_array ) Example 6: find array length in python a = arr . array ( 'd' , [ 1.1 , 2.1 , 3.1 ] ) len ( a )

Can I Convert Embedded Base64 Encode Font To A Font File?

Answer : Copy the base64 encoded part and convert it. There are many ways to do that. Linux base64 -d base64_encoded_font.txt > font.woff Mac OS X openssl base64 -d -in base64_encoded_font.txt -out font.woff WIndows Go to http://www.motobit.com/util/base64-decoder-encoder.asp and paste the text. Choose "decode the data from a Base64 string (base64 decoding)" and "export to a binary file". @mcrumley's answer is correct, but for those of you who can't figure it out and/or are afraid of the command-line, I have an alternate method. I just Googled your question, and found http://base64converter.com/ which can convert/decode (and encode) any base64 file back to its original format. I'd used it to encode and decode base64 images in this past, but this was my first attempt with a font. As a test I plugged in the embedded base64 font info I found in a random webpage's css file. You don't want the entire entry, leave off the css in

Alternatives To JSP For Spring MVC View Layer

Answer : I recently discovered Thymeleaf. It looks to be a complete replacement for JSPs and has integration with Spring MVC. The template approach looks more like HTML and may be more palatable to your UI designers. They have a small write-up that compares the two solutions side-by-side. In the standard Java EE API, the only alternative to JSP is Facelets. As far now (2010) JSF is the only MVC framework which natively supports Facelets. Spring MVC supports out of the box only JSP, but it has a configurable view resolver which allows you to use Facelets anyway. Other candiates are 3rd party templating frameworks such as Velocity, Freemarker, and Thymeleaf which can be configured as a view technology for Spring MVC. Spring documentation has integration examples with Velocity and Freemarker. I recently started going with plain HTML and jQuery for presentation with Spring MVC only creating a JSON view. So far it's going quite well and even though I have to do the javascri

Git Remove Local Branches Code Example

Example 1: delete branch from remote // delete branch locally git branch -d localBranchName //delete local branch that is unmerged git branch -D localBranchName // delete branch remotely git push origin --delete remoteBranchName Example 2: delete a branch in git // delete branch locally git branch -d localBranchName // delete branch remotely git push origin --delete remoteBranchName Example 3: git how to delete origin branch $ git push origin --delete feature/login Example 4: git delete branch ## git version 2.25 .1 ## Deleting local branches git branch -d feature/login ## Deleting remote branches git push origin --delete feature/login ## Deleting both a local and a remote branch ## They are completely separate objects in Git. But git branch -d feature/login && git push origin --delete feature/login Example 5: delete local branch git git branch -d <branch_name> Example 6: git delete local branch git branch -d test

Less Odd Even Code Example

Example 1: css odd even child tr :nth-child ( even ) { background : #CCC } tr :nth-child ( odd ) { background : #FFF } Example 2: select even child css li :nth-child ( even ) { /* Selects only even elements */ color : green ; }

Android ADB Stop Application Command Like "force-stop" For Non Rooted Device

Image
Answer : The first way Needs root Use kill : adb shell ps => Will list all running processes on the device and their process ids adb shell kill <PID> => Instead of <PID> use process id of your application The second way In Eclipse open DDMS perspective. In Devices view you will find all running processes. Choose the process and click on Stop . The third way It will kill only background process of an application. adb shell am kill [options] <PACKAGE> => Kill all processes associated with (the app's package name). This command kills only processes that are safe to kill and that will not impact the user experience. Options are: --user | all | current: Specify user whose processes to kill; all users if not specified. The fourth way Needs root adb shell pm disable <PACKAGE> => Disable the given package or component (written as "package/class"). The fifth way Note that run-as is only supported for apps t

How To Limit Border Length For An Input Code Example

Example 1: css border length .page-title :after { content : "" ; /* This is necessary for the pseudo element to work. */ display : block ; /* This will put the pseudo element on its own line. */ margin : 0 auto ; /* This will center the border. */ width : 50 % ; /* Change this to whatever width you want. */ padding-top : 20 px ; /* This creates some space between the element and the border. */ border-bottom : 1 px solid black ; /* This creates the border. Replace black with whatever color you want. */ } Example 2: how to set border length in css without div div { width : 200 px ; height : 50 px ; position : relative ; z-index : 1 ; background : #eee ; } div :before { content : "" ; position : absolute ; left : 0 ; bottom : 0 ; height : 1 px ; width : 50 % ; /* or 100px */ border-bottom : 1 px solid magenta ; }

50cm In Inches Code Example

Example 1: cm to inch 1 cm = 0.3937 inch Example 2: cm to inches const cm = 1 ; console . log ( `cm : $ { cm } = in : $ { cmToIn ( cm ) } ` ) ; function cmToIn ( cm ) { var in = cm / 2.54 ; return in ; }

Find Element In Array Php Code Example

Example 1: array_search in php < ? php $array = array ( 0 => 'blue' , 1 => 'red' , 2 => 'green' , 3 => 'red' ) ; $key = array_search ( 'green' , $array ) ; // $key = 2; $key = array_search ( 'red' , $array ) ; // $key = 1; ? > Example 2: array search by key in php $arr = array ( "one" => 1 , "two" => 2 , "three" => 3 , "seventeen" => 17 ) ; function find ( $mot ) { global $arr ; // this is global variable $ok = false ; foreach ( $arr as $k => $v ) { if ( $k == $mot ) { return $v ; $ok = true ; // or return true; } } if ( ok == false ) { return - 1 ; } // or return false; } //call function echo find ( "two" ) ; Example 3: find element in arrat php $userdb = Array ( ( 0 ) => Array ( ( uid ) => ' 100 ' , ( n