Search Results

Search found 2011 results on 81 pages for 'raw'.

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

  • ImportError using nose, no ImportError using raw unittest ?

    - by southof40
    I get an ImportError when running my unittests using Nose and I don't when I just run it standalone. All files referred to here may be seen at http://gist.github.com/395541# . If I run the test script, importTest-Test.py, directly I get this output: C:\usr\x\data\src\Python\mmm>python importTest-Test.py In mmdb In BusinessLogic [] . ---------------------------------------------------------------------- Ran 1 test in 0.001s If I allow Nose to run it I get an error : C:\usr\x\data\src\Python\mmm>nosetests.exe E ====================================================================== ERROR: Failure: ImportError (No module named mmdb.DataAccess.AttemptDB) ---------------------------------------------------------------------- Traceback (most recent call last): File "c:\bin\installed\python2.6\lib\site-packages\nose-0.11.3-py2.6.egg\nose\loader.py", line 382, in loadTestsFromName addr.filename, addr.module) File "c:\bin\installed\python2.6\lib\site-packages\nose-0.11.3-py2.6.egg\nose\importer.py", line 39, in importFromPath return self.importFromDir(dir_path, fqname) File "c:\bin\installed\python2.6\lib\site-packages\nose-0.11.3-py2.6.egg\nose\importer.py", line 86, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File "C:\usr\x\data\src\Python\mmm\importtest-Test.py", line 2, in <module> import importtest File "C:\usr\x\data\src\Python\mmm\importtest.py", line 1, in <module> from mmdb.BusinessLogic.AttemptManager import AttemptManager File "C:\usr\x\data\src\Python\mmm\mmdb\BusinessLogic\AttemptManager.py", line 1, in <module> from mmdb.DataAccess.AttemptDB import AttemptDB ImportError: No module named mmdb.DataAccess.AttemptDB ---------------------------------------------------------------------- Ran 1 test in 0.002s FAILED (errors=1) The files involved in the package which nose is having difficulties with are in the following structure - some may be seen here http://gist.github.com/395541# .: mmm\importtest-Test.py mmm\importtest.py mmm\mmdb mmm\__init__.py mmm\mmdb\BusinessLogic mmm\mmdb\BusinessObject mmm\mmdb\DataAccess mmm\mmdb\__init__.py mmm\mmdb\BusinessLogic\AttemptManager.py mmm\mmdb\BusinessLogic\Collections mmm\mmdb\BusinessLogic\__init__.py mmm\mmdb\BusinessLogic\Collections\__init__.py mmm\mmdb\BusinessObject\__init__.py mmm\mmdb\DataAccess\AttemptDB.py mmm\mmdb\DataAccess\__init__.py This is happening on Win32 / Python 2.6 / Nose 0.11.3 . I'd be grateful for any help. thanks.

    Read the article

  • Flex/Flash 4 datagrid displays raw xml

    - by Setori
    Problem: Flex/Flash4 client (built with FlashBuilder4) displays the xml sent from the server exactly as is - the datagrid keeps the format of the xml. I need the datagrid to parse the input and place the data in the correct rows and columns of the datagrid. flow: click on a date in the tree and it makes a server request for batch information in xml form. Using a CallResponder I then update the datagrid's dataProvider. [code] <fx:Script> <![CDATA[ import mx.controls.Alert; [Bindable]public var selectedTreeNode:XML; public function taskTreeChanged(event:Event):void { selectedTreeNode=Tree(event.target).selectedItem as XML; var searchHubId:String = selectedTreeNode.@hub; var searchDate:String = selectedTreeNode.@lbl; if((searchHubId == "") || (searchDate == "")){ return; } findShipmentBatches(searchDate,searchHubId); } protected function findShipmentBatches(searchDate:String, searchHubId:String):void{ findShipmentBatchesResult.token = actWs.findShipmentBatches(searchDate, searchHubId); } protected function updateBatchDataGridDP():void{ task_list_dg.dataProvider = findShipmentBatchesResult.lastResult; } ]]> </fx:Script> <fx:Declarations> <actws:ActWs id="actWs" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/> <s:CallResponder id="findShipmentBatchesResult" result="updateBatchDataGridDP()"/> </fx:Declarations> <mx:AdvancedDataGrid id="task_list_dg" width="100%" height="95%" paddingLeft="0" paddingTop="0" paddingBottom="0"> <mx:columns> <mx:AdvancedDataGridColumn headerText="Receiving date" dataField="rd"/> <mx:AdvancedDataGridColumn headerText="Msg type" dataField="mt"/> <mx:AdvancedDataGridColumn headerText="SSD" dataField="ssd"/> <mx:AdvancedDataGridColumn headerText="Shipping site" dataField="sss"/> <mx:AdvancedDataGridColumn headerText="File name" dataField="fn"/> <mx:AdvancedDataGridColumn headerText="Batch number" dataField="bn"/> </mx:columns> </mx:AdvancedDataGrid> //xml example from server <batches> <batch> <rd>2010-04-23 16:31:00.0</rd> <mt>SC1REVISION01</mt> <ssd>2010-02-18 00:00:00.0</ssd> <sss>100000009</sss> <fn>Revision 1-DF-Ocean-SC1SUM-Quanta-PACT-EMEA-Scheduled Ship Date 20100218.csv</fn> <bn>10041</bn> </batch> <batches> [/code] and the xml is pretty much displayed exactly as is shown in the example above in the datagrid columns... I would appreciate your assistance.

    Read the article

  • Fade HTML element with raw javascript

    - by jnkrois
    It's my second question of the day related to the same problem, so I apologize for that. I was able to put together a function to "fade out" an element, and it works just fine, my problem is that when I try to reverse it, so the element "fades in" it does not work. I've tried to change the obvious, but I can't understand what I'm doing wrong. My code so far is as follows: Given I have a "div" like so: <div id="test" style="width:200px; height:200px; display:block; opacity:1; background-color:red;"></div> The JavaScript function that I'm using to fade it out is: var getElement = document.getElementById('test'); function fadeOut(elem, speed){ if(!elem.style.opacity){ elem.style.opacity = 1; } var desvanecer = setInterval(function(){ elem.style.opacity -= .02; if(elem.style.opacity < 0){ clearInterval(desvanecer); } }, speed / 50); } fadeOut(getElement, 500); Could somebody take a look at this and let me know what I'm doing wrong, all I want to do is "FADE IN" an element to an opacity equal to "1". By the way, I can't use jQuery, however I'm eager to learn this way. Thanks

    Read the article

  • Raw FTP SSL with C#

    - by Chuck
    Hi, I'm trying to understand how SSL works. In my wish to make a small FTP client which supports SSL I've run into some problems: TcpClient FtpConnection = new TcpClient(FtpServer, FtpPort); NetworkStream FtpStream = FtpConnection.GetStream(); StreamReader FtpReader = new StreamReader(FtpStream); FtpWriter = new StreamWriter(IrcStream); send_cmd("AUTH SSL"); send_cmd is just a FtpWriter.WriteLine(text); FtpWriter.Flush(); function. My "problem" is this: First I need to make a (non-ssl) connection to the FTP, then tell it to do a ssl connection (AUTH SSL), and I would guess I then need to make a new connection - something like: TcpClient client = new TcpClient(FtpServer, FtpPort); SslStream sslStream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null); try { sslStream.AuthenticateAsClient("foobar"); } catch (AuthenticationException e) { MessageBox.Show("Authentication failed - closing the connection."); client.Close(); return; } Taken from msdn. I keep dying on handshake failed due to unexpected packet format (which I've tried googling, but all say it's because the author has connected to a wrong port), which I take as: The connection is not ssl until AUTH SSL is send to it. So my question is, how would i go about making this a "hybrid" connection so I can make an SSL connection to the server? Any help is greatly appreciated!

    Read the article

  • Converting raw bytes into audio sound

    - by Afro Genius
    In my application I inherit a javastreamingaudio class from the freeTTS package then bypass the write method which sends an array of bytes to the SourceDataLine for audio processing. Instead of writing to the data line, I write this and subsequent byte arrays into a buffer which I then bring into my class and try to process into sound. My application processes sound as arrays of floats so I convert to float and try to process but always get static sound back. I am sure this is the way to go but am missing something along the way. I know that sound is processed as frames and each frame is a group of bytes so in my application I have to process the bytes into frames somehow. Am I looking at this the right way? Thanx in advance for any help.

    Read the article

  • Accessing JSon raw tokens in C# ?

    - by user318332
    My json string looks like { abc: 123, def: 442, ghi=444 } - say stock list. I dont know what quotes are coming in , i.e I dont know what is abc, def etc is. I need to get this token dynamically. Any pointers would be of great help ! BTW, this has to run in silverlight.

    Read the article

  • How can I get the nickname and message from raw IRC data in vb.net

    - by Rob
    Well basically I've got a vb.net script connecting to IRC, and I'm working on making it a basic chat system, but I've run into a problem. Say I receive this: :[email protected] PRIVMSG #channel :message I want to grab specific information to output to the user. I want to grab nickname and message How can I go about doing this? I thought about using regex, but I can't figure out how to make regex grab message since there's nothing after it.

    Read the article

  • how to learn winsock or raw sockets? (c++)

    - by blood
    i have been googleing trying to find a Winsock book or something about networking but all i can find is out of date books or nothing at all :( so does anyone know a book i can buy to learn about networking in VC++ 2008? i really would like a book i could hold because i learn better when it's in my hand.

    Read the article

  • What exactly does raw microphone data represent?

    - by esperantist
    I'm using PyAudio, a PortAudio wrapper for Python. I'm getting data from a microphone. Data which is represented by a continuous stream of bytes divided into chunks (of a size determined by me). I've tried to plot the signal, assuming the bytes represent the current signal amplitude, but I get an interesting image that I can't easily describe. ^^ It seems to be composed of two waves, one shifted from the other. What exactly do the particular bytes represent, and how does this change when I'm recording only one channel, instead of two? Any explanations, suggestions, code snippets, anything, very welcome! (I'm new at this.) Thanks!

    Read the article

  • Raw Video file from website

    - by Charlie
    I would like to make an app that will download videos files that can be played later. At first i thought I could have a UIWeb view and then try to access the cache of it and get the file that way but unfortunately i don't have access to that. After trying that my next thought would be get the direct link to the video file. Essentially what download helper does on fire fox. Any idea of where i could look at for help or any body have any better idea? Is there any stringByEvaluatingjavascript that might be of use or is there away to access the cache on a webview in your own app? Thanks for any help!

    Read the article

  • Rails: Extracting the raw url from the request

    - by pankajbhageria
    I am working with Rails 2.2. The required behaviour is as follows: I have a link(with a ajax link embedded) xyz.com/admin#page1 When I go to the above page, I should be redirected to the login page, if I am not logged in. After I log in, I should be taken back to xyz.com/admin#page1 For this I need to store the url in session when I visit any page. The problem is that when I do request.uri, I get xyz.com/admin But I want to store xyz.com/admin#page1 Regards, Pankaj

    Read the article

  • Providing raw MP3/AAC data to Flex/Flash from a custom container

    - by Joonas Trussmann
    Having had a quick look at the Flex docs I can't seem to find any reference to providing audio content to be played from a custom (possibly encrypted - don't worry, it's not that evil) container format. Is this possible and if so, could someone point me in the right direction. Or if that's not possible, some way to hook into the disk/network (disk is much more important in this case) I/O of the sound playing mechanism to provide a supported container in memory from a custom wrapper.

    Read the article

  • why is there {Raw,Safe,}Configparser in Python 3

    - by Tshepang
    Am surprised there's 3 different forms: RawConfigParser, SafeConfigParser and ConfigParser. I read the differences but why isn't everyone using SafeConfigParser, since it seems, well, safe? I can understand that in the case for Python 2 that the other two were kept for backward compatibility.

    Read the article

  • GCC problem with raw double type comparisons

    - by Monomer
    I have the following bit of code, however when compiling it with GCC 4.4 with various optimization flags I get some unexpected results when its run. #include <iostream> int main() { const unsigned int cnt = 10; double lst[cnt] = { 0.0 }; const double v[4] = { 131.313, 737.373, 979.797, 731.137 }; for(unsigned int i = 0; i < cnt; ++i) { lst[i] = v[i % 4] * i; } for(unsigned int i = 0; i < cnt; ++i) { double d = v[i % 4] * i; if(lst[i] != d) { std::cout << "error @ : " << i << std::endl; return 1; } } return 0; } when compiled with: "g++ -pedantic -Wall -Werror -O1 -o test test.cpp" I get the following output: "error @ : 3" when compiled with: "g++ -pedantic -Wall -Werror -O2 -o test test.cpp" I get the following output: "error @ : 3" when compiled with: "g++ -pedantic -Wall -Werror -O3 -o test test.cpp" I get no errors when compiled with: "g++ -pedantic -Wall -Werror -o test test.cpp" I get no errors I do not believe this to be an issue related to rounding, or epsilon difference in the comparison. I've tried this with Intel v10 and MSVC 9.0 and they all seem to work as expected. I believe this should be nothing more than a bitwise compare. If I replace the if-statement with the following: if (static_cast<long long int>(lst[i]) != static_cast<long long int>(d)), and add "-Wno-long-long" I get no errors in any of the optimization modes when run. If I add std::cout << d << std::endl; before the "return 1", I get no errors in any of the optimization modes when run. Is this a bug in my code, or is there something wrong with GCC and the way it handles the double type?

    Read the article

  • Rendering maps from raw SVG data in Java

    - by Lunikon
    In an application of mine I have to display locations and great circle paths in a map which is rendered to PNG and then displayed on the web. For this I simply use a world map (NASA's Blue Marbel in fact) scaled to various "zoom levels" as base image and only display the a part of it matching the final image size and fitting all items to be displayed. Straight forward so far. Now I came across Wikipedia's awesome blank SVG maps which contain all the country codes for easy reference and I was wondering whether it was possible to use those to have more customized colors and to highliht countries etc. So I did a bit of googling and was looking for Java libraries which would enable me to load the blank SVG map to memory allows for easy reference/selection of certain paths do manipulations of coloring, stroke widths etc render to a buffered image as the background for the great-circle paths/nodes What I came across quite often was Batik, but it looks like a really heavy framework and I'm not quite sure whether it is what I'm looking for. I have recently played around with Raphaël a bit and I like the way it handles working with vector graphics in code. If the Java framework for my purpose would feature a similar interface, that would be a nice-to-have. Any recommendations what toolset would be approriate for my purposes?

    Read the article

  • Avoid using InetAddress - Getting a raw IP address in network byte order

    - by Mylo
    Hey, I am trying to use the MaxMind GeoLite Country database on the Google App Engine. However, I am having difficulty getting the Java API to work as it relies on the InetAddress class which is not available to use on the App Engine. However, I am not sure if there is a simple workaround as it appears it only uses the InetAddress class to determine the IP of a given hostname. In my case, the hostname is always an IP anyway. What I need is a way to convert an IP address represented as a String into a byte array of network byte order (which the addr.getAddress() method of the InetAddress class provides). This is the code the current API uses, I need to find a way of removing all references to InetAddress whilst ensuring it still works! Thanks for your time. /** * Returns the country the IP address is in. * * @param ipAddress String version of an IP address, i.e. "127.0.0.1" * @return the country the IP address is from. */ public Country getCountry(String ipAddress) { InetAddress addr; try { addr = InetAddress.getByName(ipAddress); } catch (UnknownHostException e) { return UNKNOWN_COUNTRY; } return getCountry(bytesToLong(addr.getAddress())); }

    Read the article

  • an algorhithm for filtering out raw txt files

    - by Roman Luštrik
    Imagine you have a .txt file of the following structure: >>> header >>> header >>> header K L M 200 0.1 1 201 0.8 1 202 0.01 3 ... 800 0.4 2 >>> end of file 50 0.1 1 75 0.78 5 ... I would like to read all the data except lines denoted by >>> and lines below the >>> end of file line. So far I've solved this using read.table(comment.char = ">", skip = x, nrow = y) (x and y are currently fixed). This reads the data between the header and >>> end of file. However, I would like to make my function a bit more plastic regarding the number of rows. Data may have values larger than 800, and consequently more rows. I could scan or readLines the file and see which row corresponds to the >>> end of file and calculate the number of lines to be read. What approach would you use?

    Read the article

  • get metadata from jpg, dng and arw raw files

    - by Daniel
    I was wondering if anyone new how to get access the metadata (the date in particular) from jpg, arw and dng files. I've recently lost the folder structure after a merge operation gone-bad and would like to rename the recovered files according to the metadata. I'm planning on creating a little C++ app to dig into each file and get the metadata. any input is appreciated. ( alternatively, if you know of an app that already does this I'd like to know :)

    Read the article

  • Linux tool to send raw data to a TCP server

    - by paul simmons
    Hi, I am aware that this is not a direct 'development' question but I need that info to test a development project, so I think someone could've hit similar problem. I will test a software that runs a TCP server and according to sent commands replies some answers. I will test the software and do not want to write code if it doesn't work well. So I want to send those commands and test drive the server software. How can I achieve this with a Linux box?

    Read the article

  • Mixing C and C++, raw pointers and (boost) shared pointers

    - by oompahloompah
    I am working in C++ with some legacy C code. I have a data structure that (during initialisation), makes a copy of the structure pointed to a ptr passed to its initialisation pointer. Here is a simplification of what I am trying to do - hopefully, no important detail has been lost in the "simplification": /* C code */ typedef struct MyData { double * elems; unsigned int len; }; int NEW_mydata(MyData* data, unsigned int len) { // no error checking data->elems = (double *)calloc(len, sizeof(double)); return 0; } typedef struct Foo { MyData data data_; }; void InitFoo(Foo * foo, const MyData * the_data) { //alloc mem etc ... then assign the STRUCTURE foo.data_ = *thedata ; } C++ code ------------- typedef boost::shared_ptr<MyData> MyDataPtr; typedef std::map<std::string, MyDataPtr> Datamap; class FooWrapper { public: FooWrapper(const std::string& key) { MyDataPtr mdp = dmap[key]; InitFoo(&m_foo, const_cast<MyData*>((*mdp.get()))); } ~FooWrapper(); double get_element(unsigned int index ) const { return m_foo.elems[index]; } private: // non copyable, non-assignable FooWrapper(const FooWrapper&); FooWrapper& operator= (const FooWrapper&); Foo m_foo; }; int main(int argc, char *argv[]) { MyData data1, data2; Datamap dmap; NEW_mydata(&data1, 10); data1->elems[0] = static_cast<double>(22/7); NEW_mydata(&data2, 42); data2->elems[0] = static_cast<double>(13/21); boost::shared_ptr d1(&data1), d2(&data2); dmap["data1"] = d1; dmap["data2"] = d2; FooWrapper fw("data1"); //expect 22/7, get something else (random number?) double ret fw.get_element(0); } Essentially, what I want to know is this: Is there any reason why the data retrieved from the map is different from the one stored in the map?

    Read the article

  • tcp checksum and tcp offloading

    - by scatman
    i am using raw sockets to create my own socket. i need to set the tcp_checksum. i have tried a lot of references but all are not working (i am using wireshark for testing). could you help me please. by the way, i read somewhere that if you set tcp_checksum=0. then the hardware will calculate the checksum automatically for you. is this true? i tried it, but in wireshark the tcp_checksum gives a value of 0X000 and says tcp offload. i also read about tcp offloading, and didn't understand, is it only that wireshark is cannot check an offloaded tcp checksum, but there is a correct one??

    Read the article

  • How to implement bridging/NAT on linux? [closed]

    - by mikepurvis
    What I have is a network topology which looks like this: ------ PC --- IP Camera The PC has two ethernet interfaces, and is hosting a small webserver providing some auxiliary data. The issue is that the server on the PC runs on port 80, and the IP Camera is also running on port 80. Currently, we are bridging them, so that the PC's server is accessible at 192.168.0.2 and the camera at 192.168.0.3. However, what I'm trying to explore is the feasibility of using the PC to expose them both on the PC's IP, ideally both on port 80. Can this be done with regular sockets, or will it be necessary to use raw sockets?

    Read the article

  • What is Camera Raw, and Why Would a Professional Prefer it to JPG?

    - by Eric Z Goodnight
    A common setting on many digital cameras, RAW is a filetype option many professional photographers prefer over JPG, despite a huge disparity in filesize. Find out why, what RAW is, and how you can benefit using this professional quality filetype Latest Features How-To Geek ETC How To Boot 10 Different Live CDs From 1 USB Flash Drive The 20 Best How-To Geek Linux Articles of 2010 The 50 Best How-To Geek Windows Articles of 2010 The 20 Best How-To Geek Explainer Topics for 2010 How to Disable Caps Lock Key in Windows 7 or Vista How to Use the Avira Rescue CD to Clean Your Infected PC Enjoy Old School Style Video Game Fun with Chicken Invaders Hide the Twitter “Litter” in Twitter’s Sidebar Area (Chrome and Iron) Public Domain Day: Reflections on Copyright and the Importance of Public Domain Angry Birds Coming to PS3 and PSP This Week I Hate Mondays Wallpaper for That First Day Back at Work Tune Pop Enhances Android Music Notifications

    Read the article

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