Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hashes and String Example #3477

Merged
merged 6 commits into from
Jul 20, 2023
Merged

Conversation

bsbodden
Copy link
Contributor

@bsbodden bsbodden commented Jul 9, 2023

Hashes example for code snippets project

@elena-kolevska
Copy link
Contributor

@bsbodden can you please open your branch so I can send a PR?

@bsbodden
Copy link
Contributor Author

bsbodden commented Jul 11, 2023

@bsbodden can you please open your branch so I can send a PR?
@elena-kolevska I think it I did, as long as you have write access to Jedis I believe.

Screenshot 2023-07-11 at 10 48 41 AM

I also added you as a collaborator to the fork, just in case

@elena-kolevska
Copy link
Contributor

elena-kolevska commented Jul 11, 2023

Thanks @bsbodden, I'm in! Ok, so I fixed a few small things and set the example locally; it shows up nicely.
Now back to you to make the tests pass :)

@bsbodden
Copy link
Contributor Author

@elena-kolevska this is ready to be reviewed

@elena-kolevska
Copy link
Contributor

@dwdougherty can you pls review this?

@dwdougherty
Copy link
Contributor

The example uses two spaces for indentation rather than four spaces, which breaks the Hugo source code highlighter. Please use multiples of four spaces throughout.

@bsbodden
Copy link
Contributor Author

The example uses two spaces for indentation rather than four spaces, which breaks the Hugo source code highlighter. Please use multiples of four spaces throughout.

That would make it violate Jedis indentation setting of 2. https://github.com/redis/jedis/blob/master/hbase-formatter.xml#L85

I would recommend we change Hugo's setting since most modern Java repos now use 2 spaces and it makes it visually more appealing in documentation settings.

@dwdougherty
Copy link
Contributor

I'm no expert, but it looks like it's a global setting. The other languages seem to be using four spaces. I'll look into it though.

@bsbodden
Copy link
Contributor Author

I'm no expert, but it looks like it's a global setting. The other languages seem to be using four spaces. I'll look into it though.

Neither am I on Hugo, but I thought it used the Google Java Format, via Chroma? or something like that. But I think it eventually loads https://github.com/google/google-java-format (which I thought it was the default, and I believe it's set to 2 spaces - but this is when I was playing with Hugo like 3 year ago or so)

@dwdougherty
Copy link
Contributor

In any case, apart from the appearance of the code (it's readable), the examples look fine to me. They match what's there for Python and Node.js.

I'll continue my investigation of the spacing issue.

@bsbodden bsbodden changed the title Add Hashes Example Add Hashes and String Example Jul 17, 2023
@bsbodden
Copy link
Contributor Author

@elena-kolevska @dwdougherty Changed the indentation to 4 spaces and added the Strings Example

@dwdougherty
Copy link
Contributor

Igor was able to modify the redis-stack-website code to provide for 2-space "tabs" (didn't think he'd get to it that quickly), so you're free to use 2-space indentation. I'm sorry you changed your code before I was able to reply with a fix.

@bsbodden
Copy link
Contributor Author

@dwdougherty No problem, I'll change the examples on that folder and push again

@uglide
Copy link
Contributor

uglide commented Jul 20, 2023

@bsbodden @dwdougherty LGTM

@uglide uglide merged commit 983b677 into redis:emb-examples Jul 20, 2023
uglide added a commit that referenced this pull request Jun 18, 2024
* Fix search_quickstart example

* Add data_class step to SearchQuickstartExample

* Update examples with new bikes and align to new tutorial

* Fixes doctests for search tutorial

* Small fixes doctests

* Updates search tutorial doc examples to new format and data

* Fix formatting in doc tests

* Add Hashes and String Example (#3477)

* Add Hashes Example

* Fixes examples for hash tutorial

* Refactor Hash Tutorial to Java 8 (from 17)

* Change indentation to 4 spaces

* Add Strings Example

* Reformat samples to 2-space indentation

---------

Co-authored-by: Elena Kolevska <elena@kolevska.com>

* Add Geospatial data type example (#3487)

* Add Geospatial data type example

* Add missing REMOVE_END

* Added example Java code snippets for Streams (#3641)

* Java example code snippets for T-Digest and TopK (#3660)

* Created example for t digest

* Added example for topK

---------

Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.12>
Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.11>

* Create Java code snippets for sets #3626 (#3661)

* Create Java code snippets for sets #3626

* Apply suggestions from code review to add // STEP_END lines.

Co-authored-by: David Dougherty <david.dougherty@redis.com>

* format imports

---------

Co-authored-by: David Dougherty <david.dougherty@redis.com>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

* Create Java code snippets for count min sketch (#3644)

* added code snippet for CMS in Java

* Update CMSExample.java

* format spaces

* use cmsIncrBy simple variant

* more format spaces

---------

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

* Added Java code snippets for Bloom #3630  (#3671)

* Added java example for bloom filter

* Removed space

* fix and format imports

* fix compile error

* format spaces

* Add del command and rename obj

* Add del command and fix format

* change to junit assert

* Update BloomFilterExample.java

* Add correct output comment

---------

Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.11>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.7>

* Added java code snippet for hyperloglog (#3674)

* Added Java code snippet for HyperLogLog

* fix format and imports

* fix spaces

* change to junit assert

* Added correct output comment

* Update HyperLogLogExample.java

---------

Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.7>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

* Added Java code snippets for cuckoo filters (#3679)

* Add CuckooFilterExample

* Add step start comment

* Update CuckooFilterExample.java

---------

Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.7>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

* Create Java code snippet for lists #3625 (#3677)

* Added example Java code snippets for the List#3625

* format spaces

---------

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

* Create Java code snippet for sorted sets  (#3680)

* added an example for SortedSets in java

* Update SortedSetsExample.java

* made changes as per the review.

* Format spaces in SortedSetsExample.java

---------

Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

* Added Java code snippet for bitmap  (#3687)

* Add bitmap example

* Change class name

* Add assert for res3 and res4

* Update BitMapsExample.java

* Format spaces in BitMapsExample.java

---------

Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.7>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>

---------

Co-authored-by: Elena Kolevska <elena@kolevska.com>
Co-authored-by: Brian Sam-Bodden <bsbodden@integrallis.com>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
Co-authored-by: Harshvardhan Parmar <harshparmar4902@gmail.com>
Co-authored-by: Ranjeet SIngh <32495484+Ranjeet0611@users.noreply.github.com>
Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.12>
Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.11>
Co-authored-by: Suraj <112368828+suraj11chauhan@users.noreply.github.com>
Co-authored-by: David Dougherty <david.dougherty@redis.com>
Co-authored-by: Ranjeet Singh <ranjeetsingh@192.168.1.7>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants