|
3
|
DonationCoder.com Software / Finished Programs / Re: DONE: Open images without program window showing.
|
on: June 20, 2011, 02:01:01 AM
|
the only addition that I can think of would be to set the images to close after a given period This functionality would be very easy to add. skwire, what did you use to write frameless? It's written in AHK and it's really not much more than simply reading in the command-line parameters and creating a very simple GUI using a standard picture control. I see, that's what I'd guessed. btw, are you not sharing your source code on the website? Somehow I thought that handling pictures was a lot more complicated than that, because of various formats and types ...etc. you make it look easy though! So why do all they image viewers cost a bunch and stuff? I guess that would be because or writing native decoding algorithms versus using libraries. Still good job on this. In a previous thread I started on this forum it was pointed out to me that what I was trying to do at that time was already available in the OS but if it had not been pointed out to me, like now, I would probably never have found it.  Always did prefer mechanical things, at least you can take them apart and see how they work. It's the same with computers it's just it follows a different set of rules, and the basics are the code, which can be hidden. I guess you need training with it just like you need some basic understand of physics (which can be intuitive) to deal with mechanical things.
|
|
|
|
|
7
|
DonationCoder.com Software / Finished Programs / Re: DONE: Open images without program window showing.
|
on: June 16, 2011, 03:08:40 AM
|
how about maxview by faststone? You'll have to see the documentation for the commandline parameters Also for scripts, if you are using win7 and up, I'd recommend use powershell. If this is only for your computer you could also use other scripting languages by installing their runtime, python, ruby ...etc, they would be overkill but would work well and expand even better. This is if you know programming languages already. skwire would recommend ahk as well as that is what he used to create the app. as for examples, first link on google is this which looks good.
|
|
|
|
|
8
|
Main Area and Open Discussion / Living Room / Re: I'm Confused
|
on: February 01, 2011, 11:14:52 PM
|
Imagine a Microsoft car! Takes 15 minutes to start  Then again, I'd rather have that than the Apple car, where you can only fill up at Apple gas stations... Hahahah~!  I suppose gas for Linux cars is free, but you need to refine it yourself... And allow anybody else who wanted to use it to do so.  No, anyone who wanted to clone it to do so  , you get to keep your copy. And if you come up with a wicked new navigation or nitro system, you have to share its specs so others can clone it 
|
|
|
|
|
9
|
Main Area and Open Discussion / Living Room / Re: I have a very hard announcement to make
|
on: October 14, 2010, 06:55:30 AM
|
First, what you have accomplished can be seen as an example for many young people here. It is more than what many have done. I don't often think about how some members are so older than me here. When reading posts I automatically assume they are around my age... bizarre huh? Or maybe I just follow the logic of the post and not try to reconstruct a real person behind those thoughts as you would do face to face. I don't know why you'd say that you are not where you need to be as a programmer as your applications have clearly shown that you possess enough to solve various computer problems. But then your goals might have been a lot bigger, and that is what I want to know. Since I hardly have any goals of mine, I like to spy on other people's goals !  What level would you need to get a permanent employment near where you leave? Do you have an objective way to measure that?
|
|
|
|
|
11
|
Other Software / Developer's Corner / Organizing code written by oneself and others downloaded from elsewhere
|
on: September 28, 2010, 05:37:26 AM
|
I need some advise/tips on organizing one's source code. Since so many of you are developers here I wanted to know how you guys manage your code as well. (A code library with low overhead I guess). I am taking this step now, as I am switching my main pc to ubuntu and wanted to reorganize my professional and personal life in terms of documents on there. There are several key concepts that I use to think about the problem so please understand those first. high maintainence - high feature set (versioning, quick search and indexing, rapid updates and deployment, secure offsite backups, notes/documentation) low maintainence - low feature set (versioning, throwaway scripts, testing) Features I wanted for my solution: - version control (git? or something with multiple project support) - quick search within contents (???) - backup (dropbox? mozy? rsync? simple-backup?) - browseable, ie. must be organized/tagged. Is there a good tagging architecture? - maintain documentation for all scripts/programs as well (PAD? wiki? txt files with a program? dokuwiki?) So what do you guys do? and any ideas? /edit: other discussions similar to this (nothing exactly like this though) http://www.donationcoder....m/index.php?topic=10318.0http://www.donationcoder....m/index.php?topic=19302.0
|
|
|
|
|
12
|
Main Area and Open Discussion / Living Room / Re: How to manage large clipart collections?
|
on: August 15, 2010, 11:25:44 PM
|
|
I had a similar problem but not as extensive as yours. Since this was a work related issue, i assigned one graphic designer to create thumbnails in PNG for all AI files (in retrospect should have chosen jpeg for the metadata, don't know if png has a widely supported metadata structure). Then I used Gallery Server Pro to read the folder structure and serve it on a different pc. So now the collection is accessible via the network, easily searchable, and easy to add to as well. It actually takes care of a lot of these problems. I also tried to use imagemagick to convert ai files automatically, but for that to work, the AI needs to be saved with the PDF option enabled, else it won't work. I am sure it can convert the .eps files directly though. So this might be a start.
|
|
|
|
|
14
|
Other Software / Found Deals and Discounts / Re: Take Command Console LE from JPSoft
|
on: August 06, 2010, 07:54:04 AM
|
I just heard about another free console enhancer: ConsolePretty unstable, though - and it's relatively laggy as well, unless you bump down the update timeout and burn CPU cycles. And has problems with some "fullscreen console apps" (like hexit and hiew). It's stable enough here. I have tabs configured to run CMD.EXE, Windows Powershell, TCC LE, Cygwin bash, and MinGW zsh. I can also run things like Eric Meyer's VDE editor and Necromancer's DOS Navigator. I had problems with alpha-blending and transparency, and simply turned that off. Transparency is eye-candy I don't need in daily use. And I load Kris Sweger's ANSIPlus in CONFIG.NT for ANSI support in DOS apps, and Jason Hood's ANSICON in CMD.EXE/TCC LE sessions for ANSI support there. It all works fine in Console 2 tabs. I haven't found a need to diddle the update settings. Console 2 doesn't do full screen, but I wouldn't want to. I have a 19" monitor in 1600x1200 resolution, and prefer everything in a window. That sounds awesome... I had just discovered TCC LE today and set it up in console 2 and while I was at it, i added powershell, and thought that I should probably add bash/cygwin or msys to it (though portable versions of it) and i soon got lost on researching those solutions rather than getting it done. So I would be very happy if you could tell me how you have set it up, and if your setup is portable. (posting your console.xml would be cool as well) And just FYI, TCC le wouldn't work with console 2 for me, until i updated it to the latest version 146 (had 144 earlier).  for console2 from me as well.
|
|
|
|
|
15
|
DonationCoder.com Software / Post New Requests Here / Re: IDEA: VPR, visual people randomizer!
|
on: July 01, 2010, 12:49:35 AM
|
sorry, my bad. I assumed the screenshot was excel. No as far as i know it shouldn't work in openoffice, but hmm that gives me an opportunity to try macros in open office  As for stand alone... I don't have enough time for that, though I do have one flash application lying about which did something similar. I'll see if i can find it.
|
|
|
|
|
16
|
DonationCoder.com Software / Post New Requests Here / Re: IDEA: VPR, visual people randomizer!
|
on: June 30, 2010, 07:22:25 AM
|
since you are already using excel... here's a simple module for it, i've tested it and it works well enough. just put your active cell within your table and run the macro StartRandomizer() [ copy or print] 'Module by Vixay for DonationCoder Option Explicit 'API for windows sleep Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Sub StartRandomizer() 'Moves a shape along the cells, and changes color of the final cell ' No exclusivity for now '30 ms = fast '100 ms = slow '150 ms = stop Dim shpActive As Shape Dim rCell As Range Dim lSpeed As Long Dim lSpeedMax As Long Dim lWinner As Long Dim lCount As Long lSpeed = 30 lSpeedMax = 150 Randomize lWinner = SelectWinner() Debug.Print "to be winner:" & lWinner 'get the shape we will use ( must exist or will cause an error ) If ActiveSheet.Shapes.Count > 1 Then Set shpActive = ActiveSheet.Shapes(1) Else Set shpActive = ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle, 10, 10, 10, 10) shpActive.Fill.Transparency = 0.8 End If For lSpeed = 30 To lSpeedMax Step 20 lCount = 0 For Each rCell In ListArea.Cells lCount = lCount + 1 AlignShapeTo shpActive, rCell 'Debug.Print rCell.Address DoEvents 'Application.ScreenUpdating = True Sleep lSpeed 'slow down speed randomly with a low probability ' i.e. continue through all cells most of the time at the current speed ' except no random slowdowns on the last stage If Rnd >= 0.95 And lSpeed < 130 Then 'can tweak the number here to change how often we randomly switch speeds lSpeed = lSpeed + 20 Debug.Print "random speed slowdown:" & lSpeed End If 'if at winner cell, and at final slowdown stage If lSpeed >= lSpeedMax And lCount = lWinner Then Debug.Print "Found our winner" rCell.Interior.Color = vbRed Exit For 'stop here End If 'Debug.Print lSpeed Next rCell Debug.Print "next slowdown:" & lSpeed Next lSpeed End Sub Sub AlignShapeTo(ByRef shpObj As Shape, rCell As Range) shpObj.Top = rCell.Top shpObj.Left = rCell.Left shpObj.Height = rCell.Height shpObj.Width = rCell.Width End Sub Function ListArea() As Range 'Change this function to suit your needs or just make sure your ' active cell is within your table range Set ListArea = ActiveCell.CurrentRegion 'Set ListArea = Selection End Function Function SelectWinner() As Long 'Randomly choose a cell amongst all the cells Dim lCellCount As Long lCellCount = ListArea.Count Randomize SelectWinner = Rnd * lCellCount + 1 Debug.Print SelectWinner & " / " & lCellCount End Function Sub ClearBackgrounds() ActiveCell.CurrentRegion.Interior.ColorIndex = xlColorIndexNone End Sub Let me know what you think. Should be easy for you to customize colors and all.
|
|
|
|
|
18
|
Main Area and Open Discussion / General Software Discussion / Re: Recreate files but without content to target drive
|
on: March 25, 2010, 08:39:44 AM
|
Alright fellas, 2 hours spent trying to fix the script and here are the results for the python script! a grand total of 13 seconds!!! Zipfile about 12 MB. with 54827 files (created a few files since last count) Things I had to fix: bugfixes modified time errors path length exceeded errors
resolution: #set time to unix epoch 0 = 'Thu Jan 01 07:00:00 1970' so there will be some files with incorrect timestamps in the zipfile
I hope this helps everyone... though I still got some warnings while running the script... probably due to windows handling of files and or paths... makeTreeZip.py:32: DeprecationWarning: struct integer overflow masking is deprecated zf.fp.write(zinfo.FileHeader()) makeTreeZip.py:32: DeprecationWarning: 'H' format requires 0 <= number <= 65535 zf.fp.write(zinfo.FileHeader()) makeTreeZip.py:79: DeprecationWarning: struct integer overflow masking is deprecated zf.close() makeTreeZip.py:79: DeprecationWarning: 'H' format requires 0 <= number <= 65535 zf.close() Here's the final code so far Formatted for Python with the GeSHI Syntax Highlighter [ copy or print] #!/usr/bin/python import os, sys, zipfile, optparse, zlib, fnmatch, time optp=optparse.OptionParser(usage="%prog [options] <target-zip> <source-dir> [<source-dir...>]") optp.add_option("-x", help="exclude mask", action="append", dest="exclude", default=[]) optp.add_option("-q", help="be quiet", action="store_true", dest="quiet", default=False) optp.add_option("-e", help="omit empty directories", action="store_true", dest="omit_empty", default=False) err=optp.error options, args = optp.parse_args() if len(args)<2: optp.print_usage() sys.exit(1) zf=zipfile.ZipFile(args[0], "w") def zfAddNullFile(zf, arcname, date_time, extattr=0): """ Adapted from the method in zipfile """ arcname = os.path.normpath(os.path.splitdrive(arcname)[1]) arcname = arcname.lstrip(os.sep + (os.altsep or "")) zinfo = zipfile.ZipInfo(arcname, date_time) zinfo.external_attr = extattr zinfo.compress_type = zf.compression zinfo.file_size = 0 zinfo.flag_bits = 0x00 zinfo.header_offset = zf.fp.tell() # Start of header bytes zf._writecheck(zinfo) zf._didModify = True zinfo.CRC = CRC = zlib.crc32("") zinfo.compress_size = 0 zinfo.file_size = 0 zf.fp.write(zinfo.FileHeader()) zf.filelist.append(zinfo) zf.NameToInfo[zinfo.filename] = zinfo def printFilename(f, msg=None): if not options.quiet: if msg: print msg, try: print f except: print f.encode("charmap", "replace") for sourceDir in args[1:]: try: sourceDir=sourceDir.decode("latin-1") except: print sourceDir print "Exception while trying to process directory" for dp, dn, fn in os.walk(sourceDir): if fn: for f in fn: f=os.path.join(dp, f) ok=True for xmask in options.exclude: if fnmatch.fnmatch(f, xmask): ok=False break if ok: try: mtime=time.localtime(os.stat(f).st_mtime) except ValueError: print "Error: Modified time out of range." printFilename(f) print os.stat(f).st_mtime mtime=time.localtime(0) #set time to unix epoch 0 = 'Thu Jan 01 07:00:00 1970' except WindowsError: print "Error: Can't find file due to windows limitations." printFilename(f) mtime=time.localtime(0) #set time to unix epoch 0 = 'Thu Jan 01 07:00:00 1970' zfAddNullFile(zf, f, (mtime.tm_year, mtime.tm_mon, mtime.tm_mday, mtime.tm_hour, mtime.tm_min, mtime.tm_sec)) elif not options.omit_empty: mtime=time.localtime(os.stat(dp).st_mtime) #printFilename(dp, "(empty directory)") zfAddNullFile(zf, dp, (mtime.tm_year, mtime.tm_mon, mtime.tm_mday, mtime.tm_hour, mtime.tm_min, mtime.tm_sec), 16) zf.close() print "All Done."
I hope you all enjoy this. I'll attach the exe as well, though I can't make any guarantees for it.
|
|
|
|
|
19
|
Main Area and Open Discussion / General Software Discussion / Re: Recreate files but without content to target drive
|
on: March 25, 2010, 07:23:08 AM
|
Ok I needed to use the utility again and decided to do the speed comparison. I ran it on A folder with [ copy or print] 67.8 GB (72,906,108,928 bytes) 54,824 Files, 5,364 Folders Here's ZeroZipper Start - 06:29:44 PM End - 06:36:41 PM It took 7 minutes!! Out of which 5 minutes was spent just recreating the 0-byte structure! 1 minute to delete files and <1 to create the zip. So this method is definitely not good for large folders. And I think I found a bug. For the zip I didn't put a path just a name "zz.zip", the zip was created in the temp correctly but then it didn't move it to the same location as the zerozipper... it was strange... and the zip was then deleted! so I didn't get any output after waiting for so long! I then had high hopes for the python version, as it would avoid the slow Disk I/O. So i finally used the py2exe and converted the code to an exe and tried that (rather than the script just to make a fair comparison). It died again on unicode filenames  . I did use the new version too this time! Traceback (most recent call last): File "makeTreeZip.py", line 61, in <module> mtime=time.localtime(os.stat(f).st_mtime) WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'J:\\Share\\Categorized Appz\\Compression Utilities\\Just Extractor\\??-readme.txt'
Can someone help with this problem? It seems like the filenames which contain unrecognizable characters are converted to ?? and then we we use them again it crashes... how do we retain the filenames in the original format? regardless of whether it contains Legible/illegible unicode? After this i tried running the script directly and it seemed to work but then I encountered another mysterious error Traceback (most recent call last): File "makeTreeZip.py", line 63, in <module> mtime=time.localtime(os.stat(f).st_mtime) ValueError: (22, 'Invalid argument') I tried debugging this the value for st_mtime was 1189361328.0 i converted that using time.localtime() and it worked, so i can't figure out exactly what is causing this error. Actually the file in question have a modified date of Tuesday, September 25, 3427, 10:40:30 PM so i can see how python would choke on that. how can i resolve this issue?
|
|
|
|
|
20
|
Main Area and Open Discussion / Living Room / Re: Desktop Icons
|
on: March 08, 2010, 11:55:03 PM
|
some autohotkey code i use for this functionality [ copy or print] ;function to return toggled values ;first call returns true toggle() { static t t := !t Return, t } EnableDisableDesktopIcons() { ;relies on having DetectHiddenWindows OFF if toggle() WinShow,Program Manager Else WinHide,Program Manager } #`::EnableDisableDesktopIcons() ;;Enable/disable desktop icons (shortcut key Win+`) Doesn't work with fences installed though, but you can then use fences, ESC key to toggle it.
|
|
|
|
|
21
|
Main Area and Open Discussion / General Software Discussion / Re: virtual display utility
|
on: March 08, 2010, 11:48:10 PM
|
|
How about setting a resolution higher than what is allowed?
Sometimes this is what happens: You see only a part of the screen (i.e. your native resolution) but if you move your mouse in any direction, the screen scrolls and shows that part... and voila your screen acts like a window for a larger screen!
This is happened to me when playing games ...etc and the switch back to the desktop was not made correctly, i don't know if it's possible to induce this behavior!
|
|
|
|
|
24
|
Other Software / Developer's Corner / Re: Python Language Annoyances
|
on: February 09, 2010, 10:06:22 PM
|
I think the issue is like one poster said meta-programming. Like the list below, moving up you move to a higher level of abstraction and higher level of programming. So some of your gripes about hiding details, old syntax ...etc is necessary. The higher you go the less you care about the implementation in the layers below. English/Ideas/Abstract concepts/thought Frameworks/Django/...etc Python/Javascript C++ C Assembly
I frankly can't wait until we get to the ' just express an idea, and poof program done' stage  . What debuggers/compilers/run-time checking do is give feedback on your ideas, about feasibility, errors ...etc, which is what they should continue doing. I'd rather have computers working harder, than people, as resource wise people are more expensive  some other valid comparisons were, newbie to programming's introduction to python experience is different, compared to an experienced programmer learning it. Anyway I just learn python from diveintopython a couple of weeks ago, and since then i've used it to solve a couple of puzzles, and I had fun... The old style program was like this: [ copy or print] ##def hours12(): ## #using loops ## li = [] ## for h in range(1,13): ## for m in range(60): ## li.append('%02d%02d' %(h, m)) ## return li ## ##def hours12_b(): # this version is faster ## #using list comprehension ## return ['%02d%02d' %(h, m) for h in range(1,13) for m in range(60)] ## ##def duplicates(li): ## li2 = [] ## for t in li: ## dup = 0 ## old_d = t[0] ## for d in t[1:]: ## if d == old_d: ## dup += 1 ## elif 0 < dup < 2: ## dup = 0 #reset duplicate count if non consecutive duplicates found ## old_d = d ## ## if dup >= 2: ## # print t, dup ## li2.append(t) ## #print len(li2) ## return li2 ## ##import re ##repattern = re.compile(r'(\d)\1{2}') ## ##def duplicates_b(li): ## li2 = [] ## # print 'testing regular expressions for matching duplicates' ## for el in li: ## result = repattern.search(el) ## if result: ## li2.append(el) ## # print result.group() ## #print len(li2) ## return li2 ## ##def duplicates_c(li): #this version is fastest ## li2 = filter(repattern.search, li) ## #print len(li2) ## #return [x.group() for x in li2] ## return li2 ## ##import timeit ##li = hours12_b() ## ##ta = timeit.Timer('digits_in_clock.duplicates(digits_in_clock.li)','import digits_in_clock') ##tb = timeit.Timer('digits_in_clock.duplicates_b(digits_in_clock.li)','import digits_in_clock') ##tc = timeit.Timer('digits_in_clock.duplicates_c(digits_in_clock.li)','import digits_in_clock') ##print 'a dup method', ta.repeat(1,1000) ##print 'b dup method', tb.repeat(1,1000) ##print 'c dup method', tc.repeat(1,1000) ####li2 = duplicates(li) ####print li2 ####li2 = duplicates_b(li) ####print li2 and the python way in the end was like this  [ copy or print] import re repattern = re.compile(r'(\d)\1{2}')#find a number followed by 2 consecutive duplicates # the \1 is for first number that we match li = ['%02d%02d' %(h, m) for h in range(1,13) for m in range(60)] li2 = filter(repattern.search, li) print li2 print len(li2) Frankly I like the list comprehension idea, and how intuitive and simple python makes it.
|
|
|
|
|