Daily Archives

Articles indexed Sunday November 11 2012

Page 6/14 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Lenovo z470 getting hot, after 12.04 install

    - by Rodrigo
    When I was using Windows 7 my notebook temperature was very good, it stayed very cool. After I installed 12.04, my notebook base is hot all the time, I cannot even put my hands on it for a long time. My notebook has a 2nd generation Intel i5 processor. I installed Jupiter and it shows 72 Degrees Celsius constantly. Anyone got a fix for this? I don't want to go back to windows but if I do not find any solution I will have to do it. I'd be very grateful for any help.

    Read the article

  • How to print with PYGTK on quickly

    - by user88476
    I am trying to make a program that can open save and print texts with Quickly, but I can't get the printing part to work. In my code when you press the "printbutton" it opens a print dialog: def on_printbutton_clicked(self,widget): self.printdialog.show() and that works fine. And when you click "ok" it will gather the settings from the dialog and try to print: def on_printdialog_response(self,widget,ok): printjob = gtkunixprint.PrintJob(self.filename,self.printdialog.get_selected_printer,self.printdialog.get_setting,self.printdialog.get_page_setup) but when I run it doesn't work and just gives me this: NameError: global name 'gtkunixprint' is not defined Is "gtkunixprint" wrong? Or is it something else in my code? Or should I first import something? I hope you can help me.

    Read the article

  • Quickly Warning

    - by bradjones
    Every time I run my application I receive these warning errors can anyone tell me what is causing them? $ quickly run /usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `Window' can't be set after construction Gtk.Window.__init__(self, type=type, **kwds) /usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `AppWindow' can't be set after construction Gtk.Window.__init__(self, type=type, **kwds)

    Read the article

  • Error accessing Gio.Gsettings on application made in quickly

    - by Zane Swafford
    I am trying to develop an application using the quickly/pygtk stack. I got my Gsettings schemas all set up in ~/app-name-here/data/glib-2.0/schemas/net.launchpad.app-name-here.gschema.xml correctly and I am able to access it just fine in my preferences dialog window that is located in ~/app-name-here/app-name-here/PreferencesDialog.py via from gi.repository import Gtk, Gio settings = Gio.Settings("net.launchpad.app-name-here") settings.get_boolean('notify') settings.set_boolean('notify', True) but when I try to check the value of one of my settings in a file located in ~/app-name-here/bin/Daemon.py that I use as a script to run in the background and send notifications by a similar method of from gi.repository import Gio settings = Gio.Settings("net.launchpad.app-name-here") settings.get_boolean('notify') it fails at the line that says settings = Gio.Settings("net.launchpad.app-name-here") and spits out a nasty error (Daemon.py:26100): GLib-GIO-ERROR **: Settings schema 'net.launchpad.app-name-here' is not installed Despite the fact that I can open up dconf-editor and find the settings under net/launchpad/app-name-here. Any thoughts?

    Read the article

  • Using pkexec policy to run out of /opt/

    - by liberavia
    I still try to make it possible to run my app with root priveleges. Therefore I created two policies to run the application via pkexec (one for /usr/bin and one for /opt/extras... ) and added them to the setup.py: data_files=[('/usr/share/polkit-1/actions', ['data/com.ubuntu.pkexec.armorforge.policy']), ('/usr/share/polkit-1/actions', ['data/com.ubuntu.extras.pkexec.armorforge.policy']), ('/usr/bin/', ['data/armorforge-pkexec'])] ) additionally I added a startscript which uses pkexec for starting the application. It distinguishes between the two places and is used in the Exec-Statement of the desktopfile: #!/bin/sh if [ -f /opt/extras.ubuntu.com/armorforge/bin/armorforge ]; then pkexec "/opt/extras.ubuntu.com/armorforge/bin/armorforge" "$@" else pkexec `which armorforge` "$@" fi If I simply do a quickly package everything will work right. But if I package with extras option: quickly package --extras the Exec-statement will be exchanged. Even if I try to simulate the pkexec call via armorforge-pkexec It will aks for a password and then returns this: andre@andre-desktop:~/Entwicklung/Ubuntu/armorforge$ armorforge-pkexec (armorforge:10108): GLib-GIO-ERROR **: Settings schema 'org.gnome.desktop.interface' is not installed Trace/breakpoint trap (core dumped) So ok, I could not trick the opt-thing. How can I make sure, that my Application will run with root priveleges out of opt. I copied the way of using pkexec from synaptic. My application is for communicating with apparmor which currently has no dbus interface. Else I need to write into /etc/apparmor.d-folder. How should I deal with the opt-build which, as far as I understand, is required to submit my application to the ubuntu software center. Thanks for any hints and/or links :-)

    Read the article

  • Custom widgets/controls in application indicators

    - by markitusss
    I want to develop an app for ubuntu, that integrates inside the calendar indicator/menu. It should allow to enter info right from it, and have several controls like input boxes, drop downs, spinners and buttons. Is this possible to integrate/replace the standard date/time indicator? If not, is it possible to create it as a separate indicator that when clicked opens a popup with all the controls and stuff? I want it to look as part of the sys tray and not as a separate desktop app. I'm using Quickly for this. Thanks for your help!

    Read the article

  • gtk_widget_grab_focus() jumping to next field automatically?

    - by Ravi Raj
    I am creating a 'C' project with glade and gtk. I want a focus on a gtkentry field naming txt_abc and so I called the function: gtk_widget_grab_focus (txt_abc); There is another gtkentry widget just after txt_abc widget naming txt_def. My problem is instead of getting focus on txt_abc widget, the cursor is automatically being focused on txt_def widget, when I am running the application. One more thing, when I am setting the focus at txt_def widget by calling the code: gtk_widget_grab_focus (txt_def); the control is again being focused on the next widget on the window, i.e. txt_name. I want the focus exactly on the widget I am setting the grab signal. How to resolve this problem.

    Read the article

  • GRUB2 stuck at rescue console, showing "unknown filesystem" for all partitions

    - by AndiDog
    I installed Ubuntu 12.04 on my external USB drive, where I have a 700GB NTFS partition followed by the new 6GB ext4 partition and a swap partition (all primary). The GRUB MBR is also installed to the external hard disk. Since my BIOS puts the external drive as first disk when booting, I removed my internal hard disk before installation in order to avoid ordering problems. Now when I boot from the external drive, GRUB is stuck at the rescue console with the error "unknown filesystem". grub rescue> ls (hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) ls (hd0,<any of them>)/ gives me "unknown filesystem", thus also "insmod normal" GRUB doesn't seem to be able to read my Linux partition as you can see above?! How can I solve this? Additional info: bootinfoscript says (this is with the internal drive in again, but that does not make a difference): Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 1 of the same hard drive for core.img. core.img is at this location and looks for (,msdos2)/boot/grub on this drive. sdb1: __________________________________________________________________________ File system: ntfs Boot sector type: Windows Vista/7: NTFS Boot sector info: No errors found in the Boot Parameter Block. Operating System: Boot files: sdb2: __________________________________________________________________________ File system: ext4 Boot sector type: - Boot sector info: Operating System: Ubuntu 12.04 LTS Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img sdb3: __________________________________________________________________________ File system: swap Boot sector type: - Boot sector info:

    Read the article

  • Intel GMA 4500M screen resolution problem

    - by I Heart Ubuntu
    I was previously running 10.10 on my Acer Aspire laptop. It has Intel GMA 4500M integrated graphics and worked just fine. Great display, sharp, crisp, etc. I decided to do a fresh install of 11.10 Oneiric and now am having problems. Originally I was getting the dreaded blank screen where the brightness was turned almost completely off. Some searching pulled up several easy fixes (editing GRUB). Right now I am still having one issue. The screen resolution is stuck at a max of 1024x768 giving me a distorted screen. Is there any way to fix this issue? I've Googled, searched Ask Ubuntu and also spent time on the forums looking for a solution. Thus far, nothing. Apparently, was and still is a concern in Natty? Any help would be greatly appreciated.

    Read the article

  • Why is a # sign added to the end of URLS?

    - by Niro
    Note: I'm asking this from the perspective of the site developers (trying to help someone there). not as a user. Please don't forward this to superuser.com. It's a server admin question. Have a look here http://www.wanimo.com/fr/chiens/coussin-matelas-tapis-pour-chien-sc28/tapis-plat-urban-chic-sf7263/ you'll see that the page gets redirected to the same page with # at the end. Worse, when you click back you get garbage url. I'm trying to debug what is causing the redirect. Any advice on how to find it ?

    Read the article

  • C# XNA render an entire frame to a texture2d

    - by redcodefinal
    I asked a question here: C# XNA Make rendered screen a texture2d But, I ended up not getting the exact result I was looking for since I didn't ask the question right. In a game I am writing, I render an extremely large city out of objects, this can cause lag when moving the camera to view things that are off screen. I need a way to render then ENTIRE city, even the stuff that is off screen, and make it into a Texture2D. The answer I chose for the last one didn't work entirely right because it only gets what is on screen, not what is off.

    Read the article

  • Engine for 2D Top-Down Physics-Based Skeletal Animation

    - by RylandAlmanza
    I just watched at the Sui Generis video, and was completely amazed. Specifically, the part where the big troll thing is beating up the player with his flail. This got me really excited, and I would like to try implementing something like this in a 2D Top-Down format. Something like this. That atloria example seems simple enough, but it's not exactly what I'm looking to make. I think atloria is using predefined animations, where as I would like to make something more physics-based like the Sui Generis engine does. So, I'm wondering what physics engines might work for something like this, and if I'd need to implement my own skeletal system, or if I could just use "joints" and such from the engine. The only experience I have in terms of physics engines is Box2D, which I've heard shouldn't be used for top-down settings, and I can think of a few reasons it wouldn't work out well. One of those reasons being gravity. In box 2D, gravity pulls towards a side of the screen (usually the bottom.) I wouldn't want my player's forearms constantly being pulled to one side. :) Also should mention that the programming language doesn't matter all that much to me. I'm currently playing with HTML5 stuff, though. :) Thanks in advance!

    Read the article

  • What is the best Broadphase Interface for moving spheres?

    - by Molmasepic
    As of now I am working on optimizing the performance of the physics and collision, and as of now I am having some slowdowns on my other computers from my main. I have well over 3000 btSphereShape Rigidbodies and 2/3 of them do not move at all, but I am noticing(by the profile below) that collision is taking a bit of time to maneuver. Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 10.09 0.65 0.65 SphereTriangleDetector::collide(btVector3 const&, btVector3&, btVector3&, float&, float&, float) 7.61 1.14 0.49 btSphereTriangleCollisionAlgorithm::processCollision(btCollisionObject*, btCollisionObject*, btDispatcherInfo const&, btManifoldResult*) 5.59 1.50 0.36 btConvexTriangleCallback::processTriangle(btVector3*, int, int) 5.43 1.85 0.35 btQuantizedBvh::reportAabbOverlappingNodex(btNodeOverlapCallback*, btVector3 const&, btVector3 const&) const 4.97 2.17 0.32 btBvhTriangleMeshShape::processAllTriangles(btTriangleCallback*, btVector3 const&, btVector3 const&) const::MyNodeOverlapCallback::processNode(int, int) 4.19 2.44 0.27 btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGeneric(btRigidBody&, btRigidBody&, btSolverConstraint const&) 4.04 2.70 0.26 btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimit(btRigidBody&, btRigidBody&, btSolverConstraint const&) 3.73 2.94 0.24 Ogre::OctreeSceneManager::walkOctree(Ogre::OctreeCamera*, Ogre::RenderQueue*, Ogre::Octree*, Ogre::VisibleObjectsBoundsInfo*, bool, bool) 3.42 3.16 0.22 btTriangleShape::getVertex(int, btVector3&) const 2.48 3.32 0.16 Ogre::Frustum::isVisible(Ogre::AxisAlignedBox const&, Ogre::FrustumPlane*) const 2.33 3.47 0.15 1246357 0.00 0.00 Gorilla::Layer::setVisible(bool) 2.33 3.62 0.15 SphereTriangleDetector::getClosestPoints(btDiscreteCollisionDetectorInterface::ClosestPointInput const&, btDiscreteCollisionDetectorInterface::Result&, btIDebugDraw*, bool) 1.86 3.74 0.12 btCollisionDispatcher::findAlgorithm(btCollisionObject*, btCollisionObject*, btPersistentManifold*) 1.86 3.86 0.12 btSequentialImpulseConstraintSolver::setupContactConstraint(btSolverConstraint&, btCollisionObject*, btCollisionObject*, btManifoldPoint&, btContactSolverInfo const&, btVector3&, float&, float&, btVector3&, btVector3&) 1.71 3.97 0.11 btTriangleShape::getEdge(int, btVector3&, btVector3&) const 1.55 4.07 0.10 _Unwind_SjLj_Register 1.55 4.17 0.10 _Unwind_SjLj_Unregister 1.55 4.27 0.10 Ogre::D3D9HardwareVertexBuffer::updateBufferResources(char const*, Ogre::D3D9HardwareVertexBuffer::BufferResources*) 1.40 4.36 0.09 btManifoldResult::addContactPoint(btVector3 const&, btVector3 const&, float) 1.40 4.45 0.09 btSequentialImpulseConstraintSolver::setupFrictionConstraint(btSolverConstraint&, btVector3 const&, btRigidBody*, btRigidBody*, btManifoldPoint&, btVector3 const&, btVector3 const&, btCollisionObject*, btCollisionObject*, float, float, float) 1.24 4.53 0.08 btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold*, btContactSolverInfo const&) 1.09 4.60 0.07 408760 0.00 0.00 Living::MapHide() 1.09 4.67 0.07 btSphereTriangleCollisionAlgorithm::~btSphereTriangleCollisionAlgorithm() 1.09 4.74 0.07 inflate_fast EDIT: Updated to show current Profile. I have only listed the functions using over 1% time from the many functions that are being used. Another thing is that each monster has a certain area that they stay in and are only active when a player is in said area. I was wondering if maybe there is a way to deactivate the non-active monsters from bullet(reactivating once in the area again) or maybe theres a different broadphase interface that I should use. The current BPI is btDbvtBroadphase. EDIT: Here is the Profile on the other computer(the top one is my main) Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 12.18 1.19 1.19 SphereTriangleDetector::collide(btVector3 const&, btVector3&, btVector3&, float&, float&, float) 6.76 1.85 0.66 btSphereTriangleCollisionAlgorithm::processCollision(btCollisionObject*, btCollisionObject*, btDispatcherInfo const&, btManifoldResult*) 5.83 2.42 0.57 btQuantizedBvh::reportAabbOverlappingNodex(btNodeOverlapCallback*, btVector3 const&, btVector3 const&) const 5.12 2.92 0.50 btConvexTriangleCallback::processTriangle(btVector3*, int, int) 4.61 3.37 0.45 btTriangleShape::getVertex(int, btVector3&) const 4.09 3.77 0.40 _Unwind_SjLj_Register 3.48 4.11 0.34 btBvhTriangleMeshShape::processAllTriangles(btTriangleCallback*, btVector3 const&, btVector3 const&) const::MyNodeOverlapCallback::processNode(int, int) 2.46 4.35 0.24 btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimit(btRigidBody&, btRigidBody&, btSolverConstraint const&) 2.15 4.56 0.21 _Unwind_SjLj_Unregister 2.15 4.77 0.21 SphereTriangleDetector::getClosestPoints(btDiscreteCollisionDetectorInterface::ClosestPointInput const&, btDiscreteCollisionDetectorInterface::Result&, btIDebugDraw*, bool) 1.84 4.95 0.18 btTriangleShape::getEdge(int, btVector3&, btVector3&) const 1.64 5.11 0.16 btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGeneric(btRigidBody&, btRigidBody&, btSolverConstraint const&) 1.54 5.26 0.15 btSequentialImpulseConstraintSolver::setupContactConstraint(btSolverConstraint&, btCollisionObject*, btCollisionObject*, btManifoldPoint&, btContactSolverInfo const&, btVector3&, float&, float&, btVector3&, btVector3&) 1.43 5.40 0.14 Ogre::D3D9HardwareVertexBuffer::updateBufferResources(char const*, Ogre::D3D9HardwareVertexBuffer::BufferResources*) 1.33 5.53 0.13 btManifoldResult::addContactPoint(btVector3 const&, btVector3 const&, float) 1.13 5.64 0.11 btRigidBody::predictIntegratedTransform(float, btTransform&) 1.13 5.75 0.11 btTriangleIndexVertexArray::getLockedReadOnlyVertexIndexBase(unsigned char const**, int&, PHY_ScalarType&, int&, unsigned char const**, int&, int&, PHY_ScalarType&, int) const 1.02 5.85 0.10 btSphereTriangleCollisionAlgorithm::CreateFunc::CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo&, btCollisionObject*, btCollisionObject*) 1.02 5.95 0.10 btSphereTriangleCollisionAlgorithm::btSphereTriangleCollisionAlgorithm(btPersistentManifold*, btCollisionAlgorithmConstructionInfo const&, btCollisionObject*, btCollisionObject*, bool) Edited same as other Profile.

    Read the article

  • Installing Sass on Gentoo

    - by iyrag
    I've been trying to install Sass on Gentoo, but it hasn't been going too well. Unfortunately, the latest version of Sass in portage is 3.1.21. What I want to use Sass for requires at least Sass 3.2, which is available through rubygems. What I've tried: emerge dev-ruby/sass (installs an old version) gem install sass The second command appears to install the Sass gem. However, I do not use Rails or Ruby in any other aspect apart from Sass, so the gem appears useless to me. In addition, I do not know where gems are installed to or how to use them (I'm a ruby noob.) All I want to do is call sass from the command line. Are there any ways to obtain an up-to-date version of Sass which I can just use from the command line? Cheers.

    Read the article

  • Rails exit controller after rendering

    - by codysehl
    I have an action in my controller that I am having trouble with. This is my first rails app, so I'm not sure of the best practices surrounding rails. I have a model called Group and a few actions that go in it's controller. I have written a test that should cause the controller to render an error in JSON because of an invalid Group ID. Instead of rendering and exiting, it looks like the controller is rendering and continuing to execute. Test test 'should not remove group because of invalid group id' do post(:remove, {'group_id' => '3333'}) response = JSON.parse(@response.body) assert_response :success assert_equal 'Success', response['message'] end Controller action # Post remove # group_id def remove if((@group = Group.find_by_id(params[:group_id])) == nil) render :json => { :message => "group_id not found" } end @group.destroy if(!Group.exists?(@group)) render :json => { :message => "Success" } else render :json => { :errors => @group.errors.full_messages } end end In the controller, the first if statement executes: render :json => { :message => "group_id not found" } but @group.destroy is still being executed. This seems counter-intuitive to me, I would think that the render method should exit the controller. Why is the controller not exiting after render is called? The purpose of this block of code is to recover gracefully when no record can be found with the passed in ID. Is this the correct way of doing something like this?

    Read the article

  • How to attach Gtk::Menu to Gtk::Widget

    - by krokoziabla
    Gtk::Menu has void Gtk::Menu::attach_to_widget(Widget& attach_widget, GtkMenuDetachFunc detacher) void Gtk::Menu::attach_to_widget (Widget& attach_widget) wrapper methods for void gtk_menu_attach_to_widget(GtkMenu *menu, GtkWidget *attach_widget, GtkMenuDetachFunc detacher) But why are they protected? If I want to make a pop-up menu on a widget, how, then, can I get access to it from the menu's activate call-back if not via these methods?

    Read the article

  • Foreign Key Relationships

    - by Yehonathan Quartey
    I have two models class Subject(models.Model): name = models.CharField(max_length=100,choices=COURSE_CHOICES) created = models.DateTimeField('created', auto_now_add=True) modified = models.DateTimeField('modified', auto_now=True) syllabus = models.FileField(upload_to='syllabus') def __unicode__(self): return self.name and class Pastquestion(models.Model): subject=models.ForeignKey(Subject) year =models.PositiveIntegerField() questions = models.FileField(upload_to='pastquestions') def __unicode__(self): return str(self.year) Each Subject can have one or more past questions but a past question can have only one subject. I want to get a subject, and get its related past questions of a particular year. I was thinking of fetching a subject and getting its related past question. Currently am implementing my code such that I rather get the past question whose subject and year correspond to any specified subject like this_subject=Subject.objects.get(name=the_subject) thepastQ=Pastquestion.objects.get(year=2000,subject=this_subject) I was thinking there is a better way to do this. Or is this already a better way? Please Do tell ?

    Read the article

  • Dont understand Python Method

    - by user836087
    I dont understand what is going on in the move method. I am taking the AI course from Udacity.com. The video location is: http://www.udacity.com/view#Course/cs373/CourseRev/apr2012/Unit/512001/Nugget/480015 Below is the code I dont get, its not working as shown in the video .. The answer I should be getting according to Udacity is [0, 0, 1, 0, 0] Here is what I get [] p=[0, 1, 0, 0, 0] def move(p, U): q = [] for i in range(len(p)): q.append(p[(i-U) % len(p)]) return q print move(p, 1)

    Read the article

  • Turtle Graphics as a Haskell Monad

    - by iliis
    I'm trying to implement turtle graphis in Haskell. The goal is to be able to write a function like this: draw_something = do fordward 100 right 90 forward 100 ... and then have it produce a list of points (maybe with additional properties): > draw_something (0,0) 0 -- start at (0,0) facing east (0 degrees) [(0,0), (0,100), (-100,100), ...] I have all this working in a 'normal' way, but I fail to implement it as a Haskell Monad and use the do-notation. The basic code: data State a = State (a, a) a -- (x,y), angle deriving (Show, Eq) initstate :: State Float initstate = State (0.0,0.0) 0.0 -- constrain angles to 0 to 2*pi fmod :: Float -> Float fmod a | a >= 2*pi = fmod (a-2*pi) | a < 0 = fmod (a+2*pi) | otherwise = a forward :: Float -> State Float -> [State Float] forward d (State (x,y) angle) = [State (x + d * (sin angle), y + d * (cos angle)) angle] right :: Float -> State Float -> [State Float] right d (State pos angle) = [State pos (fmod (angle+d))] bind :: [State a] -> (State a -> [State a]) -> [State a] bind xs f = xs ++ (f (head $ reverse xs)) ret :: State a -> [State a] ret x = [x] With this I can now write > [initstate] `bind` (forward 100) `bind` (right (pi/2)) `bind` (forward 100) [State (0.0,0.0) 0.0,State (0.0,100.0) 0.0,State (0.0,100.0) 1.5707964,State (100.0,99.99999) 1.5707964] And get the expected result. However I fail to implement this as an instance of Monad. instance Monad [State] where ... results in `State' is not applied to enough type arguments Expected kind `*', but `State' has kind `* -> *' In the instance declaration for `Monad [State]' And if I wrap the list in a new object data StateList a = StateList [State a] instance Monad StateList where return x = StateList [x] I get Couldn't match type `a' with `State a' `a' is a rigid type variable bound by the type signature for return :: a -> StateList a at logo.hs:38:9 In the expression: x In the first argument of `StateList', namely `[x]' In the expression: StateList [x] I tried various other versions but I never got it to run as I'd like to. What am I doing wrong? What do I understand incorrectly?

    Read the article

  • Matlab-Bisection-Newton-Secant , finding roots?

    - by i z
    Hello and thanks in advance for your possible help ! Here's my problem: I have 2 functions f1(x)=14.*x*exp(x-2)-12.*exp(x-2)-7.*x.^3+20.*x.^2-26.*x+12 f2(x)=54.*x.^6+45.*x.^5-102.*x.^4-69.*x.^3+35.*x.^2+16.*x-4 Make the graph for those 2, the first one in [0,3] and the 2nd one in [-2,2]. Find the 3 roots with accuracy of 6 decimal digits using a) bisection ,b) newton,c)secant.For each root find the number of iterations that have been made. For Newton-Raphson, find which roots have quadratic congruence and which don't. What is the main common thing that roots with no quadratic congruence (Newton's method)? Why ? Excuse me if i ask silly things, but i'm asked to do this with no Matlab courses and I'm trying to learn it myself. There are many issues i have with this exercise . Questions : 1.I only see 2 roots in the graph for the f1 function and 4-5 (?) roots for the function f2 and not 3 roots as the exercise says. Here's the 2 graphs : http://postimage.org/image/cltihi9kh/ http://postimage.org/image/gsn4sg97f/ Am i wrong ? Do both have only 3 roots in [0,3] and [-2,2] ? Concerning the Newton's method , how am i supposed to check out which roots have quadratic congruence and which not??? Accuracy means tolerance e=10^(-6), right ?

    Read the article

  • Python: convert buffer type of SQLITE column into string

    - by Volatil3
    I am new to Python 2.6. I have been trying to fetch date datetime value which is in yyyy-mm-dd hh:m:ss format back in my Python program. On checking the column type in Python I get the error: 'buffer' object has no attribute 'decode'. I want to use the strptime() function to split the date data and use it but I can't find how to convert a buffer to string. The following is a sample of my code (also available here): conn = sqlite3.connect("mrp.db.db", detect_types=sqlite3.PARSE_DECLTYPES) cursor = conn.cursor() qryT = """ SELECT dateDefinitionTest FROM t WHERE IDproject = 4 AND IDstatus = 5 ORDER BY priority, setDate DESC """ rec = (4,4) cursor.execute(qryT,rec) resultsetTasks = cursor.fetchall() cursor.close() # closing the resultset for item in resultsetTasks: taskDetails = {} _f = item[10].decode("utf-8") The exception I get is: 'buffer' object has no attribute 'decode'

    Read the article

  • Programmatically Update UITableView in Response to Button Press

    - by Kyle Begeman
    I have a completely custom view that holds a UITableView and a Custom Tab Bar (basically a UIView that contains 6 UIButtons). I am loading data from a plist file, and then I am sorting the data into multiple arrays based on categories (an array for misc items, and array for mail items, etc.) Each button in the tab bar represents a category, and when I press the button I call the custom function "miscSelected" and so on. How can I have the table view completely reload and then display the tableview based on the array selected (select the misc category and the tableview clears itself and loads the misc array data, same for any other category)? The method I have experimented with is created and NSString named "selection" and then in each button function I set selected to equal whatever section I am selecting. In my cellForRoxAtIndexPath method I have this: if ([self.selection isEqualToString:@"All Items"]) { NSArray *mainDataArray = [NSArray arrayWithContentsOfFile:self.plistFile]; NSSortDescriptor *brandDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; NSArray *sortDescriptors = [NSArray arrayWithObject:brandDescriptor]; self.sortedData = [mainDataArray sortedArrayUsingDescriptors:sortDescriptors]; } else if ([self.selection isEqualToString:@"Misc Items"]){ self.sortedData = [NSArray arrayWithContentsOfFile:self.plistFile]; } cell.itemTitle.text = [[self.sortedData objectAtIndex:indexPath.row] objectForKey:@"name"]; For the sake of example and testing I am simply displaying the same data, just one button displays it in alphabetical order and the other does not. This code works only when I start to scroll down and back up, but it does not actually update on button press. Calling myTable reloadData does not do anything either. Any help would be great, thanks!

    Read the article

  • how to developing "document plagiarism checker" website in asp.net?

    - by user1637402
    i know this website write-check his functionality is uploading a file(PDF,Doc) and check percentage of redundancy between the file uploaded and a lot of websites ,books,researches and after user upload file and result shows that result show redundancy percentage and highlight on copied paragraphs . that paragraphs were repeated in website references when user hover on these highlights the source or references appear to the user to make sure the source he copied from this is explain simply for website functionality can any one help me in analysis for asp.net website has the same functionality and how check between uploaded file and archived files

    Read the article

  • plot 4 different plots inside 1 pdf

    - by ifreak
    I have 2 data frames which i want to generate 3 plots from them and place them inside 1 pdf file as a single column. i want all the plots to have the same x-axis limits(basically the same x-axis) even thought they differ in the name and how they were obtained. the dataframes looks something like that: d1 X Y Z 0.04939317 -0.4622222 13651 0.03202451 -0.4261000 13401 0.09950793 -0.3233025 13151 0.11548556 -0.4637981 12486 0.09817597 -0.4751886 12236 0.15770701 -0.5819355 11986 and d2 V0 V1 V2 V3 sign 1 1 0.379 0.612 pos 2 1 0.378 0.620 pos 3 1 0.578 0.571 neg 4 1 0.978 0.561 pos 5 1 0.758 0.261 neg 6 1 0.378 0.126 neg P.S : both data frames are bigger than this, this is only a part of them V0, V1 and Z range from 1 to 20000 the plots that i created are : From d2 d2plot=ggplot(d1, aes(V0,V1, fill=sign)) + geom_tile()+ scale_fill_manual(values = c("neg" = "yellow", "pos"="red")) +geom_vline(xintercept =10000 ) +geom_text(mapping=aes(x=10000,y=0, label="Stop"), size=4, angle=90, vjust=-0.4, hjust=0) From d1 d1plot = ggplot(d2) + geom_errorbarh(aes(x=z,xmin=z-50,xmax=z+50, y=Y, height = 0.02),color="red")+ opts(legend.position = "none") +geom_vline(xintercept = 10000) +geom_text(mapping=aes(x=10000,y=-0.3, label="Stop"), size=4, angle=90, vjust=-0.4, hjust=0) i've tried grid.arrange(d1plot,d2plot,ncol=1) but the x-axis is different for each plot, i tried changing the aspect ratio, but this will change the y-axis ..i've also tried to use facet_wrap but the problem that my x-axis values have different values, i just want the limits and breaks to be the same and the plots all be aligned in 1 column based on 1 x-axis to comapre the value of the statistical methods in an easy way.

    Read the article

  • Is iOS6 simulator buggy when deleting applications?

    - by davsan
    Frequently, when I try to delete an app on the iOS 6 simulator that comes with Xcode 4.5, the simulator freezes. What I do is just long press on the app. Delete dialog doesn't come up and the icons keep on wiggling. Quitting and re-opening the simulator does not help to delete the app. I've tried to delete the app's folder from /Library/Application Support/iPhone Simulator/5.1/Applications folder. Sometimes this helps but sometimes even this doesn't delete the icon from the simulator. This behavior is independent of the iOS version or the device model. It's the same whichever model/iOS I choose. The only thing that helps is using the Reset Contents and Settings option of the simulator. Do you experience the same frustration? If so, have you figured out a workaround besides resetting the simulator completely?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >