Search Results

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

Page 106/1118 | < Previous Page | 102 103 104 105 106 107 108 109 110 111 112 113  | Next Page >

  • ActionScript 3.0 Color Output Error?

    - by TheDarkIn1978
    I'm employing color in a current AS3 project, and have come across what appears to be an error in the Flash Player (version 10). it might also be an error with Apple's DigitalColor Meter (version 3.7.2), which is what i'm using to sample the displayed colors on Mac OS X Snow Leopard (version 10.6.3). //Primary, secondary, and tertiary colors of the RGB color wheel var red:Number = 0xFF0000; var orange:Number = 0xFF7D00; var yellow:Number = 0xFFFF00; var chartreuse:Number = 0x7DFF00; var green:Number = 0x00FF00; var spring:Number = 0x00FF7D; var cyan:Number = 0x00FFFF; var azure:Number = 0x007DFF; //reads 0x0077FF var blue:Number = 0x0000FF; var violet:Number = 0x7D00FF; var magenta:Number = 0xFF00FF; //reads 0xFF00F8 var rose:Number = 0xFF007D; //reads 0xFF0077 all of these colors display normally except for 3: Azure, Magenta and Rose. they are coded with the appropriate number, but when i use the color meter to sample the displayed colors, those 3 return inaccurate results. anyone have any insight about this issue? what is causing the error, the Flash runtime or the color sampler? if it's the Flash player, could this problem be much deeper? *sampling this image will return inaccurate results due to .jpg compression. it's simply for illustration

    Read the article

  • Reading and writing in parallel

    - by Malfist
    I want to be able to read and write a large file in parallel, or if not in parallel, at least in blocks so that I don't use up so much memory. This is my current code: // Define memory stream which will be used to hold encrypted data. MemoryStream memoryStream = new MemoryStream(); // Define cryptographic stream (always use Write mode for encryption). CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write); //start encrypting using (BinaryReader reader = new BinaryReader(File.Open(fileIn, FileMode.Open))) { byte[] buffer = new byte[1024 * 1024]; int read = 0; do { read = reader.Read(buffer, 0, buffer.Length); cryptoStream.Write(buffer, 0, read); } while (read == buffer.Length); } // Finish encrypting. cryptoStream.FlushFinalBlock(); // Convert our encrypted data from a memory stream into a byte array. //byte[] cipherTextBytes = memoryStream.ToArray(); //write our memory stream to a file memoryStream.Position = 0; using (BinaryWriter writer = new BinaryWriter(File.Open(fileOut, FileMode.Create))) { byte[] buffer = new byte[1024 * 1024]; int read = 0; do { read = memoryStream.Read(buffer, 0, buffer.Length); writer.Write(buffer, 0, read); } while (read == buffer.Length); } // Close both streams. memoryStream.Close(); cryptoStream.Close(); As you can see, it reads the entire file into memory, encrypts it, then writes it out. If I happen to be encrypting files that are very large (2GB+) it tends not to work, or at the very least, consumes ~97% of my memory. How could I do it in a more effective manner?

    Read the article

  • Problem with C function of type char pointer, can someone explain?

    - by JJ
    Find the errors from following C function : char* f(int i) { int i; char buffer[20]; switch ( i ) { 1: strcpy( buffer, "string1"); 2: strcpy( buffer, "string2"); 3: strcpy( buffer, "string3"); default: strcpy(buffer, "defaultstring"); } return buffer; } this is c funtion not C++, I think it has to do with type conversion my compiler give warning that declaration of int i shadows a parameter.

    Read the article

  • Changing the output of Getdate

    - by pauloya
    Is it possible to deceive SQL Server to return a different date on GetDate() without actually changing the machine date? This would be great, since we have a database with old data and I'm trying to test some queries that use getdate(). I can change my machine date but that brings some other problems with other applications... Any tips? Thanks!

    Read the article

  • How to map keys in vim differently for different kinds of buffers

    - by Yogesh Arora
    The problem i am facing is that i have mapped some keys and mouse events for seraching in vim while editing a file. But those mappings impact the functionality if the quickfix buffer. I was wondering if it is possible to map keys depending on the buffer in which they are used. EDIT - I am adding more info for this question Let us consider a scenario. I want to map <C-F4> to close a buffer/window. Now this behavior could depend on a number of things. If i am editing a buffer it should just close that buffer without changing the layout of the windows. I am using buffkil plugin for this. It does not depend on extension of file but on the type of buffer. I saw in vim documentation that there are unlisted and listed buffer. So if it is listed buffer it should close using bufkill commands. If it is not a listed buffer it should use <c-w>c command to close buffer and changing the window layout. I am new at writing vim functions/scripts, can someone help me getting started on this

    Read the article

  • reading input file from server and displaying output on client side

    - by tazim
    Hi, I have to read a file from server side . Obtained its contents stored it in a list and sent it to template Now, My question is how to access this list so as to display the contents of files line by line . I am using ajax and jquery to obtain the data on client side def showfiledata(request): f = open("/home/tazim/webexample/test.txt") list = f.readlines() return_dict = {'list':list} json = simplejson.dumps(list) return HttpResponse(json,mimetype="application/json")

    Read the article

  • does mod_rewrite output have to exist?

    - by user788171
    I am trying to use mod_rewrite to generate cleaner urls. I have the following in my .htaccess Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^mypage.php$ https://%{HTTP_HOST}/mypage [R=301,L] The objective is to go from https://mysite.com/mypage.php to https://mysite.com/mypage This gives me a 404 error. I don't actually have the directory mypage/ existing. But from my understanding, I don't need to actually have mypage for mod_rewrite to work. What am I doing wrong?

    Read the article

  • writing output to a dropdown list

    - by sushant
    <% dim req_id req_id=Request.Form("Req_id") Set conn=server.CreateObject("adodb.connection") conn.Open session("Psrconnect") Set rs=CreateObject("Adodb.Recordset") rs.Open "select * from releases where project like '%"&req_id&"%'", conn %> <SELECT style="LEFT: 454px; WIDTH: 500px; TOP: 413px" name="txtrelease1" id="txtrelease1"> <% if rs.EOF=true then %> <OPTION value="NO Request to Edit">No Request to Edit</OPTION> <% else do while rs.EOF<>true p=InStrRev(rs.Fields(0),"\") q=Len(rs.Fields(0)) r=(Right(rs.Fields(0),(q-p))) %> <OPTION value=<%=rs.Fields(0)%>> r </OPTION> <% rs.movenext loop end if %> </SELECT> i want to right the value of r in the dropdown list. i dont know the syntax. as of now the drop down list shows "r" , not the value inside it. how to do it?

    Read the article

  • signature output operator overload

    - by coubeatczech
    hi, do you know, how to write signature of a function or method for operator<< for template class in C++? I want something like: template <class A class MyClass{ public: friend ostream & operator<<(ostream & os, MyClass<A mc); } ostream & operator<<(ostream & os, MyClass<A mc){ // some code return os; } But this just won't compile. Do anyone know, how to write it correctly?

    Read the article

  • python filter can't output

    - by Jesse Siu
    i create filter by python to the log file like Sat Jun 2 03:32:13 2012 [pid 12461] CONNECT: Client "66.249.68.236" Sat Jun 2 03:32:13 2012 [pid 12460] [ftp] OK LOGIN: Client "66.249.68.236", anon password "[email protected]" Sat Jun 2 03:32:14 2012 [pid 12462] [ftp] OK DOWNLOAD: Client "66.249.68.236", "/pub/10.5524/100001_101000/100022/readme.txt", 451 bytes, 1.39Kbyte/sec the script is import time lines=[] f= open("/opt/CLiMB/Storage1/log/vsftp.log") line = f.readline() lines=[line for line in f] def OnlyRecent(line): if time.strptime(line.split("[")[0].strip(),"%a %b %d %H:%M:%S %Y") < time.time()-(60*60*24*2): return True return False print"\n".join(filter(OnlyRecent,lines)) f.close() but when i run this script, it continue running but didn't show anything until i stop it. Why it can't shows records happened in 2 days.

    Read the article

  • Limit Output in C

    - by Tech163
    In C, I would like to limit the string to the first 8 characters. For example, I have: char out = printf("%c", str); How can I make it so it only returns the first 8 characters?

    Read the article

  • Spreadsheet_Excel_Writer large data output is damaged

    - by dr3w
    I use Spreadsheet_Excel_Writer to generate .xls file and it works fine until I have to deal with a large amount of data. On certain stage it just writes some nonsense chars and quits filling certain columns. However some columns are field up to the end (generally numeric data) I'm not quite sure how the xls document is formed: row by row, or col by col... Also it is obviously not an error in a string, because when i cut out some data, the error appears a little bit further. I think there is no need in all of my code here are some essentials $filename = 'file.xls'; $workbook = & new Spreadsheet_Excel_Writer(); $workbook->setVersion(8); $contents =& $workbook->addWorksheet('Logistics'); $contents->setInputEncoding('UTF-8'); $workbook->send($filename); //here is the part where I write data down $contents->write(0, 0, 'Field A'); $contents->write(0, 1, 'Field B'); $contents->write(0, 2, 'Field C'); $ROW=1; foreach($ordersArr as $key=>$val){ $contents->write($ROW, 0, $val['a']); $contents->write($ROW, 1, $val['b']); $contents->write($ROW, 2, $val['c']); $ROW++; } $workbook->close();

    Read the article

  • MVC: Structuring Feed Output

    - by Brian Wigginton
    The framework I'm using on my project follows the MVC Pattern. I"M building JSON feeds and need to structure them in a different way then what the system gives me by default from the ORM. Where should I be handling the task of mangling and shaping my data that I'll serve up, in the model, view or controller? Right now I'm doing it in my controller, then passing that data to the view. I can see this fitting better under the Model or the View but not sure which one.

    Read the article

  • Call stored proc using xml output from a table

    - by user263097
    Under a tight deadline and I know I can figure this out eventually but I don't have much time to do it on my own. I have a table that has columns for customer id and account number among many other additional columns. There could be many accounts for a single customer (Many rows with the same customer id but different account number). For each customer in the table I need to call a stored procedure and pass data from my table as xml in the following format. Notice that the xml is for all of the customers accounts. <Accounts> <Account> <AccountNumber>12345</AccountNumber> <AccountStatus>Open</AccountStatus> </Account> <Account> <AccountNumber>54321</AccountNumber> <AccountStatus>Closed</AccountStatus> </Account> </Accounts> So I guess I need help with 2 things. First, how to get the data in this xml format. I assuming I'll use some variation of FOR XML. The other thing is how do I group by customer id and then call a sproc for each customer id?

    Read the article

  • php add hours to date output wrong result

    - by i need help
    Basically what I want to do is to send an email to follow up on order placed in 3 hours later. What I try to do is to get the current date (up to hours level), then compare with the orderdate+ 3 hours, to see whether it match. Example orderdate: 2010-06-12 18, after add 3 hours should become 2010-06-12 21 However, after add hour, the final result sometimes become bigger, sometimes become smaller... something wrong. $now= date('Y-m-d H'); echo $now . "<br>"; ... ... while ($data = mysql_fetch_array ($result)) { $orderid = $data['orderid']; $orddate = $data['orddate']; $corddate= date('Y-m-d H:i:s', $orddate); $year = substr ($corddate, 0, 4); $month = substr ($corddate, 5, 2); $day = substr ($corddate, 8, 2); $hour = substr ($corddate, 11, 2); $actualorderdate= $year . "-" . $month . "-" . $day . " " . $hour; $new_time = mktime ($hour+3, 0, 0, $month, $day, $year); $year = date ('Y', $new_time); $month = date ('m', $new_time); $day= date ('d', $new_time); $hour= date ('h', $new_time); $xhourslater= $year . "-" . $month . "-" . $day . " " . $hour; echo "actualorderdate: ". $actualorderdate. " xhourslater: " . $xhourslater. "<br>"; if($now==$xhourslater) { echo "now is 3 hours later" . "<br>"; //send email follow up, then update status as sent, in order not to resend anytime in the 3rd hour. } }

    Read the article

  • !gcroot output leads nowhere

    - by Jeff Costa
    I am troubleshooting memory fragmentation in an app pool, as evidenced by a small number of Free objects consuming the most space on the heap: 0x000007ff00256728 6,543 3,890,208 System.Collections.Hashtable+bucket[] 0x000007ff002649a8 7,297 22,979,560 System.Byte[] 0x000007ff001e0d90 251,347 30,374,304 System.String 0x0000000001d0c830 373 48,036,816 Free Running the !dumpgen 3 command reveals the fragmentation; There is a repeating pattern of Free and System.Object objects of the same size: 000000017feb7350 24 **** FREE **** 000000017feb7368 8192 System.Object[] 000000017feb9368 24 **** FREE **** 000000017feb9380 8192 System.Object[] 000000017febb380 24 **** FREE **** 000000017febb398 8192 System.Object[] 000000017febd398 24 **** FREE **** 000000017febd3b0 8192 System.Object[] 000000017febf3b0 24 **** FREE **** 000000017febf3c8 8192 System.Object[] 000000017fec13c8 24 **** FREE **** 000000017fec13e0 8192 System.Object[] 000000017fec33e0 24 **** FREE **** 000000017fec33f8 8192 System.Object[] 000000017fec53f8 24 **** FREE **** 000000017fec5410 14024 System.Object[] 000000017fec8ad8 24 **** FREE **** 000000017fec8af0 8192 System.Object[] 000000017fecaaf0 24 **** FREE **** 000000017fecab08 8192 System.Object[] 000000017feccb08 24 **** FREE **** 000000017feccb20 8192 System.Object[] 000000017feceb20 24 **** FREE **** 000000017feceb38 8192 System.Object[] 000000017fed0b38 24 **** FREE **** 000000017fed0b50 8192 System.Object[] 000000017fed2b50 24 **** FREE **** 000000017fed2b68 8192 System.Object[] When I try to obtain the root of one of the System.Objects with !gcroot, I get a pinned handle, but no additional stack data: Scan Thread 41 OSThread 1044 DOMAIN(0000000001D51330):HANDLE(Pinned):15217e8:Root: 000000017fe60fe8(System.Object[]) As you can see, there is no additional data to go on. Running a !handle command also yields nothing: 0:041> !handle 000000017fe7a068 ff Handle 000000017fe7a068 Type <Error retrieving type> unable to query object information unable to query object information No object specific information available How can I trace out this memory leak when I cannot find what is rooting System.Object?

    Read the article

  • Sorting the output from XmlSerializer in C#

    - by prosseek
    In this post, I could get an XML file generated based on C# class. Can I reorder the XML elements based on its element? My code uses var ser = new XmlSerializer(typeof(Module)); ser.Serialize(WriteFileStream, report, ns); WriteFileStream.Close(); to get the XML file, but I need to have the XML file sorted based on a BlocksCovered variable. public class ClassInfo { public string ClassName; public int BlocksCovered; public int BlocksNotCovered; public double CoverageRate; public ClassInfo() {} public ClassInfo(string ClassName, int BlocksCovered, int BlocksNotCovered, double CoverageRate) { this.ClassName = ClassName; this.BlocksCovered = BlocksCovered; this.BlocksNotCovered = BlocksNotCovered; this.CoverageRate = CoverageRate; } } [XmlRoot("Module")] public class Module { [XmlElement("Class")] public List<ClassInfo> ClassInfoList; public int BlocksCovered; public int BlocksNotCovered; public string moduleName; public Module() { ClassInfoList = new List<ClassInfo>(); BlocksCovered = 0; BlocksNotCovered = 0; moduleName = ""; } } Module report = new Module(); ... TextWriter WriteFileStream = new StreamWriter(xmlFileName); XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); ns.Add("", ""); var ser = new XmlSerializer(typeof(Module)); ser.Serialize(WriteFileStream, report, ns); WriteFileStream.Close();

    Read the article

  • Reading a series of input / output in Python

    - by PulpFiction
    Hello everyone. For my app, I need to print out a series of outputs and then accepts inputs from the user. What would be the best way of doing this? Like: print '1' x = raw_input() print '2' y = raw_input() Something like this, but it would go on for at least 10 times. My only concern with doing the above is that it would make up for poor code readability. How should I do it? Should I create a function like this: def printOut(string): print string Or is there a better way?

    Read the article

  • How to save output from the shell?

    - by user2971553
    I want to save this in a file form the shell: Type the number of steps N 10 Type the initial values ti and ai 0 1 23.000000 24.000000 46.000000 576.000000 69.000000 13824.000000 92.000000 331776.000000 115.000000 7962624.000000 138.000000 191102976.000000 161.000000 4586471424.000000 184.000000 110075314176.000000 207.000000 2641807540224.000000 230.000000 63403380965376.000000 253.000000 1521681143169024.000000 how to do it? it does not work by just typing: >./a.out>lalalla.txt

    Read the article

  • Using Entity Framework V4 - Mapping Stored Procedures with XML output

    - by ericwahner
    I have been attempting to implement the Entity framework into my project and unfortunately it seems like mapping an XML result set from SQL is not something that is supported. I also have issues with returning multiple result sets, though I understand that the EFExtensions was created to try to mitigate that issue. Is there a way to take a FOR XML EXPLICIT result from a SQL Stored Procedure and map it using the Entity Framework?

    Read the article

  • Converting output of sql query

    - by phenevo
    Hi, Let say I have table Payments Id int autoincement Status int and my query is : select id, status from payments but I wanna convert status to enum. 0 is unpaid 1 is paid. so result should look like: 1 paid 2 unpaid 3 paid ... I need this conversion because I use XmlReader reader = cmd.ExecuteXmlReader(); oc.LoadXml("<results></results>"); XmlNode newNode = doc.ReadNode(reader); while (newNode != null) { doc.DocumentElement.AppendChild(newNode); newNode = doc.ReadNode(reader); } and then I save this xml and opening it by excel, and statuses should be friendly for user.

    Read the article

  • SQL SERVER 2005 Self Joins output

    - by user301751
    HI I am looking for some help I just can't seem to get my head how self joins work. I have this sql code select Persno'Name',convert(char(20), A_Date , 13)'Logins',acode from atrail as LOGIN where acode = 'LOGIN' OR acode = 'LOGOUT' order by a_date desc Which produces a list of User names and when the have logged in and out. What I am trying to acheive is to get anther column with the LOGOUT date next to the date they logged in date so that it is easyer to see when they logged in and out. Thanks Andy

    Read the article

< Previous Page | 102 103 104 105 106 107 108 109 110 111 112 113  | Next Page >