Re: [O] insert picture feature request.

2011-05-25 Thread Stinky Wizzleteet

Hi All,


I've looked into this as well and I found the following:

On X the import function from imagemagick is very versatile. It can 
capoture the entire screen, or a rectangle on the screen selected by the 
user, it is possible to retain that rectangle for subsequent grabs in 
the session by catching the verbose output of the import command.


On windows however, the import command exists in the imagemagick windows 
binaries, but it only grabs X sessions, not an MSwin screen, therefor it 
is useless.
But, among all the screengrabutils for window out there I found 
something that could be of interest here, the Python PIL package allows 
for screengrabs *and* for clipboard dumping:


## start python src
import os
import sys
import time
import Image
import ImageGrab
def ensure_dir(f):
d = os.path.dirname(f)
if not os.path.exists(d):
os.makedirs(d)
#-
#User Settings:
SaveDirectory=r'c:/Screengrabs'
#taking a screenshot is as simple as:
#img=ImageGrab.grab()

im= ImageGrab.grabclipboard()
savename='ScreenShot_'+time.strftime(%y%m%d_%H_%M_%S)+'.png'
saveas=os.path.join(SaveDirectory,savename)
print saveas: %s %saveas
ensure_dir(saveas)
if isinstance(im, Image.Image):
im.save(saveas)
print image saved to %s% (saveas)
else:
print not image in clipboard

## end python src

This could be extended to be multiplatform, as I understand that PIL's 
imagegrab does not work on X11 (at least it does not on my n900)


My 2 cents here..

wzzl.
On 7-5-2011 23:33, Mark S. wrote:

This is very close ... I think. The problem is that the file name needs to be 
formatted for Windows. Currently its formatted  using unix style forward 
slashes. The file name that is passed to irfan in the call process needs to be 
formatted with Windows style backslashes. Without this fix, irfan will complain 
that it doesn't recognize the file type. In other languages I could figure out 
how to do the replace sequence, but it would take me awhile in lisp. Is there a 
quick fix?

Thanks!
Mark

--- On Wed, 5/4/11, Russell Adamsrlad...@adamsinfoserv.com  wrote:


From: Russell Adamsrlad...@adamsinfoserv.com
Subject: Re: [O] insert picture feature request.
To: Rainer Stengelerainer.steng...@diplan.de
Date: Wednesday, May 4, 2011, 6:19 AM
On Wed, May 04, 2011 at 12:01:53PM
+0200, Rainer Stengele wrote:


i_view32.exe /capture=2

/convert=c:\capture_$U(%d%m%Y_%H%M%S).jpg

(defun org-screenshot ()
   Take a screenshot into a time stamped
unique-named file in the same directory
as
the org-buffer and insert a link to this
file.
   (interactive)
   (setq filename
 (concat
  (make-temp-name
   (concat
(buffer-file-name)

   _

   (format-time-string

%Y%m%d_%H%M%S_)) ) .png))
   (call-process i_view32.exe nil nil nil

/capture=2 (concat /convert= filename) )
   (insert (concat [[ filename ]]))
   (org-display-inline-images))

Does that work? Elisp is formatting the filename based on
the Org
buffer you're in and adding a timestamp.

--
Russell Adams
 rlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3
http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F
66E8 1154 E018 1160 DCB3











[O] capture template: help w table-line target.

2011-04-24 Thread Stinky Wizzleteet

Hi all,

Christopher Allan Webber was so gracious to share his personal org setup
for dieting, now I'm adapting his org-remember-template:


(setq org-capture-templates
  '((w weigh-in entry
 (file+headline ~/.org/Diet.org diet)
 
* CAL-IN Diet for day %t 
%^{Weight}p
| Food / Exercise | Calories | Quantity | Total |
|-+--+--+---|
| %^{Food}   |%^{Calories} |%^{Quantity} | |
|-+--+--+---|
| Total   |  |  |   |
#+TBLFM: $4=$2*$3::$LR4=vsum(@2$4..@-I$4)
)))

This works allright, this capture template is used once every day to
start the table (christopher: how does one do a CAL-OUT ?)
It creates a headline for every day with the table.
During the day the org file needs to stay opened so one can fill the
table with food/exercise items.
Now, I understand org-capture has more functionality than org-remember,
like a capture template that adds a line to a table, totally apt for
this situation:

(f food or exercise table-line
(file+headline ~/.org/Diet.org diet)
| %^{Food}   |%^{Calories} |%^{Quantity} | |
:table-line-pos II-1 )

But I' having trouble getting the target right.
This works like a charm on an org file that just has a table, but I need
to figure out a way how to grab the last table (or better even, *todays*
table, if not there, will create one, but I guess this is for future)
Can anyone point me in the right direction on how to add a table line to
the last table in an org file. Or the table in the last child of
headline diet ?

help a noob out,plz.

tips are greatly appreciated,

thx wzzl

-- 
Stinky Wizzleteet thinks: 
You will have a long and unpleasant discussion with your supervisor.




Re: [O] particular capture method for a diet .. ?

2011-04-23 Thread Stinky Wizzleteet
Christopher Allan Webber cweb...@dustycloud.org writes:

Wow, really, that's awesome and inspring.
Congratulations !

I think the hacker's diet is the most useful thing to come out of autodesk.
The first time I lost some serious weight was when I followed the
hacker's diet in 2001, I used his palm III app for that.
I've gained weight since the birth of my son and the start of my company
and I want to curb it before it gets out of hand.
I cap the caloric deficit at a 500 kcal deficit per day, because for me 
and my genetic background of overweight family this is probably
not a diet but a lifestyle and I understood that at higher deficits ones
metabolism is trying to adapt, trying to defeat the dieting
purpose. (citation needed) -I cannot provide proof nor reference to this 
statement-  

Your approach is *exactly* what I was meaning to eventually throw together.
I would love to take a look at your code, as a total noob I may be able
to hack a workable system for myself -eventually, but help maintaining will be
possible only on the long term. Once I've mastered lisp and org.

However, as I am not the only one interested in your system you might
want to consider dumping it loosely unorganized on github. but mailing
us a tar package would be cool too.


thx !
wzzl



 So I've been meaning to put something up on this in worg for a while.

 I've been dieting using orgmode, basic calorie tracking, and something
 resembling the ideas out of The Hacker's Diet for the last year
 (actually 2.5 years with a 1.5 year break in which I continued to
 weigh in mostly but didn't follow my calorie goals ;)) and have lost 
 60 pounds so far (originally was 275, not all that's recorded in my
 files during the first few weeks of dieting, anyway at 210 now), going
 from morbidly obese to just overweight, and I'm still losing weight
 (soon enough, being a fat guy will be far behind me).  Here's the
 org-babel generated gnuplot graphs to show it (regenerated and pushed to
 my site every morning):

 http://dustycloud.org/tmp/weight.png
 http://dustycloud.org/tmp/weight_month.png

 Here's a screenshot:
 http://dustycloud.org/tmp/org-diet2.png

 Roughly in the terrible amount of hacks that compose org-diet I've
 wrapped together these ideas/tools:
  - calorie tracking
  - recipe calorie calculation
  - weigh-in via org-capture
  - calorie clocking (clock out at the end of the day to verify you've
got accurate numbers for that day)
  - habit tracking of whether you've met your calorie goals
  - weight graphing with 10 day moving averaging to remove some of the
noise from a daily weigh in/out
  - bmi calculation
  - a really shitty calories-per-day-to-lose-to-meet-your-goals estimator

 It's really nothing complex, and mostly it's not software, just a
 methedology with a *slight* amount of poorly written software in elisp
 and org-babel, but the system works great.

 I planned after meeting my diet goals (hitting normal weight) that I'd
 release the whole thing (including my present diet file for reference)
 under GPLv3, document it in worg, and put my own diet file out there
 under CC0, but maybe I should do it sooner... problem is I don't have
 time presently while trying to work on http://mediagoblin.org on
 weekends to make a proper release, but I could at least bundle
 together everything you need to have a full system using my hacks for
 now if you want, with really terrible but usable documentation, without
 taking up too much time. :)

 Interested?  I could probably throw together a terrible tarball this
 weekend if you want to use it and post it to the list.

 One thing that's clear from the diet I've collected: whenever I've
 followed the system, without fail, I've lost weight.  When I've deviated
 I've stayed level or I've gained weight (the no-movement middle of the
 diet graph I linked to).  Follow the system, use habit tracking and
 stuff, stick to your calorie goals (I shoot for a lower occasional-goal
 of 1300 calories and an absolute minimum goal of 1600 calories), and it
 *fucking works* without any support of the bullshit diet industry.

 I've heard a few people saying they have interest in the stuff I have so
 maybe I should just do that crappy release for now; better than nothing?

 Hopefully being useful while making embarassing admissions about my
 body,
  - cwebb

 Stinky Wizzleteet wizzlet...@hotmail.com writes:

 Hi all,

 I am too fat.

 And I found in the past that the best way for me to loose weight is to
 log my eating habit every day and make sure that I eat between 1800 and
 2200 kcal/day, no more, but also not less.

 I want to figure out a way how to create a custom capture template to
 keep track of my daily intake.

 The result should be a diary-style org file were every day would be
 filled with a table that features an updated total and an item list:

 TOTAL:  1965 kcal
 |apple  |   80|
 |orange |   65|
 |energy drink   |   300|
 ... etc
 
 (gnus

[O] editing org-export-latex-default-packages-alist has no effect

2011-04-23 Thread Stinky Wizzleteet
Hi all,

thanks to help on this list I found out about this variable as I need to
omit the textcomp and fontenc packages in my exported latex header.
My tex file won't compile otherwise on my n900.

my init.el contains :

(custom-set-variables

  '(org-export-latex-default-packages-alist (quote ((AUTO inputenc t) (T1 
fontenc nil) ( fixltx2e nil) ( graphicx t) ( longtable nil) ( 
float nil) ( wrapfig nil) ( soul t) ( textcomp nil) ( 
marvosym t) ( wasysym t) ( latexsym t) ( amssymb t) ( 
hyperref nil) \\tolerance=1000)))

)

However, fontenc and textcomp are still in the org-generated tex file.
bug, or feature ?

best,
wzzl 
-- 
Stinky Wizzleteet thinks: 
You are standing on my toes.




Re: [O] particular capture method for a diet .. ?

2011-04-23 Thread Stinky Wizzleteet
Christopher Allan Webber cweb...@dustycloud.org writes:

 Stinky Wizzleteet wizzlet...@hotmail.com writes:

-snip-

 I think if you're at approximately 45% of your metabolism or more for
 your daily caloric needs, it'll be fine.  I wouldn't recommend anyone
 going lower than 1200 calories per day though.

 Anyway, I'm at 1300-1600 calories / day now, it's not quite as super
 fast of weight loss (about 7 pounds / month, still not bad!), but still
 quite a bit of weight loss.  I think if you have a lot of weight to lose
 you probably don't need to worry about it too much.

 Also note that I barely exercised at all during my diet... when I did
 exercise, I lost weight a little bit faster, but I simply don't believe
 it's necessary for weight loss.  If you want to do it, great, but it's
 simply easier to figure out how to eat the right amount of foods to feel
 satisfied while having a serious calorie deficit.

OK, I'll remember this.
I *should* exercise though, but that is definitely not for weightloss,
more for stress management and keeping the rsi at bay.



-snip-

 https://gitorious.org/org-diet/org-diet

 I've gone and done it.  I haven't finished writing README.org but I've
 added a base org-diet file to start with, the capture template in the
 orgmode file, etc.

Hey cool !
checked out already. will use it asap.

 I've even checked in my whole embarassing diet.org file for you to see.
 You'll notice that a few months into the thing I became a vegetarian,
 but that was for ethical, not dietary reasons. :)

me vega too, welcome !

 Once I am completely not a fat guy, I will upload the final diet.org.

 As for how to find out how many calories things are I usually took three
 approaches:

  - I used the program Food File, to which I made a couple of patches to
make it run on GNU/Linux... I guess I should make those available
soon.  It *was* released as free software under the GPL, not sure if
the version online is still released as such.
  - Reading the back of packages
  - Looking at pre-existing data in my orgmode file.  Usually I'd split
the file vertically and in one pane have my current daily diet table
at point, in the other I'd be isearching for things I've already
eaten... usually while dieting I tend to eat the same types of things
a lot, but I've collected a vast amount of caloric information in
there... maybe you can find how to eat a satisfying daily amount of
calories by looking at some of my example days with successful
CAL-OUT clocking
  - I just googled for things I didn't know.

 Hope this is helpful to people!  I'll add more docs later.

 (PS: the elisp is hacky, don't say I didn't warn you.)
Myself, I created a little list with most of my regular foods,
googled/backs of packcages and such and I kept them as a kcal/gram list.
I also maintained a list of my usual servings, measured the mugs and
cups I regularly used, some with a counter intuitive result.

I'm sure these two lists could be maintained in an org or even a bbdb,
But many pains must be suffered for this functionality and I found that my
personal lists never exceeded more than 50 items. Hardly database
material, so not a priority for my case.

thanks, wzzl
 
-- 
Stinky Wizzleteet thinks: 
What happened last night can happen again.




Re: [O] editing org-export-latex-default-packages-alist has no effect

2011-04-23 Thread Stinky Wizzleteet
Aankhen aank...@gmail.com writes:

 Hi Stinky,

 On Sat, Apr 23, 2011 at 12:54, Stinky Wizzleteet wizzlet...@hotmail.com 
 wrote:
 thanks to help on this list I found out about this variable as I need to
 omit the textcomp and fontenc packages in my exported latex header.
 My tex file won't compile otherwise on my n900.

 my init.el contains :

 (custom-set-variables

  '(org-export-latex-default-packages-alist (quote ((AUTO
 inputenc t) (T1 fontenc nil) ( fixltx2e nil) (
 graphicx t) ( longtable nil) ( float nil) ( wrapfig
 nil) ( soul t) ( textcomp nil) ( marvosym t) (
 wasysym t) ( latexsym t) ( amssymb t) ( hyperref nil)
 \\tolerance=1000)))

 )

 However, fontenc and textcomp are still in the org-generated tex file.
 bug, or feature ?

 That line you pasted contains both packages.  Maybe you forgot to set
 it after customising it or some such thing?

