Sunday, March 31, 2013

Re: The request has been black-holed



On Thursday, March 28, 2013 4:57:38 PM UTC+7, b...@articad.cc wrote:
Security features like this that cause issues with basic flow, should be OFF by default. CakePHP is it's own worst enemy for leaving it in.


Why do you think CakePHP turns SecurityComponent on by default?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Hey! I'm recieving an index error when trying to import models, and I can't figure out why.

Hello,

I am incredibly new to Django, as-of-today new, so forgive me if I've missed something really obvious.

I've been going through the tutorial and did so mostly-successfully and decided to redo it with my own code.

Everything was going fine until I decided that it would be a good idea to type from models.py import UUID, Students into the shell. With this I received the following error:

/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/django/db/models/base.pyc in __new__(cls, name, bases, attrs)
     90             # For 'django.contrib.sites.models', this would be 'sites'.

     91             model_module = sys.modules[new_class.__module__]
---> 92             kwargs = {"app_label": model_module.__name__.split('.')[-2]}
     93         else:
     94             kwargs = {}

IndexError: list index out of range

I went onto stackoverflow and found some people had similar issues a year ago, and suggested that a person delete the pyc files, which I did. It was also suggested that you make DEBUGGING = False, or True or whatever is opposite. I did this, too, only to find the same error.

I did some other things too, all to no avail... all the same error. I even checked to make sure I was saving edited files, TWICE. Still, same error.

With this, I ask for your help o' wise ones.

Thanks.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

How can I keep a user logged in longer?

Right now users get logged out on a daily basis. I am using the table cake_sessions to store user sessions. How can I increase the logout time to say a month or so?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[android-developers] Re: Why is App not compatible with Tablets after update

There has been an odd post or two in the adt-dev group regarding the ordering of elements in the manifest (although I can't find anything in the official docs).

So with that said ... I think you should try putting
    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8" />
before the <application> node.

I see that someone has already mentioned the <supports-screens> element on SO.

On Monday, April 1, 2013 3:15:05 AM UTC+1, miketra wrote:
My app has been successfully downloaded by tablet users over the last year without problems. I made an update a week ago, but the only thing changed in the Manifest file was the app version number and version string. After making that update, users are no longer able to access the app in Google Play. I have an Asus Transformer tablet. I am able to load the app onto my tablet with no problem. On the tablet, the app won't even appear in Google Play unless I search for it on the internet, then link directly to the app in Google Play. When I do this, Google Play says "your device isn't compatible with this version" even though I loaded the app directly onto the tablet myself. Note that in the Android Developer Console, it says that 2600+ devices are compatible, and it says 0 devices are excluded. I looked at the individual list of devices, and my tablet is listed there as being compatible. What's the problem, and how do I fix it? To see the Manifest file, go here: http://stackoverflow.com/questions/15733070/why-is-app-not-compatible-with-tablets-after-update

Thanks,

-Michael

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[android-developers] Why is App not compatible with Tablets after update

My app has been successfully downloaded by tablet users over the last year without problems. I made an update a week ago, but the only thing changed in the Manifest file was the app version number and version string. After making that update, users are no longer able to access the app in Google Play. I have an Asus Transformer tablet. I am able to load the app onto my tablet with no problem. On the tablet, the app won't even appear in Google Play unless I search for it on the internet, then link directly to the app in Google Play. When I do this, Google Play says "your device isn't compatible with this version" even though I loaded the app directly onto the tablet myself. Note that in the Android Developer Console, it says that 2600+ devices are compatible, and it says 0 devices are excluded. I looked at the individual list of devices, and my tablet is listed there as being compatible. What's the problem, and how do I fix it? To see the Manifest file, go here: http://stackoverflow.com/questions/15733070/why-is-app-not-compatible-with-tablets-after-update

Thanks,

-Michael

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: how do I specify optional params in url?

Ok, I understand and will try and provide more detail in the future.

Thanks again

On Sunday, March 31, 2013 5:28:54 PM UTC-4, Alexis Roda wrote:
Al 31/03/13 22:43, En/na frocco ha escrit:
> Thank you for taking the time to help me.

You're welcome.

One last thing. I'm not a native english speaker, so if I sound rude
it's not my intention. That said ...

When you ask for help in the list try to include more information: the
error message, explain what you're doing, what input do you provide,
what result do you expect and what result do you get, provide some
sample code etc.

Try to be clear and concise .. but not as concise as "this does not work" ;)

Also, when replying to a message keep some of the relevant context. That
will help the reader in knowing what has been done so far.


In short: help us to help you.



Regards

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[android-developers] Re: Activity won't start when launchmode is standard



On Friday, March 29, 2013 7:06:59 PM UTC-4, Streets Of Boston wrote:

   Log.e("Commands", "failed to start DGraphActivity", e);

OK, I've added that although, since it's not hitting that (or any) exceptions it's not really telling me anything.

So we're still kinda back on the original question - if an activity fails to start is there anyway of finding out why?  

 

 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[Google Maps API v2] Can I convert a String like ("latitude,longitude") into a LatLng object?

I've been looking a lot for it, but I still couldn't do that successfully. I discovered how to do the reverse process with LatLng method String toString(), but how do I do the opposite?

Thanks a lot!!

--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

3akarat.com - إيجار محل بالشيخ زايد.

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - الحى الأول - المجاورة الأولى - شارع سنترال الشيخ زايد (1).

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

Re: Replacing classes during custom serialization

As a second question, is there any document anywhere which describes
how custom serializers actually work? The tiny section in
DevGuideServerCommunication is not helpful. Some basic questions:

* Are custom serializers server-side only? Or do they get executed on
the client-side too?

* What's the relationship between the static methods and the instance
methods? I presume we have both for some sort of historical reason,
but can we get rid of the static methods? (last time I tried it didn't
work)

Jeff

On Sun, Mar 31, 2013 at 4:49 PM, Jeff Schnitzer <jeff@infohazard.org> wrote:
> When doing custom serialization, is it possible to swap out one class
> for another?
>
> This would fix a _lot_ of problems using Objectify's Ref<?> and Key<?>
> client-side, including, I think, being able to instantiate Refs and
> Keys intelligently.
>
> But I have an immediate problem I'm trying to fix - which is that
> Ref<?> is a class hierarchy on the server side, but I'd really like to
> simplify this to a single concrete Ref class client-side. So even
> though the sever might return StdRef<?> or NullRef<?>, these should be
> converted to a simplified, concrete Ref<?> on the client side.
>
> Is this possible? It would be even better if I could somehow just
> define one custom serializer that handles all Ref subclasses instead
> of having to make separate custom serializers for each.
>
> Thanks in advance,
> Jeff

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Replacing classes during custom serialization

When doing custom serialization, is it possible to swap out one class
for another?

This would fix a _lot_ of problems using Objectify's Ref<?> and Key<?>
client-side, including, I think, being able to instantiate Refs and
Keys intelligently.

But I have an immediate problem I'm trying to fix - which is that
Ref<?> is a class hierarchy on the server side, but I'd really like to
simplify this to a single concrete Ref class client-side. So even
though the sever might return StdRef<?> or NullRef<?>, these should be
converted to a simplified, concrete Ref<?> on the client side.

Is this possible? It would be even better if I could somehow just
define one custom serializer that handles all Ref subclasses instead
of having to make separate custom serializers for each.

Thanks in advance,
Jeff

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Re: how do I specify optional params in url?

Al 31/03/13 21:55, En/na frocco ha escrit:
> I am kinda lost with url encoding being a newbie in django.
>
> I do not see my error.
>
> Can you give me an example?

Here it is:

views.py:

def my_view(request, foo, bar="spam"):
pass

urls.py

# choose descriptive names for the views
...
url(r"^narrow/(\d+)/$", views.my_view, name="narrow1"),
url(r"^narrow/(\d+)/(\w+)/$", views.my_view, name="narrow2"),
...

in python code (views etc.):

reverse("narrow1", args=(23, )) -> ".../narrow/23/"
reverse("narrow2", args=(23, "foo")) -> ".../narrow/23/foo"

in templates:

{% url "narrow1" 23 %} -> ".../narrow/23/"
{% url "narrow2" 23 "foo" %} -> ".../narrow/23/foo/"

Important: if you're using django < 1.5 you should remove the quotes
around the view name in the url tag.




HTH

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Re: how do I specify optional params in url?

I am kinda lost with url encoding being a newbie in django.
I do not see my error.

 Can you give me an example?

Thanks 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

3akarat.com -

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - فرصه كبيررررو 230 م بمدينه نصر هاي دي لوكس

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

[Rails] Re: How call Render XML in command line?

i add curl --silent http://localhost:3000/products/3/who_bought -H
"Accept: application/xml"

show error: <h1>
NoMethodError
in ProductsController#who_bought
</h1>
<pre>undefined method `order&#x27; for #&lt;Product:0xb6196084&gt;</pre>


<p><code>Rails.root: /home/dima/RubyOnRails/Projects/depot</code></p>

its my product.rb:

class Product < ActiveRecord::Base
has_many :line_items, dependent: :destroy
has_many :orders, through: :line_items

before_destroy :ensure_not_referenced_by_any_line_item

attr_accessible :title, :description, :image_url, :price

validates :title, :description, :image_url, :price, :presence => true
validates :price, numericality: {greater_than_or_equal_to: 0.01}
validates :title, uniqueness: true
# validates :image_url, allow_blank: true, format: {
# with: %r{ \.(gif|jpg|png)$}i,
# message: 'gif, jpg png. '
#}
#validates :image_url, :uniqueness => false

def ensure_not_referenced_by_any_line_item
if line_items.empty?
return true
else
errors.add(:base, " have products line")
return false
end
end

end

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: how do I specify optional params in url?

Al 31/03/13 19:00, En/na frocco ha escrit:
> Hello,
>
> Here is my current url.
>
> url(r'^narrow_category/(\d+)/(\w*)/(\d*)/(\d*)/(\d*)/$',
> 'catalog.views.narrow_category', name="narrow_category"),
>
> d+ is required
> w* can be optional
> last three d* can be optional
>
> This setting is not working.

You should be a bit more explicit about what "is not working" means.

I presume that you expect that an URL like "narrow_category/23" should
be matched against your url definition. No, it won't, since the slashes
are not optional. All those will match against your regular expression:

narrow_category/23/////
narrow_category/23/foo////
narrow_category/23/45////
narrow_category/23///23//

I think that the cleanest solution is defining a set of urls and,
somehow, provide default values for the missing parts:

def my_view(request, foo, bar="spam", baz=1234):
pass

url(r"^narrow/(\d+)/$", views.my_view, ...)
url(r"^narrow/(\d+)/(\w+)/$", views.my_view, ...)
url(r"^narrow/(\d+)/(\w+)/(\d+)/$", views.my_view, ...)

Note that the parts are no longer optional (+ instead of *).

It works like this:

/narrow/23/
matches the 1st rule
django calls: my_view(request, "23")
the view gets the arguments: foo="23", bar="spam", baz=1234

/narrow/23/baz/
2nd rule
my_view(request, "23", "baz")
foo="23", bar="baz", baz=1234

/narrow/23/baz/45/
3rd rule
my_view(request, "23", "baz", "45")
foo="23", bar="baz", baz="45"

/narrow/23/45/
2nd rule
my_view(request, "23", "45")
foo="23", bar="45", baz=1234


HTH

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

3akarat.com - قطعة الارض اللى محتاجها وفرنهالك عشان مشروعك اللى بتحلم بيه

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

Re: How do I get these field values in my template?

Thank you

On Sunday, March 31, 2013 10:17:35 AM UTC-4, Alexis Roda wrote:
Al 31/03/13 15:18, En/na frocco ha escrit:
> cat = Product.objects.values_list('category__image_path','category__id')
>
> outputs;
> (u'category/goodyear logo.jpg', 13)
>
> I tried for c in cat:
> c.image_path
> c.id

As its name may suggest values_lists() returns (kind) a list of lists,
so you must index by position, not by field name:

for c in cat:
     print c[0], c[1]

{% for c in cat %}
    <p>{{ c.0 }} {{c.1}}</p>
{% endfor %}

If you want to index by field name you should use values(), which
returns a list of dictionaries mapping "field name" to "value".



HTH

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: [android-developers] Re: GC calls from other processes causing slowdown (?)

The frame drop looks huge as since Gingerbread the GC is clamied to work concurrently.


On Sun, Mar 31, 2013 at 4:38 PM, Jason Polites <jason.polites@gmail.com> wrote:

I'm 90% sure it wasn't, but I make this claim based on profiling heap allocations and I don't think I confirmed that the process ID was actually different. I'll confirm (or otherwise) this and post back.

On Mar 31, 2013 2:52 AM, "RichardC" <richard.critten@googlemail.com> wrote:
Is/was 2590 your process?

On Sunday, March 31, 2013 8:07:50 AM UTC+1, Jason wrote:
Hey folks,

So I'm in the midst of creating a game and I'm hitting some occasional slow down which "seems" to be a result of GC calls triggered by other processes on the device.  I have profiled my app and am 100% certain there are no allocations going on while the game is running, but in certain circumstances (i.e. most of the time) logcat is spewing out GC_CONCURRENT freed...blah blah entries.  Here's a typical output from the console:

03-30 23:58:58.868: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8758K/9224K, paused 5ms+3ms, total 29ms
03-30 23:59:05.970: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 408K, 6% free 8757K/9228K, paused 4ms+2ms, total 30ms
03-30 23:59:13.063: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9224K, paused 4ms+4ms, total 33ms
03-30 23:59:20.142: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9228K, paused 5ms+3ms, total 30ms
03-30 23:59:27.227: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9224K, paused 6ms+2ms, total 31ms
03-30 23:59:34.306: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9232K, paused 4ms+2ms, total 23ms
03-30 23:59:41.392: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9224K, paused 4ms+2ms, total 27ms
03-30 23:59:48.470: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9232K, paused 5ms+2ms, total 30ms

Now I have no idea which processes are to blame, but I did notice that when "other" events on the device occur it can lead to a spike in (I assume) CPU usage which causes a visible drop in frame rate in the game.

For example my wifi connection dropped out one time and the logs went crazy with other processes complaining about a lost connection and trying desperately to tell me about it.  This caused a fairly severe jolt in the game dropping the frame rate from 60fps to around 20fps for about a minute while everything settled down and got on with things.

I had noted on a previous thread a statement from Dianne Hackborn:

"as of 1.6 such GCs in a background process can not together take more than ~10% of the CPU from any foreground process that wants to run."

This sounds good, but I'm wondering if this is still the case as of 4.2.2?  I am seeing behavior that appears to indicate this may not the case.

Is there anything I can do to ensure other processes are not using more than 10% of CPU (or any number really)?  Or some other restrictions/priorities that might help alleviate this external resource usage?

Thanks,

Jason.

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Android Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-developers/yQVg0WzChko/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Android Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-developers/yQVg0WzChko/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: [Rails] How call Render XML in command line?

On Sun, Mar 31, 2013 at 5:17 AM, Dmitrij B. <lists@ruby-forum.com> wrote:

I want check, how work in xml format. How me call in command line my
format xml? (format.xml { render :xml => @product.to_xml( :include =>
:order ) })

I guess you want to see what's the output in rails console
Just open it and then do

Product.find(SOME_ID).to_xml

then you'll get the info 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

3akarat.com - اغتنم الفرصه الذهبيه قبل انتهاء العرض خلال 72 ساعه

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

Re: How do I get these field values in my template?

Al 31/03/13 15:18, En/na frocco ha escrit:
> cat = Product.objects.values_list('category__image_path','category__id')
>
> outputs;
> (u'category/goodyear logo.jpg', 13)
>
> I tried for c in cat:
> c.image_path
> c.id

As its name may suggest values_lists() returns (kind) a list of lists,
so you must index by position, not by field name:

for c in cat:
print c[0], c[1]

{% for c in cat %}
<p>{{ c.0 }} {{c.1}}</p>
{% endfor %}

If you want to index by field name you should use values(), which
returns a list of dictionaries mapping "field name" to "value".



HTH

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] Optimise drawing speed

I am writing a music notation app for android tablets.
As I draw everything (ie. this is not a "simple" image (jpg, pdf, etc) which needs displaying), I need to ensure that the choice of drawing method is the fastest possible.

My options, as I see them at present, are
  1. Classic on-screen drawing.
  2. Draw on a memory based canvas and bitblt the resulting bitmap onto the screen
Will either option give better rendering time results ?

I have chosen to use classic drawing methods, rather than an OpenGL type surface.
Is this a mistake ?

Any help will be appreciated.
Thank you

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

(GugukluhayaT) Fwd: Ve biz TÜRKÜZ...

--
You received this message because you are subscribed to the Google Groups "Gugukluhayat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gugukluhayat+unsubscribe@googlegroups.com.
To post to this group, send email to gugukluhayat@googlegroups.com.
Visit this group at http://groups.google.com/group/gugukluhayat?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: I get import errors when I run django-admin.py startproject in Windows

What errors, exactly? Without some specifics of what's going wrong it's hard to offer help. Copy/paste of exactly what you are entering and getting in response would help.



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

How do I get these field values in my template?

cat = Product.objects.values_list('category__image_path','category__id')

outputs;
(u'category/goodyear logo.jpg', 13) 

I tried for c in cat:
c.image_path
c.id

Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

3akarat.com - للايجار بالتجمع الخامس شقه بفيلا 220م بالنرجس

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - شقتك بااطلاله علي نادي الصيد - العدد محدود

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - ايجار محل من المالك مباشرة بأحمد عصمت

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - خصومات تصل الى 50000 جنية على شاليهات للبيع فى السخنة وكمان تقسيط 01274986666

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - شقة للايجار بحلوان

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - تعاقد علي المحل واستلم واحنا نأجر بعائد مضمون

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - لفترة محدودة جدااا خصومات على شاليهات بالساحل الشمالى خلال شهر ابريل 01274986666

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

3akarat.com - لفترة محدودة ادفع 25% وقسط الباقى على 6 سنين وامتلك شالية ع البحر بالساحل الشمالى 01274986666

إعلان جديد من عقارات دوت كوم تفاصيل الأعلان : تفاصيل الإعلان . . .

عقارات دوت كوم
----------------------------------------------------------------------------------------

[Rails] Re: Why Did Capybara Move Specs into spec/features?

Here's a post by Jose Valim on the reasoning behind the change:

As a quick summary, Capybara is an acceptance test framework and as such, tests should be written from a browser or user's perspective. With the rspec-rails gem, tests found in spec/requests directory have access to methods that expose lower-level details like requests and responses(methods like get, put, post.) So if Capybara tests are also found in that same spec/requests directory, you are able to use both the Capybara DSL and the free methods that are meant for integration tests which causes a conflict and leads to some developers using a mix of both. This leads to ugly test suites. 

The solution they came up with is to create a separate directory meant for use with Capybara DSL, which is spec/features and another directory (spec/api) meant for use with the Rails provided integration test tools. 

Michael Hartl will be releasing a newer version of his tutorial sometime in the future which will provide more up-to-date material. You might also want to look at RSpec's 'expect' syntax for its assertions. They plan on deprecating the 'should' syntax possibly as early as RSpec 3.0.

On Sunday, March 31, 2013 1:57:30 PM UTC+8, Peter wrote:
Hello Everyone,

I am new to Ruby on Rails. I just finished Michael Hartl's Ruby on Rails Tutorial and I just started on Agile Web Development with Rails, Fourth Edition by Sam Ruby. In trying to build confidence and proficiency, I started building small apps and decided, as I had learned from Michael Hartl, to use capybara and rspec. But when I tried it nothing was working. It turns out, this was the reason:

If you are using Rails, put your Capybara specs in spec/features.
 
And in order to use the tests I had created in spec/requests, I have to do this:

If you are not using Rails, tag all the example groups in which you want to use Capybara with :type => :feature.

Can anyone explain the reasoning behind this? I'm sure there is a good reason for this that my newbie self does not comprehend yet. Thank you in advance.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/kktojwdJDlUJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[Rails] Re: Help with Ruby on Rails

There is a ready to use repository on http://www.opensourcerails.com/selfstarter/ which is really similar to kickstarter.
Given you have a basic understanding of rails this will get you really far. 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Si_qfrfwJ1EJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

I get import errors when I run django-admin.py startproject in Windows

I get import errors when I run django-admin.py startproject for the first time in Windows 7. I installed Django 1.5.1 and I am trying to use that with Python 3.3. Any ideas about how to get past this hurdle? I am new to Django.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

cakephp.org still down?

Any updates as to when it might be back up?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: [Rails] Help with Ruby on Rails

On 29 March 2013 10:45, Anwaar Ansari <anwaaransari09@gmail.com> wrote:
> Hello..
>
> Can anyone help me in make a KIckstarter-like site with Ruby on Rails?
> IF anyone helps me.. I would be really happy..

I presume that you are a beginner with rails. First work right
through a good tutorial such as railstutorial.org, which is free to
use online. That will show you the basics of rails. Also look a the
Rails Guides.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

[android-developers] GC calls from other processes causing slowdown (?)

Hey folks,

So I'm in the midst of creating a game and I'm hitting some occasional slow down which "seems" to be a result of GC calls triggered by other processes on the device.  I have profiled my app and am 100% certain there are no allocations going on while the game is running, but in certain circumstances (i.e. most of the time) logcat is spewing out GC_CONCURRENT freed...blah blah entries.  Here's a typical output from the console:

03-30 23:58:58.868: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8758K/9224K, paused 5ms+3ms, total 29ms
03-30 23:59:05.970: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 408K, 6% free 8757K/9228K, paused 4ms+2ms, total 30ms
03-30 23:59:13.063: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9224K, paused 4ms+4ms, total 33ms
03-30 23:59:20.142: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9228K, paused 5ms+3ms, total 30ms
03-30 23:59:27.227: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9224K, paused 6ms+2ms, total 31ms
03-30 23:59:34.306: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9232K, paused 4ms+2ms, total 23ms
03-30 23:59:41.392: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9224K, paused 4ms+2ms, total 27ms
03-30 23:59:48.470: DEBUG/dalvikvm(2590): GC_CONCURRENT freed 407K, 6% free 8757K/9232K, paused 5ms+2ms, total 30ms

Now I have no idea which processes are to blame, but I did notice that when "other" events on the device occur it can lead to a spike in (I assume) CPU usage which causes a visible drop in frame rate in the game.

For example my wifi connection dropped out one time and the logs went crazy with other processes complaining about a lost connection and trying desperately to tell me about it.  This caused a fairly severe jolt in the game dropping the frame rate from 60fps to around 20fps for about a minute while everything settled down and got on with things.

I had noted on a previous thread a statement from Dianne Hackborn:

"as of 1.6 such GCs in a background process can not together take more than ~10% of the CPU from any foreground process that wants to run."

This sounds good, but I'm wondering if this is still the case as of 4.2.2?  I am seeing behavior that appears to indicate this may not the case.

Is there anything I can do to ensure other processes are not using more than 10% of CPU (or any number really)?  Or some other restrictions/priorities that might help alleviate this external resource usage?

Thanks,

Jason.

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Question about documentauion under Managers>Adding extra Manager methods


Unless I'm mistaken, it's PostgreSQL. The telling feature is the GROUP BY clause - PostgreSQL allows you to group by column index.


Since this is an eccentricity of PostgreSQL, it would be a good idea for us to modify that example in the docs, and use a more conventional GROUP BY statement that would be familiar to all SQL dialects. I've opened ticket #20168 to track this issue.

Yours,
Russ Magee %-)

On Sun, Mar 31, 2013 at 5:49 AM, James Durham <jamesldurham@gmail.com> wrote:
In this instance, what I'm asking is about the documentation.
In other words does anyone recognize the dialect.
It would just help in understanding docs.
Though, thanks for indicating that it is backend dependent.

On Friday, March 29, 2013 8:40:09 PM UTC-5, Russell Keith-Magee wrote:


On Sat, Mar 30, 2013 at 6:20 AM, James Durham <jamesl...@gmail.com> wrote:
In the example:
class PollManager(models.Manager):      def with_counts(self):          from django.db import connection          cursor = connection.cursor()          cursor.execute("""              SELECT p.id, p.question, p.poll_date, COUNT(*)              FROM polls_opinionpoll p, polls_response r              WHERE p.id = r.poll_id              GROUP BY 1, 2, 3              ORDER BY 3 DESC""")          result_list = []          for row in cursor.fetchall():              p = self.model(id=row[0], question=row[1], poll_date=row[2])              p.num_responses = row[3]              result_list.append(p)          return result_list    class OpinionPoll(models.Model):      question = models.CharField(max_length=200)      poll_date = models.DateField()      objects = PollManager()    class Response(models.Model):      poll = models.ForeignKey(OpinionPoll)      person_name = models.CharField(max_length=50)      response = models.TextField()

What is the sql dialect that is used.
In this case you're opening a cursor, so you use whatever dialect your database uses. If you're using PostgreSQL, use PostgreSQL syntax; if you're using MySQL, use MySQL syntax. 

Django's ORM hides syntax differences from you; but once you start dealing with database cursors or raw() queries, you're coding right to the metal, so your deployment environment matters.

Yours,
Russ Magee %-)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Saturday, March 30, 2013

[android-developers] Re: GroundOverlay with rotation in MapView

Thanks for your answer,

but I don't know how to use the rotation. The LatLonBox is from parsed KML file.

I'm adding the OverLay like this 

     layMap = new GroundOverlay(bmpImage, topGeoPoint,  bottomGeoPoint);
     mapOverlays.add(0, layMap );  

But "new GroundOverlay" don't seem to support rotation

Den lördagen den 30:e mars 2013 kl. 23:30:29 UTC+1 skrev gjs:
Hi,

You are already using <rotation>0.477325392961741</rotation> in your example, just try other rotation values & see what you get.

 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[android-developers] Re: GroundOverlay with rotation in MapView


Den söndagen den 31:e mars 2013 kl. 06:26:37 UTC+2 skrev lbendlin:
you could pre-rotate the image for the ground overlay via a matrix transformation.

Thanks for the tip, I will try this

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[android-developers] Re: GroundOverlay with rotation in MapView

Thanks for the tip, I will try this
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[android-developers] Re: GroundOverlay with rotation in MapView

Thanks for your answer,
 
but I don't know how to use the rotation. The LatLonBox is from parsed KML file.
 
I'm adding the OverLay like this
 
     layMap = new GroundOverlay(bmpImage, topGeoPoint,  bottomGeoPoint);
     mapOverlays.add(0, layMap );
 
But "new GroundOverlay" don't seem to support rotation
 
 
 
 
 
 

Den lördagen den 30:e mars 2013 kl. 23:30:29 UTC+1 skrev gjs:
Hi,

You are already using <rotation>0.477325392961741</rotation> in your example, just try other rotation values & see what you get.

Regards 

On Friday, March 29, 2013 7:04:56 PM UTC+11, Brofalad wrote:
Hi,
 
I have a overlay image with the following cooridinates.
 
<LatLonBox>
  <north>56.56509012808</north>
  <south>56.5455371985222</south>
  <east>13.249250664387</east>
  <west>13.2017977722382</west>
  <rotation>0.477325392961741</rotation>
</LatLonBox>
 
It is no problem to create the overlay without the rotation. But is it possible to rotate the image, or can I only use images with rotation = 0.
/Brofalad
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[Rails] Why Did Capybara Move Specs into spec/features?

Hello Everyone,

I am new to Ruby on Rails. I just finished Michael Hartl's Ruby on Rails Tutorial and I just started on Agile Web Development with Rails, Fourth Edition by Sam Ruby. In trying to build confidence and proficiency, I started building small apps and decided, as I had learned from Michael Hartl, to use capybara and rspec. But when I tried it nothing was working. It turns out, this was the reason:

If you are using Rails, put your Capybara specs in spec/features.
 
And in order to use the tests I had created in spec/requests, I have to do this:

If you are not using Rails, tag all the example groups in which you want to use Capybara with :type => :feature.

Can anyone explain the reasoning behind this? I'm sure there is a good reason for this that my newbie self does not comprehend yet. Thank you in advance.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/yvcOOFxzJyEJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

[android-developers] Re: GroundOverlay with rotation in MapView

you could pre-rotate the image for the ground overlay via a matrix transformation.

On Friday, March 29, 2013 4:04:56 AM UTC-4, Brofalad wrote:
Hi,
 
I have a overlay image with the following cooridinates.
 
<LatLonBox>
  <north>56.56509012808</north>
  <south>56.5455371985222</south>
  <east>13.249250664387</east>
  <west>13.2017977722382</west>
  <rotation>0.477325392961741</rotation>
</LatLonBox>
 
It is no problem to create the overlay without the rotation. But is it possible to rotate the image, or can I only use images with rotation = 0.
/Brofalad
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: New to CakePHP

look into /app/config/bootstrap.php file 
you should have settings something like: 

 Configure::write('Site.contact_email', 'whatever@your_site.com');
 Configure::write('Site.contact_email_subject', 'some subject'); 


On Wednesday, March 27, 2013 10:32:48 AM UTC-7, Ellie Quick wrote:
Help,

Im a fairly experienced php coder however Ive been given access to a site (as the author is no longer contactable) written using CakePHP and Im totally and utterly lost as to how to make the fairly urgently required fixes.

Theres a contact form on one of the pages which doesnt work, no error messages to say whats wrong, Its meant to send an email to the site owner but nothing is ever received. Now this could be as simple as the wrong email address being used through to there simply being no back end code for sending the mail.

ive found a file called "contacts_controller.php" which contains an email function which is clearly designed to send the relevant emails however the bit thats losing me is:

$email_to = Configure::read('Site.contact_email');
$email_subject = Configure::read('Site.contact_email_subject');
$email_from = Configure::read('Site.contact_email_from');

I cant find anywhere, either in the site server files or the relevant database anything that appears to hold these variables.

Am I being dim?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Cake Gallery

this is how I upload images and create thumbs in any sizes without any plugin,... of course you have to modify to your own needs,... don't forget to create subdirectories in webroot/photos/ original,... thumbs,... etc,... and chmod to 777

function upload in photos_controller: 


  function upload()
  {
    $this->authorize();
    
    $user = $this->User->findById($this->user['id']);
   

    if(!($user && ($user['User']['photos_limit'] == 0 || $user['User']['photos'] < $user['User']['photos_limit'])))
    {
exit('You reached your upload limit');
    }
    else
    {
      $fileParts = $_FILES['Filedata']['name'];
      $secret = $this->generateRandomString(20);
      $name = str_replace(array('.jpg', '.jpeg', '.JPG', '.JPEG', '.png', '.PNG'), '', $fileParts);

      if($this->Photo->save(array('Photo' => array('name' => $name, 'user_id' => $this->user['id'], 'secret' => $secret, 'hidden' => 0, 'privacy' => array_search($_GET['privacy'], Configure::read('Site.privacy'))))))
      { 
        $this->User->query('UPDATE fociki_users' .
        ' SET photos = photos + 1' .
        ', last_public_photo = (SELECT created FROM fociki_photos WHERE user_id = ' . $this->user['id'] . ' AND fociki_photos.privacy <= ' . array_search('public', Configure::read('Site.privacy')) .' ORDER BY created DESC LIMIT 1)' .
        ', last_friend_photo = (SELECT created FROM fociki_photos WHERE user_id = ' . $this->user['id'] . ' AND fociki_photos.privacy <= ' . array_search('friend', Configure::read('Site.privacy')) .' ORDER BY created DESC LIMIT 1)' .
        ' WHERE id = ' . $this->user['id']);


        $original_file = $this->Photo->getOriginalFile($this->Photo->id, $secret, true);
        $original_file_path = $original_file->pwd();
        $tempFile   = $_FILES['Filedata']['tmp_name'];

        move_uploaded_file($tempFile, $original_file_path);
 
        exec('/usr/bin/convert -geometry 400x350 ' . $original_file_path . ' ' . $this->Photo->getMediumFile($this->Photo->id, $secret)->pwd() .' > /dev/null 2>&1 &');

        exec('/usr/bin/convert -geometry 145x145 ' . $original_file_path . ' ' . $this->Photo->getSmallFile($this->Photo->id, $secret)->pwd() .' > /dev/null 2>&1 &');

        exec('/usr/bin/convert -thumbnail x150 -resize "150x<" -resize 50% -gravity center -crop 75x75+0+0 +repage ' . $original_file_path . ' ' . $this->Photo->getSquareFile($this->Photo->id, $secret)->pwd() .' > /dev/null 2>&1 &');
        exec('/usr/bin/convert -thumbnail x96 -resize "96x<" -resize 50% -gravity center -crop 48x48+0+0 +repage ' . $original_file_path . ' ' . $this->Photo->getBuddyFile($this->Photo->id, $secret)->pwd() .' > /dev/null 2>&1 &');

        exec('/usr/bin/convert -geometry 500x450 ' . $original_file_path . ' ' . $this->Photo->getLargeFile($this->Photo->id, $secret)->pwd() .' > /dev/null 2>&1 &');

      }

      echo 'OK';
      die();

      }
  }
  

and here is the Model photo.php 

<?php
class Photo extends AppModel {
  var $name = 'Photo';

    var $validate = array(
     'user_id' => array(
      'rule' => 'notEmpty'
     ),
     'name' => array(
      'rule' => 'notEmpty'
     ),
 );
 
  var $belongsTo = 'User';
  
  var $hasMany = array(
    'PhotoTag' => array('order' => array('tag' => 'ASC')),
    'PhotoNote' => array('order' => array('created' => 'ASC')),
  );



  function getOriginalFile($id, $secret, $create = null, $chmod = null)
  {
    return new File(WWW_ROOT . 'photos' . DS . 'original' . DS . $id . '-' . $secret . '.jpg', $create, $chmod);
  }
  
  function getLargeFile($id, $secret, $create = null, $chmod = null)
  {
    return new File(WWW_ROOT . 'photos' . DS . 'large' . DS . $id . '-' . $secret . '.jpg', $create, $chmod);
  }
  
  function getMediumFile($id, $secret, $create = null, $chmod = null)
  {
    return new File(WWW_ROOT . 'photos' . DS . 'medium' . DS . $id . '-' . $secret . '.jpg', $create, $chmod);
  }
  
  function getSmallFile($id, $secret, $create = null, $chmod = null)
  {
    return new File(WWW_ROOT . 'photos' . DS . 'small' . DS . $id . '-' . $secret . '.jpg', $create, $chmod);
  }
  
  function getThumbFile($id, $secret, $create = null, $chmod = null)
  {
    return new File(WWW_ROOT . 'photos' . DS . 'thumb' . DS . $id . '-' . $secret . '.jpg', $create, $chmod);
  }
  
  function getSquareFile($id, $secret, $create = null, $chmod = null)
  {
    return new File(WWW_ROOT . 'photos' . DS . 'square' . DS . $id . '-' . $secret . '.jpg', $create, $chmod);
  }
   
  function getBannerFile($id, $secret, $create = null, $chmod = null)
  {
    return new File(WWW_ROOT . 'photos' . DS . 'banner' . DS . $id . '-' . $secret . '.jpg', $create, $chmod);
  }
   
  function getBuddyFile($id, $secret, $create = null, $chmod = null)
  {
    return new File(WWW_ROOT . 'photos' . DS . 'buddy' . DS . $id . '-' . $secret . '.jpg', $create, $chmod);
  }
  

  function beforeDelete()
   {

     $this->loadModels('PhotoComment', 'PhotoTag', 'PhotoFavorite', 'PhotoLike', 'PhotoDislike', 'Notification');

     $photo = $this->findById($this->id());
     $this->secret = $photo['Photo']['secret'];
     
     foreach(array($this->getOriginalFile($this->id(), $this->secret), $this->getLargeFile($this->id(), $this->secret), $this->getMediumFile($this->id(), $this->secret), $this->getSmallFile($this->id(), $this->secret), $this->getThumbFile($this->id(), $this->secret), $this->getSquareFile($this->id(), $this->secret), $this->getBannerFile($this->id(), $this->secret), $this->getBuddyFile($this->id(), $this->secret)) as $file)
     {
       if($file->exists())
         $file->delete();
     }

   return true;  
   }


   function afterDelete()
   {
   
   }
    

}
?> 

I hope it helps,... enjoy it,... 

On Saturday, March 30, 2013 6:16:12 PM UTC-7, Robert Gravel wrote:
Hi All,
I am trying to use the cake_gallery plugin https://github.com/vitorpc/cake_gallery  for cake 1.3 but for some reason the thumbnail is not generated. Seems some issue with photo.php model??
In firebug i get some errors.
<b>Warning</b> (2)</a>: imagecreatetruecolor() [<a href='http://php.net/function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]:
Invalid image dimensions [<b>APP\plugins\cake_gallery\models\photo
.php</b>, line <b>104</b>]
I have GD on my server. same errors on my server as my xampp server.

Anyone have any luck with this or can recommend a gallery plugin with upload and thumb creation
Thank you
Robert

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Real Estate