Daily Archives

Articles indexed Friday April 6 2012

Page 12/18 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Unity on Ubuntu 11.10 - The Dash Home button brings up the panel, but is empty

    - by David M. Coe
    The dash home button brings up a panel that is greyed out, but it is totally empty. It seems to be the very same issue as this: Dash home button brings up blank window which is unanswered. /usr/lib/nux/unity_support_test -p returns OpenGL vendor string: X.Org R300 Project OpenGL renderer string: Gallium 0.4 on ATI RV370 OpenGL version string: 2.1 Mesa 7.11 Not software rendered: yes Not blacklisted: yes GLX fbconfig: yes GLX texture from pixmap: yes GL npot or rect textures: yes GL vertex program: yes GL fragment program: yes GL vertex buffer object: yes GL framebuffer object: yes GL version is 1.4+: yes Unity 3D supported: yes I've tried a unity --reset but that doesn't seem to work. Unity seems to reset, but I get the following warning over and over: cs space validation failed unity What should I do next to try and fix this? Edit: Attempted fixes: I've refomatted, did not work. I've done apt-get remove unity then apt-get update then apt-get install unity, did not work. I've switched to Unity 2d and this seems to work. How can I get regualar Unity working or atleast find the error?

    Read the article

  • Unity and games don't work on new Thinkpad T420

    - by Clay Smalley
    Here's my setup: Lenovo ThinkPad T420, brand new NVIDIA Graphics Card 4GB of Ram 128GB Solid State Drive Intel Core i5 Processor Given these specs, there's no reason games and Unity shouldn't be working. The strange thing is that both do work when I run from a live USB, but not when Ubuntu is installed to the hard drive. Is there something different with the 3D capabilities of running from the computer as opposed to running from the live USB? Edit: Some more information: When I log in for the first time when running from the hard drive, Ubuntu says "It seems that you do not have the hardware required to run Unity. Please choose Ubuntu Classic at the login screen and you will be using the traditional environment."

    Read the article

  • Blank screen after installing nvidia restricted driver

    - by LaMinifalda
    I have a new machine with a MSI N560GTX Ti Twin Frozr II/OC graphic card and MSI PH67A-C43 (B3) main board. If i install the current nvidia restricted driver and reboot the machine on Natty (64-bit), then i only get a black screen after reboot and my system does not respond. I can´t see the login screen. On nvidia web page i saw that the current driver is 270.41.06. Is that driver used as current driver? Btw, i am an ubuntu/linux beginner and therefore not very familiar with ubuntu. What can i do to solve the black screen problem? EDIT: Setting the nomodeset parameter does not solve the problem. After ubuntu start, first i see the ubuntu logo, then strange pixels and at the end the black screen. HELP! EDIT2: Thank you, but setting the "video=vesa:off gfxpayload=text" parameters do no solve the problem too. Same result as in last edit. HELP. I would like to see Unity. This is my grub: GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="video=vesa:off gfxpayload=text nomodeset quiet splash" GRUB_CMDLINE_LINUX=" vga=794" EDIT3: I dont know if it is important. If this edit is unnecessary and helpless I will delete it. There are some log files (Xorg.0.log - Xorg.4.log). I dont know how these log files relate to each other. Please, check the errors listed below. In Xorg.1.log I see the following error: [ 20.603] (EE) Failed to initialize GLX extension (ComIatible NVIDIA X driver not found) In Xorg.2.log I see the following error: [ 25.971] (II) Loading /usr/lib/xorg/modules/libfb.so [ 25.971] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32 [ 25.971] (==) NVIDIA(0): RGB weight 888 [ 25.971] (==) NVIDIA(0): Default visual is TrueColor [ 25.971] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0) [ 26.077] (EE) NVIDIA(0): Failed to initialize the NVIDIA GPU at PCI:1:0:0. Please [ 26.078] (EE) NVIDIA(0): check your system's kernel log for additional error [ 26.078] (EE) NVIDIA(0): messages and refer to Chapter 8: Common Problems in the [ 26.078] (EE) NVIDIA(0): README for additional information. [ 26.078] (EE) NVIDIA(0): Failed to initialize the NVIDIA graphics device! [ 26.078] (II) UnloadModule: "nvidia" [ 26.078] (II) Unloading nvidia [ 26.078] (II) UnloadModule: "wfb" [ 26.078] (II) Unloading wfb [ 26.078] (II) UnloadModule: "fb" [ 26.078] (II) Unloading fb [ 26.078] (EE) Screen(s) found, but none have a usable configuration. [ 26.078] Fatal server error: [ 26.078] no screens found [ 26.078] Please consult the The X.Org Found [...] In Xorg.4.log I see the following errors: [ 15.437] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32 [ 15.437] (==) NVIDIA(0): RGB weight 888 [ 15.437] (==) NVIDIA(0): Default visual is TrueColor [ 15.437] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0) [ 15.703] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 560 Ti (GF114) at PCI:1:0:0 (GPU-0) [ 15.703] (--) NVIDIA(0): Memory: 1048576 kBytes [ 15.703] (--) NVIDIA(0): VideoBIOS: 70.24.11.00.00 [ 15.703] (II) NVIDIA(0): Detected PCI Express Link width: 16X [ 15.703] (--) NVIDIA(0): Interlaced video modes are supported on this GPU [ 15.703] (--) NVIDIA(0): Connected display device(s) on GeForce GTX 560 Ti at [ 15.703] (--) NVIDIA(0): PCI:1:0:0 [ 15.703] (--) NVIDIA(0): none [ 15.706] (EE) NVIDIA(0): No display devices found for this X screen. [ 15.943] (II) UnloadModule: "nvidia" [ 15.943] (II) Unloading nvidia [ 15.943] (II) UnloadModule: "wfb" [ 15.943] (II) Unloading wfb [ 15.943] (II) UnloadModule: "fb" [ 15.943] (II) Unloading fb [ 15.943] (EE) Screen(s) found, but none have a usable configuration. [ 15.943] Fatal server error: [ 15.943] no screens found EDIT4 There was a file /etc/X11/xorg.conf. As fossfreedom suggested I executed sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup However, there is still the black screen after reboot. EDIT5 Neutro's advice (reinstalling the headers) did not solve the problem, too. :-( Any further help is appreciated! EDIT6 I just installed driver 173.xxx. After reboot the system shows me only "Checking battery state". Just for information. I will google the problem, but help is also appreciated! ;-) EDIT7 When using the free driver (Ubuntu says that the free driver is in use and activated), Xorg.0.log shows the following errors: [ 9.267] (II) LoadModule: "nouveau" [ 9.267] (II) Loading /usr/lib/xorg/modules/drivers/nouveau_drv.so [ 9.267] (II) Module nouveau: vendor="X.Org Foundation" [ 9.267] compiled for 1.10.0, module version = 0.0.16 [ 9.267] Module class: X.Org Video Driver [ 9.267] ABI class: X.Org Video Driver, version 10.0 [ 9.267] (II) LoadModule: "nv" [ 9.267] (WW) Warning, couldn't open module nv [ 9.267] (II) UnloadModule: "nv" [ 9.267] (II) Unloading nv [ 9.267] (EE) Failed to load module "nv" (module does not exist, 0) [ 9.267] (II) LoadModule: "vesa" [...] [ 9.399] drmOpenDevice: node name is /dev/dri/card14 [ 9.402] drmOpenDevice: node name is /dev/dri/card15 [ 9.406] (EE) [drm] failed to open device [ 9.406] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so [ 9.406] (WW) Falling back to old probe method for fbdev [ 9.406] (II) Loading sub module "fbdevhw" [ 9.406] (II) LoadModule: "fbdevhw" EDIT8 In the meanwhile i tried to install WIN7 64 bit on my machine. As a result i got a BSOD after installing the nvidia driver. :-) For this reason i sent my new machine back to the hardware reseller. I will inform you as soon as i have a new system. Thank you all for the great help and support. EDIT9 In the meanwhile I have a complete new system with "only" a MSI N460GTX Hawk, but more RAM. The system works perfect. :-) The original N560GTX had a hardware defect. Is is possible to close this question? THX!

    Read the article

  • 11.10 liveCD black screen

    - by Shaun Killingbeck
    Attempting to install/try ubuntu 11.10 on my new laptop, using a liveCD (and tried USB). I get the purple screen (with the man/keyboard at the bottom) and after that the screen flashes bright white before going black. Ubuntu continues to load in the background, with login sound etc but the screen is off. I have tried as many different solutions as I could find including: using nomodestep, xforcevesa, i915.modeset=0 in boot options (seperately): varying consequences, but either I end up at a blinking cursor with no prompt, a command line (startx fails: no screen found), or the original blank screen again Tried booting from VirtualBox - it crashes at the same place the screen would go blank when using a CD/USB tried 11.04: I don't have this problem BUT when trying to install, I get a ubi-partman error 141 (possibly down to the three partitions that came on my laptop... not sure why HP needed there own separate partition for HP Tools...) Model: HP Pavillion DV6 6B08SA Processor: AMD Quad-Core A6-3410MX APU with Radeon HD 6545G2 Dual Graphics (1.6 GHZ 4 MB L2 cache ) Chipset: AMD RS880M Any help would be greatly appreciated. I just want to be able to partition the drive and install Ubuntu. I'm assuming the issue is graphics card related, although I have no confirmation of that. I have caught a glimpse of some output to do with pulseaudio and [fail], but I can't imagine why that would cause a screen problem and the sound definitely works anyway.

    Read the article

  • Screen dims on opening certain applications on Macbook

    - by yayu
    I have ubuntu 11.10 installed on an old 2008 macbook. There is an issue of screen dimming that I didnt find anywhere else on the forums. The issue is that the screen is dimmed when I open certain applications (Firefox, Software Center) and this cannot be readjusted by the physical brightness buttons on the keyboard. I tried a bunch of things on the barely barely visible screen, and had no choice but to restart. This has happened everytime. Does anyone know how to solve this?

    Read the article

  • 10.04 wont boot after power outage

    - by Pat
    After unexpected power outage 10.04 won't boot, the following message appears mount: mounting /dev/disk/by-uuid/***************************** on /root failed: Invalid argument mount: mounting /sys on /root/sys failed: No such file or directory mount: mounting /dev on /root/dev failed: No such file or directory mount: mounting /sys on /root/sys failed: No such file or directory mount: mounting /proc on /root/proc failed: No such file or directory Target file system doesn't have /sbin/init No init found. Try passing init= bootarg Busybox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu7) built-in shell (ash) Enter 'help' for a list of built-in commands (initramfs) _ I have tried rebooting from a liveCD but it wont boot and I cannot open a terminal to try to fix it by sudo fdisk -l as recommended on other posts. Any help would be greatly appreciated

    Read the article

  • Newbie tips, please [closed]

    - by eXeP
    So, I just got a new computer and I want to put Ubuntu on my old laptop. I just need few tips before installing it. 1.Programs, where to download, how to download, what is the "ending" (windows has .exe) 2. How much is command line involved? And where to get the most usual commands? 3.Few programs you recommend (graphics editing, IDE, video player, web browser) 4. Do I have to download drivers when installing new OS? I plan on getting fully rid of Windows. I have no idea of the name of my graphics card, so how do I can get to know what it is if I have to download drivers? (I don't know the name because it's not on the original box, or anywhere on the internet, believe me) 5. When installing new OS does it destroy everything else on the hard drive? 6. Anti-virus, do I need one? I'm not super paranoid, and I don't visit "shady" sites. Please note that I have never used linux, or any other OS than Windows and sorry for my bad english. If this is the wrong place to post this, then please remove this. Thank you.

    Read the article

  • Length of Page Title, URL, Meta Description and total number of links on a page

    - by MJWadmin
    We've been examining a number of different SEO tools recently. Several of these tell us that some of our page title's, urls and meta descriptions are too long. We've also been told that some of our pages have too many links on them. I guess our first question is - is any of that feedback true! Can URL's etc actually be too long and if so how much does this affect ranking? Secondly can you have too many links on a page and if so, how many is too many? Thanks in advance...

    Read the article

  • 301 Redirects for regional variants of a homepage

    - by Adam Jenkin
    I am planning on implementing a website which has regional homepage variants. For Example: mycompany.com/europe mycompany.com/us The rest of the site is region agnostic and content will continue such as: mycompany.com/news mycompany.com/about-us etc For homepage (.com) requests, I plan on redirecting users to the correct homepage variant (via 301). If I cannot determine the correct one, I will fallback to redirecting them to the US homepage (/us). From an SEO point of view, firstly is this ok? or should I be doing anything additional to this for making search engines aware of the regional differences? As crawlers are region agnostic, I plan on directing them to the US page with a 301, or should I have something on the .com page which they use? Being that the regional homepage's will likely be the most visited pages, they should show up in result sitelinks when searching for mycompany (which I think is a good thing). Apologies for the slightly open question - I know anything SEO related is more opinion/best practice than fact but am purely looking for advice.

    Read the article

  • When should one use the Abstract, Implements, or extends keywords?

    - by kdavis8
    I'm just now moving from a beginner to intermediate level android programmer in the java language. i can successfully write a game framework of classes that work together to accomplish a task beyond basic things, like hello world. but i'm having issues with some pretty basic OOP concepts; When should i derive from an abstract class? When is it more efficient to use an Interface instead of simply sub classing a parent? Basically, between extends, implements, and the abstract keywords, which keywords should be used instead of the others? i'm not looking for a basic definition, as i know them. i need to no when and why i should apply them to my code? what advantages does one have over the other? which is best for game development?

    Read the article

  • Android frame by frame PNG animation

    - by Trick
    I am new at Android game development. I have done some apps before, but none of them are games :) So, I wanted to do a frame-by-frame animation of PNGs. I tried with AnimationDrawable, but OutOfMemory error comes quickly (I have a lot of PNGs). So I came upon SurfaceView. But I am stuck, because I really don't find any useful tutoirals/examples. What is the best way to make an animation like this? Here there already is a great answer to almost the same question, but all the links there don't work anymore. I would really like to here suggestions how to make an animation frame-by-frame with PNGs in Android and if you have any tutorials or examples, I will be really happy :)

    Read the article

  • How to handle circle penetration

    - by Kaertserif
    I've been working on cirlce to circle collision and have gotten the intersection method working correctly, but I'm having problems using the returned values to actually seperate the circles from one another. This is the method which calculates the depth of the circle collision public static Vector2 GetIntersectionDepth(Circle a, Circle b) { float xValue = a.Center.X - b.Center.X; float yValue = a.Center.Y - b.Center.Y; Vector2 depth = Vector2.Zero; float distance = Vector2.Distance(a.Center, b.Center); if (a.Radius + b.Radius > distance) { float result = (a.Radius + b.Radius) - distance; depth.X = (float)Math.Cos(result); depth.Y = (float)Math.Sin(result); } return depth; } This is where I'm trying to apply the values to actually seperate the circles. Vector2 depth = Vector2.Zero; for (int i = 0; i < circlePositions.Count; i++) { for (int j = 0; j < circlePositions.Count; j++) { Circle bounds1 = new Circle(circlePositions[i], circle.Width / 2); Circle bounds2 = new Circle(circlePositions[j], circle.Width / 2); if(i != j) depth = CircleToCircleIntersection.GetIntersectionDepth(bounds1, bounds2); if (depth != Vector2.Zero) { circlePositions[i] = new Vector2(circlePositions[i].X + depth.X, circlePositions[i].Y + depth.Y); } } } If you can offer any help in this I would really appreciate it.

    Read the article

  • Optimizing graphics for an iOS flash game

    - by 1GR3
    A friend of mine and myself are working on a flash developed iOS (and later Android) puzzle board game. He's a developer and I'm a designer/developer so (no surprise) we have different points of view. His method: make small tiles (100x100px) in Photoshop join them into the board and then in flash apply effects to the board to avoid repetition (80's not in the good way). My method: precompose the whole board (960x640px+bleed) in Photoshop and than mask active and inactive areas in flash. What do you think?

    Read the article

  • UDK/ UnrealScript class interaction? HUD advice?

    - by Holly
    Beginner basics requested here, While i'm familiar with the basics of OOP programming i've just started looking as UnrealScript for a game i had made in the UDK editor up to now. I have a class that extends UTHUD and another that extends UDKPAWN. I have the pawn destroyed when its been shot 3 times and some basic helloworld text displaying in my HUD but i'm completely lost as to how one would get some sort of feedback between the two classes going on? What i would like to do to start off, is have some text that says something like "Amount of baddies killed: 0" Displayed on the HUD which would then increment each time the player destroyed one of my pawns. I'm sorry if this is an inappropriate question but i've never really worked within a framework like this before and wasn't sure where to go for help to get my footing. All advice appreciated!

    Read the article

  • Slick & NiftyGUI. Nifty initialize exception

    - by Romeo
    I found my self into trouble when trying to run a Slick game with a Nifty Game State. This is the code: @Override protected void initGameAndGUI(GameContainer container, StateBasedGame game) throws SlickException { initNifty(container, game); } If i run this i get: java.lang.IllegalStateException: The NiftyGUI was already initialized. Its illegal to do so twice. If i delete the call to initNifty() i get another exception:java.lang.IllegalStateException: NiftyGUI was not initialized.

    Read the article

  • Crash when using datablocks

    - by scorcher24
    I have really throughly searched the net and could not find any solution for this so I ask for help here. Anyway, I have this datablock in datablocks.cs: datablock t2dSceneObjectDatablock(EnemyShipConfig) { canSaveDynamicFields = "1"; Layer = "3"; size = "64 64"; CollisionActiveSend = "1"; CollisionActiveReceive = "1"; CollisionCallback = true; CollisionLayers = "3"; CollisionDetectionMode = "POLYGON"; CollisionPolyList = "0.00 -0.791 0.756 0.751 -0.746 0.732"; UsesPhysics = "0"; Rotation = "-90"; WorldLimitMode = "KILL"; WorldLimitMax = "880 360"; WorldLimitMin = "-765 -436"; minFireRate = "2000"; maxFireRate = "1200"; laserSpeed = "800"; minSpeed = "100"; maxSpeed = "150"; }; This is an exact reproduction of an object that I have manually edited in the editor. So far, I just used clone() to get as many enemies as I need, while it was out of sight. It is a r-type style shooter, so I need a variable amount of enemies. Since clone() spams my log, I decided to use datablocks, since it is also more flexible. That's what I get when I use clone(): Con::execute - 0 has no namespace: onRemoveFromScene However, once spawning begins, my game freezes and crashes: function SpawnEnemy() { //%spawnedEnemy = EnemyShipMaster.clone(true); %spawnedEnemy = new t2dStaticSprite() { class = "EnemyShip"; sceneGraph = $global_sceneGraph; datablock = "EnemyShipConfig"; imageMap = "starshipImageMap"; layer = 3; }; %speed = getRandom(%spawnedEnemy.minSpeed, %spawnedEnemy.maxSpeed); %y = getRandom(-320, 320); // Set Properties %spawnedEnemy.setPositionX(700); %spawnedEnemy.setPositionY(%y); %spawnedEnemy.setVisible(true); %spawnedEnemy.setLinearVelocityX( -%speed ); %spawnedEnemy.setTimerOn( getRandom( %spawnedEnemy.maxFireRate, %spawnedEnemy.minFireRate ) ); } // Definition of $global_sceneGraph from game.cs: $global_sceneGraph = sceneWindow2D.loadLevel(%level); As I said, it works fine when I use clone() (which is commented out here), but my log gets spammed. I really hope someone can shed some light for me, this is driving me crazy.

    Read the article

  • Grouping a query with php

    - by Tom Hoad
    Basic question! I have 2 tables FRUIT id | fruit_name ------------------- 1 | Apple 2 | Banana 3 | Carrot VARIETIES id | fk_fruit_id | variety_name --------------------------------------- 1 1 Cox 2 1 Braeburn 3 2 Chester 4 3 Kotaka 5 3 Imperial 6 3 Oneal I'd like to output a list of varieties per fruit e.g. APPLE - Cox, Braeburn BANANA - Chester CARROT - Kotaka, Imperial, Oneal My current code is $query = "SELECT * FROM produce, varieties WHERE produce.id = varieties.fk_fruit_id"; $result = mysql_query($query) or die('Error : ' . mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $produce_fruit_code = $row['fruit_code']; $variety_name = $row['variety_name']; echo $produce_fruit_code.' - '.$variety_name.'<br/>'; } which outputs: Apple - Cox Apple - Braeburn Banana - Chester Carrot - Kotaka Carrot - Imperial Carrot - Oneal Not a million miles away, but still not there. Any help is much appreciated, thanks!

    Read the article

  • PHP loading / including files only if class is used

    - by MrMalayev
    I have a couple of classes, and certain classes require only a part of an SDK. For example class a { /* requires filea.php*/ } class b { /*requires fileb.php*/ } Instead of including the files at the top like require_once 'filea.php'; require_once 'fileb.php'; class a { /*do stuff*/ } class b { /*do stuff*/ } Can I just include them in the class, so one only loads when an object is made? class a { require filea.php; /*do stuff*/ } class b { require fileb.php; /*do stuff*/ }

    Read the article

  • Continuations in Java

    - by nobeh
    I am looking for recent work presenting continuations in Java. I have come across the same question here but it dates back for a year or two. There is some work such as JavaFlow by Apache, RIFE Continuations (that I cannot download for any reason now). Also there is a blog post mentioning the support in JDK but it seems that the support will span to Java 8. I also reckon that continuations are also introduced in recent Scala versions. I am looking for implementations in Java presenting the continuations concept. And, I am not looking for the works that present continuation-passing-style (CSP). I'd be thankful for any other work you might know.

    Read the article

  • iOS get file size on disk

    - by F2_CMD
    I'm trying to get the size on disk of a file in iOS using Objective C. As of now I've been able to get the actual size of the file and other file information using NSFileManager and then getting the attributes attributesOfItemAtPath:error but not the size on disk. I also tried getting the file size from struct stat but again it doesn't give me size on disk.I tried using NSTask to make a call to du -h but iOS didn't allow me to fork other processes. Any ideas are welcome :) I know this questions is similar to many others but the difference is that I'm trying to do this in iOS and most of the methods used in other systems don't work here. Thanks

    Read the article

  • How do people prove the correctness of Computer Vision methods?

    - by solvingPuzzles
    I'd like to pose a few abstract questions about computer vision research. I haven't quite been able to answer these questions by searching the web and reading papers. How does someone know whether a computer vision algorithm is correct? How do we define "correct" in the context of computer vision? Do formal proofs play a role in understanding the correctness of computer vision algorithms? A bit of background: I'm about to start my PhD in Computer Science. I enjoy designing fast parallel algorithms and proving the correctness of these algorithms. I've also used OpenCV from some class projects, though I don't have much formal training in computer vision. I've been approached by a potential thesis advisor who works on designing faster and more scalable algorithms for computer vision (e.g. fast image segmentation). I'm trying to understand the common practices in solving computer vision problems.

    Read the article

  • How to sum up a fetched result's number property based on the object's category?

    - by mr_kurrupt
    I have a NSFetchRequest that is returning all my saved objects (call them Items) and storing them in an NSMutableArray. Each of these Items have a category, an amount, and some other properties. My goal is to check the category of each Item and store the sum of the amounts for objects of the same category. So if I had these Items: Red; 10.00 Blue; 20.00 Green; 5.00 Red; 5.00 Green; 15.00 then I would have an array or other type of container than has: Red; 15.00 Blue; 20.00 Green; 20.00 What would be the best way to organize the data in such a manner? I was going to create a object class (call it Totals) that just has the category and amount. As I traverse through the fetch results in a for-loop, add Items with the same category in a Totals object an store them in a NSMutableArray. The problem I ran into with that is that I'm not sure how to check if an array contains a Totals object with a specific property. Specifically, a category that already exists. So if 'Red' exists, add the amount to it, otherwise create a new Totals object with category 'Red' and a the first Item's amount. Thanks.

    Read the article

  • Suds array of arrays not nesting

    - by joshcartme
    Let me preface this by saying that I am still pretty new to SOAP and how things should work. I'm working with the Vertical Response API. I'm having trouble getting suds to construct the xml correctly for a request. Here is some code: from suds.client import Client url = 'https://api.verticalresponse.com/wsdl/1.0/VRAPI.wsdl' client = Client(url) vr = client.service ... test_list = ( ( { 'name' : 'email_address', 'value' : login['username'], }, { 'name' : 'First_Name', 'value' : 'VR_User', } ), ( { 'name' : 'email_address', 'value' : '[email protected]', }, { 'name' : 'First_Name', 'value' : login['username'], }, ), ) # sid and cid are correctly retrieved prior to this point print "Sending test message..." vr.sendEmailCampaignTest({ 'session_id' : sid, 'campaign_id' : cid, 'recipients' : test_list, }) In this context login['username'] is just an email address. That code raises this error: suds.WebFault: Server raised fault: 'Application failed during request deserialization: Too many elements in array. 4 instead of claimed 2 (2) Here is the the definition of sendEmailCampaignTest: http://developers.verticalresponse.com/api/soap/methods/campaigns/sendemailcampaigntest/ Here is the xml that logging outputs (I removed the session_id and list_id for display here): DEBUG:suds.client:headers = {'SOAPAction': u'"VR/API/1_0#sendEmailCampaignTest"', 'Content-Type': 'text/xml; charset=utf-8'} ERROR:suds.client:<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:ns3="http://api.verticalresponse.com/1.0/VRAPI.xsd" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="VR/API/1_0" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Header/> <ns0:Body> <ns4:sendEmailCampaignTest> <args xsi:type="ns3:sendEmailCampaignTestArgs"> <session_id xsi:type="ns1:string">redacted</session_id> <campaign_id xsi:type="ns1:int">redacted</campaign_id> <recipients xsi:type="ns3:ArrayOfNVDictionary" ns2:arrayType="ns3:NVDictionary[2]"> <item> <name xsi:type="ns1:string">email_address</name> <value xsi:type="ns1:string">[email protected]</value> </item> <item> <name xsi:type="ns1:string">First_Name</name> <value xsi:type="ns1:string">VR_User</value> </item> <item> <name xsi:type="ns1:string">email_address</name> <value xsi:type="ns1:string">[email protected]</value> </item> <item> <name xsi:type="ns1:string">First_Name</name> <value xsi:type="ns1:string">[email protected]</value> </item> </recipients> </args> </ns4:sendEmailCampaignTest> </ns0:Body> </SOAP-ENV:Envelope> DEBUG:suds.client:http failed: <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Application failed during request deserialization: Too many elements in array. 4 instead of claimed 2 (2) </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> a ruby script (provided by Vertical Response) that does the same things as the script I am working on in python outputs the following xml (I removed the session_id and list_id): <?xml version="1.0" encoding="utf-8" ?> <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Body> <n1:sendEmailCampaignTest xmlns:n1="VR/API/1_0" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <args xmlns:n2="http://api.verticalresponse.com/1.0/VRAPI.xsd" xsi:type="n2:sendEmailCampaignTestArgs"> <session_id xsi:type="xsd:string">redacted</session_id> <campaign_id xsi:type="xsd:int">redacted</campaign_id> <recipients xmlns:n3="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="n3:Array" n3:arrayType="n2:NVDictionary[2]"> <item xsi:type="n3:Array" n3:arrayType="n2:NVPair[2]"> <item> <name xsi:type="xsd:string">email_address</name> <value href="#id9496430"></value> </item> <item> <name xsi:type="xsd:string">First_Name</name> <value xsi:type="xsd:string">VR_User</value> </item> </item> <item xsi:type="n3:Array" n3:arrayType="n2:NVPair[2]"> <item> <name xsi:type="xsd:string">email_address</name> <value xsi:type="xsd:string">[email protected]</value> </item> <item> <name xsi:type="xsd:string">First_Name</name> <value href="#id9496430"></value> </item> </item> </recipients> </args> </n1:sendEmailCampaignTest> <value id="id9496430" xsi:type="xsd:string" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">[email protected]</value> </env:Body> </env:Envelope> I understand that the error is in the construction of recipients. It should contain two items, each that contain two items but my python script using suds is setting it up to contain four unnested items. So my question is how can I get suds to correctly construct the xml?

    Read the article

  • segmented reduction with scattered segments

    - by Christian Rau
    I got to solve a pretty standard problem on the GPU, but I'm quite new to practical GPGPU, so I'm looking for ideas to approach this problem. I have many points in 3-space which are assigned to a very small number of groups (each point belongs to one group), specifically 15 in this case (doesn't ever change). Now I want to compute the mean and covariance matrix of all the groups. So on the CPU it's roughly the same as: for each point p { mean[p.group] += p.pos; covariance[p.group] += p.pos * p.pos; ++count[p.group]; } for each group g { mean[g] /= count[g]; covariance[g] = covariance[g]/count[g] - mean[g]*mean[g]; } Since the number of groups is extremely small, the last step can be done on the CPU (I need those values on the CPU, anyway). The first step is actually just a segmented reduction, but with the segments scattered around. So the first idea I came up with, was to first sort the points by their groups. I thought about a simple bucket sort using atomic_inc to compute bucket sizes and per-point relocation indices (got a better idea for sorting?, atomics may not be the best idea). After that they're sorted by groups and I could possibly come up with an adaption of the segmented scan algorithms presented here. But in this special case, I got a very large amount of data per point (9-10 floats, maybe even doubles if the need arises), so the standard algorithms using a shared memory element per thread and a thread per point might make problems regarding per-multiprocessor resources as shared memory or registers (Ok, much more on compute capability 1.x than 2.x, but still). Due to the very small and constant number of groups I thought there might be better approaches. Maybe there are already existing ideas suited for these specific properties of such a standard problem. Or maybe my general approach isn't that bad and you got ideas for improving the individual steps, like a good sorting algorithm suited for a very small number of keys or some segmented reduction algorithm minimizing shared memory/register usage. I'm looking for general approaches and don't want to use external libraries. FWIW I'm using OpenCL, but it shouldn't really matter as the general concepts of GPU computing don't really differ over the major frameworks.

    Read the article

  • removing duplicate strings from a massive array in java efficiently?

    - by Preator Darmatheon
    I'm considering the best possible way to remove duplicates from an (Unsorted) array of strings - the array contains millions or tens of millions of stringz..The array is already prepopulated so the optimization goal is only on removing dups and not preventing dups from initially populating!! I was thinking along the lines of doing a sort and then binary search to get a log(n) search instead of n (linear) search. This would give me nlogn + n searches which althout is better than an unsorted (n^2) search = but this still seems slow. (Was also considering along the lines of hashing but not sure about the throughput) Please help! Looking for an efficient solution that addresses both speed and memory since there are millions of strings involved without using Collections API!

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18  | Next Page >