I figured that textcomp nil meant that textcomp was turned off..
I'll try to erase the entry alltogether.

wzzl


 Aankhen



-- 
Stinky Wizzleteet thinks: 
Try the Moo Shu Pork.  It is especially good today.




Re: [O] editing org-export-latex-default-packages-alist has no effect

2011-04-23 Thread Stinky Wizzleteet
Stinky Wizzleteet wizzlet...@hotmail.com writes:

 Aankhen aank...@gmail.com writes:
-snip-
 However, fontenc and textcomp are still in the org-generated tex file.
 bug, or feature ?

 That line you pasted contains both packages.  Maybe you forgot to set
 it after customising it or some such thing?

 I figured that textcomp nil meant that textcomp was turned off..
 I'll try to erase the entry alltogether.

Yes, I have confirmed now that I need to erase these items from the list
in order for them to not show up in the header.
The customize-variable system toggled the entries from t to nil,
which apparently was not enough.
I think this is a bug.

But now, for me, it works.

thx.

-- 
Stinky Wizzleteet thinks: 
You'll never be the man your mother was!




[O] particular capture method for a diet .. ?

2011-04-22 Thread Stinky Wizzleteet
Hi all,

I am too fat.

And I found in the past that the best way for me to loose weight is to
log my eating habit every day and make sure that I eat between 1800 and
2200 kcal/day, no more, but also not less.

I want to figure out a way how to create a custom capture template to
keep track of my daily intake.

The result should be a diary-style org file were every day would be
filled with a table that features an updated total and an item list:

TOTAL:  1965 kcal
|apple  |   80|
|orange |   65|
|energy drink   |   300|
... etc

(gnus: y u no tables ?)   

capturing would consist of two entries, item and specific caloric
value, and these values would be inserted into a table that would
automagically update its daily total.
Every day a new table should be started.

Is this possible ? And how ?
Pointers, tips and snippets are greatly appreciated.

Best,
wzzl

-- 
Stinky Wizzleteet thinks: 
Next Friday will not be your lucky day.  As a matter of fact, you don't
have a lucky day this year.




[O] where to edit latex default added packages ?

2011-04-22 Thread Stinky Wizzleteet
Hi all,

I run emacs and latex on my nokia n900, but latex does not ome with a
full complement of packages.
I am looking to make the latex (esp. beamer) export from orgmode a
little more barebone.

Where/how do I tweak the packages that are added to the exported TeX
header ?

thanks,

wzzl  

-- 
Stinky Wizzleteet thinks: 
Be free and open and breezy!  Enjoy!  Things won't get any better so
get used to it.




[Orgmode] Re: including images for tex export, how?

2010-11-20 Thread Stinky Wizzleteet
Thomas S. Dye t...@tsdye.com writes:
Thanks all, the no description bit did the trick.

grtz wzzl


 Aloha wzzl,


 What did your link look like?  Org-mode will export links with descriptions 
 as links, but links without
 descriptions wrapped in an includegraphics environment:

 http://orgmode.org/manual/Images-in-LaTeX-export.html#Images-in-LaTeX-export



 All the best,

 Tom





 On Nov 17, 2010, at 11:54 AM, Stinky Wizzleteet wrote:

   
 Hi,  
   I've tried adding a link to a picture so it would 
 show up
   in the tex  export. 
  It
   doesn't get exported as an \includegraphics sort 
 of
   deal, but as a  hyperlink.  
 Where,
   how can I fix this ?  
   thanks,  wzzl   

   --  Stinky Wizzleteet 
 thinks:  Do
   not sleep in a eucalyptus tree tonight. 
  
   
   ___ 
  Emacs-orgmode
   mailing list  Please use 
 `Reply
   All' to send replies to the list.   
Emacs-orgmode@gnu.org  
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode  




 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

-- 
Stinky Wizzleteet thinks: 
Never look up when dragons fly overhead.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] including images for tex export, how?

2010-11-18 Thread Stinky Wizzleteet
Hi,

I've tried adding a link to a picture so it would show up in the tex
export.
It doesn't get exported as an \includegraphics sort of deal, but as a
hyperlink.
Where, how can I fix this ?

thanks,
wzzl

-- 
Stinky Wizzleteet thinks: 
Do not sleep in a eucalyptus tree tonight.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode