Search Results

Search found 27946 results on 1118 pages for 'output buffer empty'.

Page 57/1118 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • Problem setting output flags for ALU in "Nand to Tetris" course

    - by MahlerFive
    Although I tagged this homework, it is actually for a course which I am doing on my own for free. Anyway, the course is called "From Nand to Tetris" and I'm hoping someone here has seen or taken the course so I can get some help. I am at the stage where I am building the ALU with the supplied hdl language. My problem is that I can't get my chip to compile properly. I am getting errors when I try to set the output flags for the ALU. I believe the problem is that I can't subscript any intermediate variable, since when I just try setting the flags to true or false based on some random variable (say an input flag), I do not get the errors. I know the problem is not with the chips I am trying to use since I am using all builtin chips. Here is my ALU chip so far: /** * The ALU. Computes a pre-defined set of functions out = f(x,y) * where x and y are two 16-bit inputs. The function f is selected * by a set of 6 control bits denoted zx, nx, zy, ny, f, no. * The ALU operation can be described using the following pseudocode: * if zx=1 set x = 0 // 16-bit zero constant * if nx=1 set x = !x // Bit-wise negation * if zy=1 set y = 0 // 16-bit zero constant * if ny=1 set y = !y // Bit-wise negation * if f=1 set out = x + y // Integer 2's complement addition * else set out = x & y // Bit-wise And * if no=1 set out = !out // Bit-wise negation * * In addition to computing out, the ALU computes two 1-bit outputs: * if out=0 set zr = 1 else zr = 0 // 16-bit equality comparison * if out<0 set ng = 1 else ng = 0 // 2's complement comparison */ CHIP ALU { IN // 16-bit inputs: x[16], y[16], // Control bits: zx, // Zero the x input nx, // Negate the x input zy, // Zero the y input ny, // Negate the y input f, // Function code: 1 for add, 0 for and no; // Negate the out output OUT // 16-bit output out[16], // ALU output flags zr, // 1 if out=0, 0 otherwise ng; // 1 if out<0, 0 otherwise PARTS: // Zero the x input Mux16( a=x, b=false, sel=zx, out=x2 ); // Zero the y input Mux16( a=y, b=false, sel=zy, out=y2 ); // Negate the x input Not16( in=x, out=notx ); Mux16( a=x, b=notx, sel=nx, out=x3 ); // Negate the y input Not16( in=y, out=noty ); Mux16( a=y, b=noty, sel=ny, out=y3 ); // Perform f Add16( a=x3, b=y3, out=addout ); And16( a=x3, b=y3, out=andout ); Mux16( a=andout, b=addout, sel=f, out=preout ); // Negate the output Not16( in=preout, out=notpreout ); Mux16( a=preout, b=notpreout, sel=no, out=out ); // zr flag Or8way( in=out[0..7], out=zr1 ); // PROBLEM SHOWS UP HERE Or8way( in=out[8..15], out=zr2 ); Or( a=zr1, b=zr2, out=zr ); // ng flag Not( in=out[15], out=ng ); } So the problem shows up when I am trying to send a subscripted version of 'out' to the Or8Way chip. I've tried using a different variable than 'out', but with the same problem. Then I read that you are not able to subscript intermediate variables. I thought maybe if I sent the intermediate variable to some other chip, and that chip subscripted it, it would solve the problem, but it has the same error. Unfortunately I just can't think of a way to set the zr and ng flags without subscripting some intermediate variable, so I'm really stuck! Just so you know, if I replace the problematic lines with the following, it will compile (but not give the right results since I'm just using some random input): // zr flag Not( in=zx, out=zr ); // ng flag Not( in=zx, out=ng ); Anyone have any ideas? Edit: Here is the appendix of the book for the course which specifies how the hdl works. Specifically look at section 5 which talks about buses and says: "An internal pin (like v above) may not be subscripted". Edit: Here is the exact error I get: "Line 68, Can't connect gate's output pin to part". The error message is sort of confusing though, since that does not seem to be the actual problem. If I just replace "Or8way( in=out[0..7], out=zr1 );" with "Or8way( in=false, out=zr1 );" it will not generate this error, which is what lead me to look up in the appendix and find that the out variable, since it was derived as intermediate, could not be subscripted.

    Read the article

  • RichFaces rich:insert takes a long time to output large files

    - by Mark Lewis
    Hello I'm using a RichFaces <rich:insert like this: <rich:panel header="my head"> <a4j:outputPanel ajaxRendered="true"> <rich:insert src="#{MyBacking.myPath}" highlight="groovy" /> </a4j:outputPanel> </rich:panel> If I have a 60k file to output, it takes 23 seconds. I've got a requirement to output the contents of some larger files than that and obviously the larger the file, the larger the wait for content. The recommendation in the answer to another related question is to introduce paging. I will, but the question is, why does it take so long to output 60k of text using JSF/RichFaces? That is, reading off a local disk with Windows XP SP2 PC - I can see from the log the data has already been written to disk from the network. Other scripting languages appear to be faster than this - is it something to do with the JSF lifecycle having to handle the text maybe? Thanks

    Read the article

  • Disable debug output in libxml2 and xmlsec

    - by ereOn
    Hi, In my software, I use libxml2 and xmlsec to manipulate (obviously) XML data structures. I mainly use XSD schema validation and so far, it works well. When the data structure input by the client doesn't match the XSD schema, libxml2 (or xmlsec) output some debug strings to the console. Here is an example: Entity: line 1: parser error : Start tag expected, '<' not found DUMMY<?xml ^ While those strings are useful for debugging purposes, I don't want them to appear and polute the console output in the released software. So far, I couldn't find an official way of doing this. Do you know how to suppress the debug output or (even better) to redirect it to a custom function ? Many thanks.

    Read the article

  • STAThread and Process output capture in c#

    - by alex
    Hi: This is a strange problem I encountered. I have an window application written in c# to do testing. It has a MDI parent form that is hosting a few children forms. One of the forms launch test cripts by creating processes and capture the scripts output to a text box. Another form open serial port and monitoring the status of the device I am working on(like a shell). If I ran both of them together, the output of the script seems only appear in the text box after the test is done. However, If I don't open the serial port form, the output of the script is captured in real time. Does anyone knows what's causing the problem? I notice the onDataReceived even handler for serial port form has a [STAThread] header to it. Will this cause the serial port thread having higher priority than other processes? Thanks in advance.

    Read the article

  • Sharing output streams through a JNI interface

    - by Chris Conway
    I am writing a Java application that uses a C++ library through a JNI interface. The C++ library creates objects of type Foo, which are duly passed up through JNI to Java. Suppose the library has an output function void Foo::print(std::ostream &os) and I have a Java OutputStream out. How can I invoke Foo::print from Java so that the output appears on out? Is there any way to coerce the OutputStream to a std::ostream in the JNI layer? Can I capture the output in a buffer the JNI layer and then copy it into out?

    Read the article

  • PHP JSON encode output number as string

    - by mitch
    I am trying to output a JSON string using PHP and MySQL but the latitude and longitude is outputting as a string with quotes around the values. This causes an issue when I am trying to add the markers to a google map. Here is my code: $sql = mysql_query('SELECT * FROM markers WHERE address !=""'); $results = array(); while($row = mysql_fetch_array($sql)) { $results[] = array( 'latitude' =>$row['lat'], 'longitude' => $row['lng'], 'address' => $row['address'], 'project_ID' => $row['project_ID'], 'marker_id' => $row['marker_id'] ); } $json = json_encode($results); echo "{\"markers\":"; echo $json; echo "}"; Here is the expected output: {"markers":[{"latitude":0.000000,"longitude":0.000000,"address":"2234 2nd Ave, Seattle, WA","project_ID":"7","marker_id":"21"}]} Here is the output that I am getting: {"markers":[{"latitude":"0.000000","longitude":"0.000000","address":"2234 2nd Ave, Seattle, WA","project_ID":"7","marker_id":"21"}]} Notice the quotes around the latitude and longitude values.

    Read the article

  • cannot output a json encoded dict containing accents (noob inside)

    - by user296546
    Hi all, here is a fairly simple example wich is driving me nuts since a couple of days. Considering the following script: # -*- coding: utf-8 -* from json import dumps as json_dumps machaine = u"une personne émérite" print(machaine) output = {} output[1] = machaine jsonoutput = json_dumps(output) print(jsonoutput) The result of this from cli: une personne émérite {"1": "une personne \u00e9m\u00e9rite"} I don't understand why their such a difference between the two strings. i have been trying all sorts of encode, decode etc but i can't seem to be able to find the right way to do it. Does anybody has an idea ? Thanks in advance. Matthieu

    Read the article

  • How to fetch output when calling R using Qprocess or system

    - by SYK
    Hi Experts, I would like to execute a R script simply as R --file=x.R It runs well on the command line. However when I try the system call in C++ by QProcess::execute("R --file=x.R"); or system("R --file=x.R"); the program R runs and quits but I can't see the output the program is supposed to generate. If a program uses no stdout (such as R), how do I fetch the output after a system call either as a output file or in the program's own console? Thanks for your time.

    Read the article

  • Storing the HTML output from a local PHP file into a string using file_get_contents

    - by bobo
    There is a header.php file and it contains some php codes that return HTML. I know I can use require, include to echo the results, but what I want to do is to store its processed output string into a variable. In a page, I used: $headerHTML=file_get_contents('header.php'); Then I got the PHP code output rather than the processed HTML output. I know adding http:// would help. But I prefer to keep using relative path, how can I tell the function to treat the php file correctly?

    Read the article

  • Hashing a python method to regenerate output when method is modified

    - by Seth Johnson
    I have a python method that has a deterministic result. It takes a long time to run and generates a large output: def time_consuming_method(): # lots_of_computing_time to come up with the_result return the_result I modify time_consuming_method from time to time, but I would like to avoid having it run again while it's unchanged. [Time_consuming_method only depends on functions that are immutable for the purposes considered here; i.e. it might have functions from Python libraries but not from other pieces of my code that I'd change.] The solution that suggests itself to me is to cache the output and also cache some "hash" of the function. If the hash changes, the function will have been modified, and we have to re-generate the output. Is this possible or a ridiculous idea? If this isn't a terrible idea, is the best implementation to write f = """ def ridiculous_method(): a = # # lots_of_computing_time return a """ , use the hashlib module to compute a hash for f, and use compile or eval to run it as code?

    Read the article

  • Capture output of another action within current action?

    - by wizzard
    I have been trying to find a way to capture the output (rendered view) of another action within the current action... something akin to output buffering. The scenario is that I need to save a "snapshot" of a report. The data used in the report is ever-changing, and for whatever reason I need to actually save the view HTML rather than just a data array. I have created a snapshotAction(), and I want to somehow capture the output of the separate reportAction() within it. I don't want to render the reportAction() to the screen, I want it to render within my current action, before the action completes. Is there any way to do this in ZF?

    Read the article

  • Advantage Data Architect doesn't accept 'output to', are there any other options for outputting a ta

    - by likesalmon
    I'm trying to output the results of a SELECT query to a tab delimited text file in Advantage Data Architect. I know I can use the 'Export to' feature to do this, but there are a lot of tables and that is going to take forever. I would rather use the SQL editor, but I found out it does not accept the OUTPUT TO argument, even though that command is part of Sybase SQL. I would like to do this: SELECT * FROM tablename; OUTPUT TO 'C:/ExportDirectory' DELIMITED BY '\t' FORMAT TEXT; Is there another way?

    Read the article

  • How do I set a property to the output of a command in msbuild/xbuild

    - by Nils
    In msbuild/xbuild I'd like to have a "libPath" property which can be ovveridden on the commandline using /p:libpath="/path/to/all/libs". But when this property is undefined I want to call pkg-config --retrieve-Path somePackage to get the current systems path. I thought like here I need the output of a command to be stored in a Property. The command always returns one line of output. I have tryied something like <PropertyGroup> <LibPath /> </PropertyGroup> <Task ....> <Exec Command="pkg-config --retrieve-Path somePackage" Condition="$(LibPath)' == ''"> <OutputTaskParameter="output" PropertyName="LibPath" /> </Exec> </Task> But that didn't work.

    Read the article

  • insert into several inheritance tables with OUTPUT - sql servr 2005

    - by csetzkorn
    Hi, I have a bunch of items – for simplicity reasons – a flat table with unique names seeded via bulk insert: create table #items ( ItemName NVARCHAR(255) ) The database has this structure: create table Statements ( Id INT IDENTITY NOT NULL, Version INT not null, FurtherDetails varchar(max) null, ProposalDateTime DATETIME null, UpdateDateTime DATETIME null, ProposerFk INT null, UpdaterFk INT null, primary key (Id) ) create table Item ( StatementFk INT not null, ItemName NVARCHAR(255) null, primary key (StatementFk) ) Here Item is a child of Statement (inheritance). I would like to insert items in #items using a set based approach (avoiding triggers and loops). Can this be achieved with OUTPUT in my scenario. A ‘loop based’ approach is just too slow where I use something like this: insert into Statements (Version, FurtherDetails, ProposalDateTime, UpdateDateTime, ProposerFk, UpdaterFk) VALUES (1, null, getdate(), getdate(), @user_id, @user_id) etc. This is a start for the OUTPUT based approach – but I am not sure whether this would work in my case as ItemName is only inserted into Item: insert into Statements ( Version, FurtherDetails, ProposalDateTime, UpdateDateTime, ProposerFk, UpdaterFk ) output inserted.Id ... ??? Thanks. Best wishes, Christian

    Read the article

  • Flex builder stopped generating the module swf in the output folder

    - by Yasmine
    Flex Builder suddenly stopped generating the swf of the modules in the output folder, the project properties is set to build automatically and all the modules are listed under Flex Modules in the project properties. I didn't change any configuration, I was working on a project and modifying modules and the swf files in the output folder where getting updated until suddenly I noticed that any modifications in the modules where not reflected when I run the application so I checked the swf files of the modules in the output folder I found that they don't get regenerated when the module is modified. I tried restarting the flex builder but nothing changed.

    Read the article

  • How do I output JSON columns in jQuery

    - by Mel
    I'm using the qTip jQuery plugin to create dynamic tool tips. The tooltip sends an id to a cfc which runs a query and returns data in JSON format. At the moment, the tooltip loads with the following: {"COLUMNS:" ["BOOKNAME","BOOKDESCRIPTION"["MYBOOK","MYDESC"]]} Here's the jQuery $('#catalog a[href]').each(function() { var gi = parseInt($(this).attr("href").split("=")[1]) $(this).qtip( { content: { url: 'cfcs/viewbooks.cfc?method=bookDetails', data: { bookID: gi }, method: 'get', title: { text: $(this).text(), button: 'Close' } }, api :{ onContentLoad : function(){ } }, }); }); As I mentioned, the data is returned successfully, but I am unsure how to output it and format it with HTML. I tried adding content: '<p>' + data.BOOKNAME + '' to api :{ onContentLoad : function(){ ..... to see if I could get it to output something, but I get a 'data is undefined error' What is the correct way to try and output this data with html formatting? Many thanks!

    Read the article

  • Can't read output of httpservice

    - by tag
    I have an HTTPservice that uses id="myhttp" url="site.com/script.php" method="POST" resultFormat="xml" script.php returns $output = '' . $worked . ''; echo $output; Problem is when I try to read worked, it tells me the variable worked is not there event.result.worked myhttp.lastResult.worked The only thing that works is using toString() myhttp.lastResult.toString() or event.result.toString() What am I doing wrong? I plan to add other variables to the output time, so need to access each time and worked separately. I may also need to return multiple responses each with their own worked and time values. How do I do that. I was thinking to not use XML. Is there a more lightweight option. Flex shows I have the following options: array e4x flashvars object text xml

    Read the article

  • How to maipulate the shell output in php

    - by Mirage
    I am trying to write php script which does some shell functions like reporting. So i am starting with diskusage report I want in following format drive path ------------total-size --------free-space Nothing else My script is $output = shell_exec('df -h -T'); echo "<pre>$output</pre>"; and its ouput is like below Filesystem Type Size Used Avail Use% Mounted on /dev/sda6 ext3 92G 6.6G 81G 8% / none devtmpfs 3.9G 216K 3.9G 1% /dev none tmpfs 4.0G 176K 4.0G 1% /dev/shm none tmpfs 4.0G 1.1M 4.0G 1% /var/run none tmpfs 4.0G 0 4.0G 0% /var/lock none tmpfs 4.0G 0 4.0G 0% /lib/init/rw /dev/sdb1 ext3 459G 232G 204G 54% /media/Server /dev/sdb2 fuseblk 466G 254G 212G 55% /media/BACKUPS /dev/sda5 fuseblk 738G 243G 495G 33% /media/virtual_machines How can i convert that ouput into my forn\matted output

    Read the article

  • Diagonal Output of Assembly programe

    - by Yousuf Umar
    i have this assembly programe and i want to diagonal ouptut of this programe but i dont know how to put tabspace in assembly section .text global _start ;must be declared for using gcc _start: ;tell linker entry point mov edx, len ;message length mov ecx, msg ;message to write mov ebx, 1 ;file descriptor (stdout) mov eax, 4 ;system call number (sys_write) int 0x80 ;call kernel mov eax, 1 ;system call number (sys_exit) int 0x80 ;call kernel section .data msg db 'Y',10,'O',10,'U',10,'S',10,'U',10,'F' ;our dear string len equ $ - msg ;length of our dear string output of my programe is Y O U S U F output shoud like this Y O U S U F or is there any other way to write this programe and get this output

    Read the article

  • Hashing a python function to regenerate output when the function is modified

    - by Seth Johnson
    I have a python function that has a deterministic result. It takes a long time to run and generates a large output: def time_consuming_function(): # lots_of_computing_time to come up with the_result return the_result I modify time_consuming_function from time to time, but I would like to avoid having it run again while it's unchanged. [time_consuming_function only depends on functions that are immutable for the purposes considered here; i.e. it might have functions from Python libraries but not from other pieces of my code that I'd change.] The solution that suggests itself to me is to cache the output and also cache some "hash" of the function. If the hash changes, the function will have been modified, and we have to re-generate the output. Is this possible or ridiculous? Updated: based on the answers, it looks like what I want to do is to "memoize" time_consuming_function, except instead of (or in addition to) arguments passed into an invariant function, I want to account for a function that itself will change.

    Read the article

  • Supplying output parameter to sqlparametercollection resulting in error (Varbinary)

    - by dotnetdev
    Hi, I want to supply an output parameter to my stored proc. This output proc is returning byte[]. How do I do this? If I do the following: command.Parameters.Add(new SqlParameter("@Bytes", SqlDbType.VarBinary)); command.Parameters[1].Direction = ParameterDirection.Output; I get: System.InvalidOperationException: Byte[][1]: the Size property has an invalid size of 0. This stored proc works fine in SQL Server when I execute it via the SSMS option "Execute Stored Procedure). Any ideas? Thanks

    Read the article

  • File won't save output to file, and prints out a string oddly C++ Linux

    - by Predictability
    I'm trying to make a password code, the user enters a password, then it will save the password to a file in /tmp/ and then it will output the password (For me so I can find bugs). I have included the "string" library, and I set the password type to string, but when I output it, it outputs like this: 0x7fffb55baac0password // <-- thats the password I entered It will output hex (I think), then the password I entered, and it won't save it to the file in /tmp/ I want it to (Or any file in /tmp/). Here's the source code: http://codepad.org/3aamAv7R Thank you for all the help you guys have given me so far.

    Read the article

  • javascript not loading after output of PHP file_get_contents() string

    - by mives
    I have the following structure: -uploadpage.html -index.php -resources -jquery.1.4.2.min.js On my index.php, I get the contents then output uploadpage.html through this code: $output = file_get_contents("uploadpage.html"); echo $output; My upload.html has the javascript at the bottom: <script type="text/javscript" src="./resources/jquery-1.4.2.min.js"></script> <script type="text/javascript"> $(document).ready( function() { callSomething(); } ); function callSomething() {return true;} </script> However this results in an error "$ is not defined" which means that the jquery js file is not loaded. Any ideas?

    Read the article

  • Save the output of a command in a string in linux using python

    - by user1657901
    I am using Fedora 17 xfce and I am programming in Python 2.7.3. Fedora uses a package manager called yum. I have a python script that searches for packages like this: import os package = raw_input("Enter package name to search: ") os.system("yum list " + package) So I want python to check if in the output of this command exists the words "No matching packages to list". I checked a similar question and I tried some methods [http://stackoverflow.com/questions/2502833/python-store-output-of-subprocess-call-in-a-string][1] but the string contained only the first line of the output. Thanks in advance

    Read the article

  • ColdFusion debugging output in my Ajax

    - by cf_PhillipSenn
    If I turn off "Enable Request Debugging Output", the 3rd option under the Debug Output Settings, then I no longer get debug info in my $.ajax call to a cfc with access="remote". That's good, but I'd like to keep it turned on for all my other programs and turn it off programatically for this one exception. I put <cfsetting showdebugoutput="false"> at the top of my Index.cfm, but that didn't turn off the debug output coming from the cfc. Oh wait. Never mind. I had to put the in the function rather than in Index.cfm.

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >