Search Results

Search found 31 results on 2 pages for 'pfunc'.

Page 1/2 | 1 2  | Next Page >

  • Why can't I extract a C++ type from a Python type using boost::python::extractor?

    - by Robin
    I've wrapped a C++ class using Py++ and everything is working great in Python. I can instantiate the c++ class, call methods, etc. I'm now trying to embed some Python into a C++ application. This is also working fine for the most-part. I can call functions on a Python module, get return values, etc. The python code I'm calling returns one of the classes that I wrapped: import _myextension as myext def run_script(arg): my_cpp_class = myext.MyClass() return my_cpp_class I'm calling this function from C++ like this: // ... excluding error checking, ref counting, etc. for brevity ... PyObject *pModule, *pFunc, *pArgs, *pReturnValue; Py_Initialize(); pModule = PyImport_Import(PyString_FromString("cpp_interface")); pFunc = PyObject_GetAttrString(pModule, "run_script"); pArgs = PyTuple_New(1); PyTuple_SetItem(pArgs, 0, PyString_FromString("an arg")); pReturnValue = PyObject_CallObject(pFunc, pArgs); bp::extract< MyClass& > extractor(pReturnValue); // PROBLEM IS HERE if (extractor.check()) { // This check is always false MyClass& cls = extractor(); } The problem is the extractor never actually extracts/converts the PyObject* to MyClass (i.e. extractor.check() is always false). According to the docs this is the correct way to extract a wrapped C++ class. I've tried returning basic data types (ints/floats/dicts) from the Python function and all of them are extracted properly. Is there something I'm missing? Is there another way to get the data and cast to MyClass?

    Read the article

  • Please explain syntax rules and scope for "typedef"

    - by unknown google user
    What are the rules? OTOH the simple case seems to imply the new type is the last thing on a line. Like here Uchar is the new type. typedef unsigned char Uchar; But a function pointer is completely different. Here the new type is pFunc: typedef int (*pFunc) (int); I can't think of any other examples offhand but I have come across some very confusing usages. So are there rules or are people just suppose to know from experience that this is how it is done because they have seen it done this way before? ALSO: What is the scope of a typedef. Thanks to everyone.

    Read the article

  • problem with XAMPP, access forbidden... looking for d:\xampp not c:\xampp

    - by pfunc
    I have been using xampp for a while now without any problem. All of a sudden I start xampp today and I am getting an "Error 403 Access Forbidden" when I try to go to my Localhost. When I check the error logs for apache it says: [Mon Mar 22 21:48:57 2010] [error] [client 127.0.0.1] client denied by server configuration: D:/xaamp This is strange, it should first of all say "C:" and second of all say "Xampp" (not xaamp). Where would I change this is my config files. Have no idea how this could have happened.

    Read the article

  • flash dynamic textfield, multiline and wordwrap acting funky.

    - by pfunc
    I have this weird thing happening with flash and a dynamic textfield. Basically, someone rolls over a marker on a map, and a tooltip pops up with a dynamic textfield. The textfield is set to multiline=true and wordwrap = true, and I defined a specific width of 160 pixels. The problem is, some of my text is jumping to the next line, some of it is just getting cut off. So if I have a line like "The Cat Jumped Over the Box", On one line I will see "The Cat Jumped" and on the next line I would see "the Box". It looks like it is masking out the "over" line and not pushing it to the next line. It's not doing this for everything, just some longer lines. This is a really weird bug and I have tried for 8 hours to get this fixed. Has anyone ran into this problem before?

    Read the article

  • Flex: vertical gap between list items not working

    - by pfunc
    I have a list item with buttons in it like so: <mx:List contentBackgroundAlpha="0" baseColor="0x333333" leading="10" id="weekButtonList" width="260" borderVisible="false" dataProvider="{_data.mappoints.week.@number}" itemClick="onWeekClick(event);" > <mx:itemRenderer > <mx:Component> <mx:Button buttonMode="true" width="260" height="50" label="Week {data}" /> </mx:Component> </mx:itemRenderer> </mx:List> No matter what I do, these buttons have a vertical gap inbetween them. I have tried everything from setting the "vertical-gap" property to negative and positive numbers as well as changing the padding-bottom and padding-top on them. I want the buttons to be right up against eachother vertically. I have also tried "button-height" and padding on the List component...still nothing. How do I control this?

    Read the article

  • html5 canvas hand cursor problems

    - by pfunc
    I'm playing around with html5 and some javascript to make a minor sketchpad. Whenever I click down on the canvas in chrome, the cursor becomes a text cursor. I have tried putting cursor: hand in the css, but that doesn't seem to work. This has got to be an easy thing, but I look it up and can't find it anywhere

    Read the article

  • Flex - Disabling the transparent background overlay on a popup

    - by pfunc
    I have a button in my flex app that creates a popup overtop of everything. However, it seems like flex automatically puts this transparent overlay overtop of the stage when this happens. How do I disable this? I have tried contentBackgroundAlpha="0" and backgroundAlpha="0" with no luck. anyone know what the proper syntax is for disabling this transparency? I have been searching through the docs for a 30 minutes now looking for it.

    Read the article

  • ajax to php to curl and back..

    - by pfunc
    I am trying to make an ajax call to a php script. The php script calls an rss feed using curl, gets the data, and returns the data to the funciton. I keep getting an error "Warning: Wrong parameter count for curl_error() in" .... Here is my php code:1 $ch = curl_init() or die(curl_error()); curl_setopt($ch, CURLOPT_URL, $feed); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data1 = curl_exec($ch) or die(curl_error()); echo $data1; and the ajax call: $.ajax({ url: "getSingleFeed.php", type: "POST", data: "feedURL=" + window.feedURL, success: function(feed){ alert(feed); }}); I tested all the variables, they are being passed correctly, I can echo them out. But this line: $data1 = curl_exec($ch) or die(curl_error()); is what is giving me the error. I am doing the same thing with curl on other pages, just without ajax, and it is working fine. Is there anything special I need to do with ajax to do this?

    Read the article

  • flex strange problem with namespaces.

    - by pfunc
    I'm trying to understand what is going on with my namespaces since I upgraded to flash builder 4. xmlns:mx="http://www.adobe.com/2006/mxml" in the application and in the stylesheets: @namespace mx "library://ns.adobe.com/flex/mx"; Everything seems to be recognized correctly, however, I get a warning that says "borderThickness" is only supported by the halo theme (which I thought was in the mx theme). Now, when I try xmlns:s="library://ns.adobe.com/flex/mx" then it doesn;t recognize anything. Is there something I might be doing wrong here or confusing?

    Read the article

  • Refreshing an XML file through HTTPService in Flex

    - by pfunc
    I'm having a problem refreshing an xml file. I am bringing it in through an HTTP service component and putting it into a bindable array _cattArr, that I am using as the dataprovider for a grid. When someone adds an item to the datagrid, it saves to the same xml file. Then I close the window, reopen it and don't see the item that has been added. It is writing to the xml file, because when I restart the flex app, the item has been added, it's just not refreshing it. I have tried to resend the httpservice, but still no luck. What is the correct process for doing this?

    Read the article

  • Question about A Sketching Website on the IPAD, Dragging and Touching

    - by pfunc
    I've been testing out the new functionality of html5 and js to create a sketching site. I've been looking into this for a possible client that wants their site to be ipad accessible, but also have drawing features on it. So i created a rough experiment where you can drag your mouse across a screen to draw lines. I went to test it on an ipad and realized this doesn't work. Why? because dragging on an ipad is reserved for actually dragging the screen around. Is there something you can do to get around this? I'm sure this could be done if made for an app, but what about just a normal website.

    Read the article

  • JavaScript Music Player with progress bar?

    - by pfunc
    I am creating a little JavaScript music player that sits on the btottom of the page, a lot like streampad. But streampad uses a flash progress bar for the song and JavaScript for everything else and I am having a hard time finding anyone who does this with JavaScript alone. Can anyone point me in the right direction on how this can be done (preferably without using HTML5)?

    Read the article

  • combining dynamic text with regular expressions in php

    - by pfunc
    I am experimenting with finding popular keywords using curl, php and regular expressions. I have an array of non-specific nouns that I am matching my keyword search up. So I am looking for words like "the", "and", "that" etc. and taking them out of the keyword search. so I have an array of words like so: $wordArr = [the, and, at,....]; and then running something like: && preg_match('(\bmyword\w*\b)', $key) == false how do I combine these two so it loops through the array finding out if any of the words in the array match the regular expression? I guess I could just do a for loop, but though maybe I could use in_array($wordArr, $key).. or something like that.

    Read the article

  • flex setting button width to text width

    - by pfunc
    I am creating a nav in flex that pulls in buttons dynamically from xml. THe problem i am having is setting the button width to the text width. currently the buttons are all the same width and if the text is larger then it just cuts off. I've tried a few ways of doing this: Setting button width to 100% On creation of the button try to set the width of the button to the text programmatically. Something like evt.target.width = evt.target.textWidth; Anyone know the correct way to do this?

    Read the article

  • Resizing FileReference image then reuploading, only reuploads original image.

    - by pfunc
    I can;t figure out how to do this. Someone selects and image after calling FileReference.browse(). I take that image and make a thumbnail in flash. Then I upload that image like so: var newFileReq:URLRequest = new URLRequest(FILE_UPLOAD_TEMP); newFileReq.contentType = "application/octet-stream"; var fileReqVars:URLVariables = new URLVariables(); fileReqVars.image = myThumbImage; fileReqVars.folder = "Thumbs"; newFileReq.data = fileReqVars; newFileReq.method = URLRequestMethod.POST; //upload the first image fileRef.addEventListener(Event.COMPLETE, onFirstFileUp); fileRef.upload(newFileReq, "Filedata"); All this does it upload the original image. How do I change the fileRef to upload the new thumb? I have traced out the size of the "myThumbImage" and it is correct. I have placed it visually on the stage after creating the thumb, and it seems like it works. But when I upload it to an aspx page (that basically just throws it into a folder), it uploads the original larger image.

    Read the article

  • Flex Problem Enabling and Disabling Button in List

    - by pfunc
    I have a list with a dataprovider, it lists out buttons encapsulated in an item renderer. All I want it to do is have a skin that it changes to when it is clicked. I can get this to happen, but then it just goes back to its up state. I want it to stick on the down state, which I have to do by disabling the button. So I tried this: buttonList.selectedItem.enabled = false; for(var i:Number = 0; i< buttonList.numChildren; i++) { var loopBtn = buttonList.getChildAt(i); if(loopBtn != buttonList.selectedItem) { loopBtn.enabled = true; } } But this doesn't seem to work. What am I doing wrong here?

    Read the article

  • Flash Builder keeps losing my imported classes...arghh

    - by pfunc
    I've been having this really annoying thing happen the past few days, that has happened before but not as frequently. I create a project in Flash Builder, import some classes, and then on occasion it keeps erasing those classes. So then I get errors in a lot of my datatypes, have to go back through my document and retype the datatype so that it reimports the class. What could be causing this? I know flash builder can be a bit buggy at times, but wasn't sure if someone else has had this problem and knows what might be causing it.

    Read the article

  • jquery element not defined, but it used to skip it...

    - by pfunc
    I recently transferred a site to a new host. Reloaded everything, and the javascript that worked fine before is breaking at an element it can't find. $('#emailForm') is not defined. Now, the #emailform isn't on the page, but it wasn't before either, and JS used to skip this and it would just work. Not sure why this is happening. Any clues?

    Read the article

  • html5, adding an eventlistener to a drawn image on canvas

    - by pfunc
    I am experimenting with html5 and I have a little image dropdown, the user selects and image and it draws it to the canvas using drawImage(); I can't seem to figure out how to add an event listener to the newly drawn image on the canvas. I have tried putting it in a variable like so: var newImg = ctx.drawImage(myImage, 200, 200); and then adding an eventlistener to that, but it doesn't seem to work. newImg.addEventListener('mousedown', onImgClick, false); What is the correct way to do this.

    Read the article

  • getting real link from rss feed link

    - by pfunc
    I am experimenting with scraping certain pages from an RSS feed using curl and php. The page scraping was working fine when I was just using actual links, not links from the rss feeds. However, I realize now that links in rss feeds are usually just redirects to the actual page (at least this is what it seems like). Because now when I scrape a page with the rss link, it doesn't actually get the information I am looking for. Has anyone encountered this and know of a workaround. Is there anyway to see where the rss link is redirecting to and capturing that value?

    Read the article

  • flex positioning a button within a panel

    - by pfunc
    All I'm trying to do is place a button inside of a panel, rotate that button (so it is vertical) and place it on the edge of the panel. I can;t seem to do this correctly. Here is my code: <mx:Panel id="weekList" width="260" height="100%" x="-500" title="Weeks" > <mx:List id="weekButtonList" width="260" borderVisible="false" contentBackgroundAlpha="0" dataProvider="{_data.mappoints.week.@number}" itemClick="onWeekClick(event);" > <mx:itemRenderer> <mx:Component> <mx:Button buttonMode="true" right="20" width="260" height="50" label="Week {data}" /> </mx:Component> </mx:itemRenderer> </mx:List> <mx:HBox id="closeButtonHolder" rotation="90" width="100" > <mx:Button label="OPEN" click="weekListToggle()" /> </mx:HBox> </mx:Panel> If you look at the part of the script you will see I am trying to rotate it and move it to the left. I am just trying to move it somewhere, and nothing is working. Also, the text seems to dissapear when I rotate it on a 90% axis. Anyone know what I can do for this?

    Read the article

  • is it better to query database or grab from file? php & mysql

    - by pfunc
    I am keeping a large amount of words in a database that I want to match up articles to. I was thinking that it would just be better to keep these words in an array and grab that array whenever needed instead of querying the database every time (since the words won't be changing that much). Is there much performance difference in doing this? And if I were to do this, how to I write a script that writes the array to a a new php file. I tried writing the array like so: while( $row = mysql_fetch_assoc($query)) { $newArray[] = $row; } $fp = fopen('noWordsArr.php', 'w'); fwrite($fp, $newArray); fclose($fp); But all I get in the other file is "Array". So i figured I could write this and then write have a chron hit up the file every few days or so in case things have changed. But I guess if there is no performance advantage then it prob won't be necessary and I can just query the database every time I need to access the words.

    Read the article

  • flex button spacing in a horizontal list

    - by pfunc
    How do you dynamically resize buttons in a horizontal list to fit the text size? I am pulling in my button text from xml and it seems that it resizes all the buttons to the first items text. I am wrapping my button inside a canvas, not setting widths for either of them. Basically I need all the buttons to resize to their text, and have them all spaced evenly as well.

    Read the article

  • Accessing children of loaded swf in Flex Image component

    - by pfunc
    I am loading an external swf into an component. It loads everything fine and I can see buttons working in the swf, but I can't seem to figure out how to add children to this swf from the core mxml file. I have tried tracing out all the children of the image component but can't find where or how to do this. This is the image component: <Image id="image" mask="{ maskCanvas }" source="{ _source }" mouseDown="image.startDrag()" visible="{ _source != null &amp;&amp; image.percentLoaded == 100 }" showEffect="{ fadeInEffect }" complete="imageComplete()" doubleClickEnabled="true" doubleClick="onDoubleClick()" /> And in my AS, I am trying to do something like this: myComponent.image.addChild("myMC"); But i either don;t see the clip or there I get an error about not being able to add the child to a ui component.

    Read the article

1 2  | Next Page >