View Full Version : [Release-28th May 2009]Code Snippet Viewer v0.5.1 + Code Snippet Creator v0.5.0
scilor
6th March 2008, 04:45 PM
With this tool you can lookup CodeSnippets on the Go! Just add them to the Access Database, convert it with the included tool "Code Snippet Creator" and copy it to your Device and start "Code Snippet Viewer"
The Viewer is Tested on my Stock HTC Kaiser - But it should run on any Touchscreen powered WM Device with netcfv2
Code Snippet Viewer v0.5.1
---
1. Copy the "Release" dir on your Windows Mobile Device with .NETcf2
2. Run "CodeSnippetViewer.exe" on Device
- Version 0.5.1
.Fix
- Version 0.5.0
.Release
Code Snippet Creator v0.5.0
---
1. Run "csviewer.exe" on Desktop PC
2. Press "Create Database" Button to create "CodeSnippets.txt"
3. Copy "CodeSnippets.txt" to your Device, where "CodeSnippetViewer.exe" is located
The Snippets are read out of the "CodeSnippets.mdb", feel free to add your Snippets there, and Post it on XDA-Developers
- Version 0.5.0
.Release
Download
http://www.scilor.com/codesnippets.html
If you have suggestions to improve this, just post it here!
scilor
6th March 2008, 06:34 PM
Space Holder for additional things later on
nEuDy
2nd April 2008, 08:55 AM
WOW.. very interessting and helpfull Prog :-) :) thank you :cool:
scilor
2nd April 2008, 12:32 PM
No Problem, if you have suggestions post it here :)
DJ_Tolja
3rd May 2008, 03:41 PM
sorry for this question im just a newbie,
when i see it right r u german, so pm me pls in german if u can THX!
Alkhal
3rd May 2008, 05:19 PM
Ok I don't know exactly what this is for? I wish I did because it looks intriguing.
DJ_Tolja
4th May 2008, 08:34 PM
so what is it for now? can anybody describe it please?
scilor
4th May 2008, 09:10 PM
You can create an Access Database for Code Snippets or other things you need to access on the go
then you can convert it and upload it to you phone
scilor
23rd May 2009, 12:39 AM
Website Added:
http://scilor.sc.funpic.de/codesnippets.html
bilbo_b
28th May 2009, 09:28 AM
i have tested your app. but it doesnt work. when i use your sample files, it works, but when i generate a new txt from my mdb, there is an error starting the app. ArgumentOutOfRangeException
here is my exported *.txt. I love this program. great work. i try to sync the mdb with a mysql db in the the net. so i can add new snippets online and sync them back to the device.... i have a cms on my website, where i have some modules which i can use for this. it works also with syntax highligtning (on the net) for some of the programming languages.
scilor
28th May 2009, 04:59 PM
Thank you for your feedback, but I have the problem, that it doesnt works in the emulator anymore, I do not know why, it worked before xD
I'll If I can find teh problem.
scilor
28th May 2009, 05:14 PM
NEW VERSION
Problem should be fixed!
bilbo_b
28th May 2009, 06:30 PM
many thx. i will try this @home, because i am now @work :-) i will try to make an exporter with PHP for my online version to, when i have it done, i can mail them to you. this exporter should be easy to code. i can also make an importer, so that you can import a textfile.
the next idea could it be, that you mobile can add a new recordset with a new snippet, so the sync ist complete... but this only an idea by me...
scilor
28th May 2009, 07:03 PM
Here you have the needed code for exporting from SQL to textfile (Routine from the Creator):
I have stripped it down just to show the important things
oRS.Open "SELECT * FROM CodeSnippets ORDER BY ProgrammingLanguage ASC, Category ASC, UnderCategory ASC", oConn, adOpenKeyset
oRS.MoveFirst
txtData = oRS.RecordCount & vbNewLine
For I = 1 To oRS.RecordCount
TempData = oRS.Fields("ID").Value & ">{.+.}<" & _
oRS.Fields("ProgrammingLanguage").Value & ">{.+.}<" & _
oRS.Fields("Category").Value & ">{.+.}<" & _
oRS.Fields("UnderCategory").Value & ">{.+.}<" & _
oRS.Fields("Snippet").Value
txtData = txtData & Replace(TempData, vbNewLine, ".>-NewLine-<.") & vbNewLine
'This Replaces all linebreaks in the Tempdata and attaches it to txtData and also adds a line break afterwards
oRS.MoveNext
DoEvents
Next
oRS.Close
oConn.Close
Call frmViewer.txt_WriteAll(PathTo & "CodeSnippets.txt", txtData)
Here Is a php I wrote from sketch without testing:
'Connect to the DB first
$newLine = '
';
'Sry that is a new line I do know if "\n" works instead
$SQLString = "SELECT * FROM CodeSnippets ORDER BY ProgrammingLanguage ASC, Category ASC, UnderCategory ASC";
if ($SQLAnswer = mysql_query($SQLString))
{
$txtData = mysql_num_rows($SQLAnswer).$newLine;
while($row = mysql_fetch_object($SQLAnswer))
{
$TempData = $row->ID.'>{.+.}<';
$TempData .= $row->ProgrammingLanguage.'>{.+.}<';
$TempData .= $row->Category.'>{.+.}<';
$TempData .= $row->UnderCategory.'>{.+.}<';
$TempData .= $row->Snippet;
$txtData .= $newLine.str_replace('.>-NewLine-<.', $newLine, $TempData).$newLine;
}
}
'Write $txtData to a File!
bilbo_b
29th May 2009, 07:18 AM
yes this should do the job. i will try it at the weekend. many thx
bilbo_b
29th May 2009, 07:39 AM
the rapidshare link show the old version. Can you please update the file or the link?
bilbo_b
29th May 2009, 09:12 AM
i have done the online version. there is a *.sql file included, this generates the needed MySQL tables. Also there is a slightly modified *.mdb. i have only modified the Formular.
next there are the needed php an html files for the webserver. the html file is a template, so anyone can modify it.
Update:
i have done some Additions. Included is now EditArea a OpenSource Syntax Highlightning Script. Also i have added a new version of the SQL table, since there is a new field "highlight", this is only for the JavaScript, this field will not be exported in any way.
Now you can manualy add a ProgrammingLanguage or Category by the textfield OR you can choose one from existing Selectbox.
The last time i have forgotten to say, that you must configure the MySQL connection in the common.php. have a look at the following block and put in the right values:
define("DATABASE_NAME","");
define("DATABASE_USER","");
define("DATABASE_PASSWORD","");
define("DATABASE_HOST","");
scilor
29th May 2009, 03:09 PM
Sorry, made a mistake on my website, now it points to the new version :)
bilbo_b
29th May 2009, 06:04 PM
there is no new *.exe file in the zip :-( the directory contains only some txt files :-( please reupload the file.
scilor
29th May 2009, 06:22 PM
Sry, here it is again.
Had a problem with my packer :(
bilbo_b
31st May 2009, 09:59 AM
Thx, this version works, perfectly. It loads also my exported online version.
i have an error in my online version, when i add a new entry, but i will resolve this, this weekend.
bilbo_b
3rd June 2009, 04:51 PM
i have changed the PHP/SQL Version of my script (http://forum.xda-developers.com/showpost.php?p=3854809&postcount=17). so i have added a Syntax Highlightning Script. it works very well...
scilor
14th January 2010, 05:25 PM
Ok SciLor's Support board is online now!
http://scilor.ac-host.net/myboard/
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.