Discussion about a community project for Utility Subroutines

DonManfred

Expert
Licensed User
Longtime User
I extend my First Snippet-thread and put two more sub. GetFileExt andGetBasename. Both in the same thread of GetFilename.
The searchengine is great. I figured out that i can use this link
http://www.b4x.com/android/forum/pages/results/?query=getfileext&page=1&prefix=19
to easily find my Snippet :cool:

Erel, you rule! :D

And at this Point
thanx to all of you who take part of the discussion and finding the right place to do.
@stevel05 , @klaus , @NJDude , @LucaMs , @thedesolatesoul , @HotShoe , @Erel , @corwin42 , @Reviewnow

b4arulez.gif
 
Last edited:

thedesolatesoul

Expert
Licensed User
Longtime User
I was hoping people would be posting more obscure things that are harder to do in Android rather than basic stuff you could probably write code for in the same time you search for it.
I mean I dont mind a collection of functions like DonManfred did above, but to post Left/Mid/Right as separate threads is a bit much, and also the exact same functions exist in margret's StringFunctions...so hmm...how it goes.
@DonManfred can you add functions from this post to yours too: http://www.b4x.com/android/forum/threads/extract-file-path.15940/#post-91158
Thanks.
 

stevel05

Expert
Licensed User
Longtime User
@thedesolatesoul I'm sure it will come, it happened very quickly from discussion to fruition, and I for one am sorting through my projects to find snippets that may not be held elsewhere, or buried in other posts.
 

DonManfred

Expert
Licensed User
Longtime User

DonManfred

Expert
Licensed User
Longtime User
probably can call it GetPath instead of parent path?

I did so. Sub renamed to GetPath

You can change the thread title. Go to the top (where the Unwatch Thread is) and there is a Thread tools section.

Thank you. Edited the Title from "GetFilename" to "FileUtil SUBs"

The Searchengine still states Getfilename as Threadtitle. See here. I think this is part of the Reindexing every 24h @Erel told about?
 

stevel05

Expert
Licensed User
Longtime User
I figured out that i can use this link

Nice, my javascript is pretty much non existent, but here's a little bit of code you can put in a bookmark(it works in chrome at least) for quick access. It's probably totally the wrong way to do it, but I'm sure someone will put me right:)

B4X:
javascript:var target=prompt("Enter Search Item");window.open('http://www.b4x.com/android/forum/pages/results/?query='+target+'&page=1&prefix=19','_self');
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Nice, my javascript is pretty much non existent, but here's a little bit of code you can put in a bookmark(it works in chrome at least) for quick access. It's probably totally the wrong way to do it

B4X:
javascript:var target=prompt("Enter Search Item");window.open('http://www.b4x.com/android/forum/pages/results/?query='+target+'&page=1&prefix=19','_self');


NICE... Ok, in firefox i cannot use that directly. But in a javascript-console i can copy and paste it and it works like a charm...

That´s cool. I´ll find out how i can easily use such "bookmarks"... I often use the search engine... If i can use such bookmark, give an searchstring and press enter and the a new tab with this searches appears...
 

stevel05

Expert
Licensed User
Longtime User
To open in a new tab, just remove the reference to _self

B4X:
javascript:var target=prompt("Enter Search Item");window.open('http://www.b4x.com/android/forum/pages/results/?query='+target+'&page=1&prefix=19');
 

LucaMs

Expert
Licensed User
Longtime User
I do not know where to post this, maybe on "chit chat", but this is the topic that gave me the "idea".

I was thinking of developing a sw using B4J, a cataloger of links to snippets.

The program can be quite simple and classic, it should display a tree with categories / subcategories on the left
and a relative list of snippets names (and descriptions), which are links to the posts, on the right.

So, it should analyze the main page of the forum ("Code snippets" - http://www.b4x.com/android/forum/forums/code-snippets.59/)
open every post that is not already present in the database of the program, read the tags, etc..


I do not know B4J very well and primarily I do not know how to parse html pages of the forum, so I had this GREAT idea:
I might suggest to you to develop the project :rolleyes::D

(Alternatively, I could satisfy me with information about parsing html pages using B4J)


P.S. tacit: it would be a program available to all members, including source code!
 
Last edited:

LucaMs

Expert
Licensed User
Longtime User
It is an idea I like, but the only problem is how to get the html without logging in, or well, how to login to the forum to get the html. Also you need to open each post to get the tags.


You're right: I'm used to auto login with the browser cookies, so I have thought about this.
But Erel can give us the solution for this.

Open posts should not be a big problem, I think.

As you can see, I'm not used to the concepts of web pages :(
 

DonManfred

Expert
Licensed User
Longtime User
in the "Code snippets," I think I should just post the link, do not duplicate the code.
Am I wrong?

I think yes. The idea of the Code snippets was that everyone (you and me too) have an good place to find snippets. Without need to grind the hole forum to find good ones.

Create a thread in snippets. And if a user then ask for a code you can easy find your snippet and give him then the link to you Snippetthread.
 

DonManfred

Expert
Licensed User
Longtime User
It is an idea I like, but the only problem is how to get the html without logging in, or well, how to login to the forum to get the html. Also you need to open each post to get the tags.

The first steps are easy... Just start with this RSS-Feed
http://www.b4x.com/android/forum/forums/code-snippets.59/index.rss

You have all (or possibly only the last x) threads in snippets-forum. @Erel may have more informations about how many rss-items this feed have in maximum.
You also have the url to the thread and then a little bit of parsing is needed, yes...

Maybe it is possible in this rss to get the hole threadpost (first post in thread) within this rss.. So a parsing of the thread (in forum) is not needed. In rss the text is plaintext and could be easy searched for the keywords (subname, description, requires, tags)
 

klaus

Expert
Licensed User
Longtime User
in the "Code snippets," I think I should just post the link, do not duplicate the code.
Am I wrong?
In my opinion, the code must be in the CodeSnippet forum.
If you want to have the code only one place you should put the link in the other post.
 
Top