Search Results

Search found 16568 results on 663 pages for 'warning level'.

Page 36/663 | < Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >

  • VS2010 is removing code from designer without warning - causing issues

    - by schmoopy
    I have a WinForm with a pretty complex layout (has lots of controls, panels, etc.) Whenever i open the form the file is automatically checked out from source control and it removes anything in the designer file that refereces my menustrip or statusstrip ie: the following get removed (w/o warning) Me.MyMenuStip.SuspendLayout() Me.MyStatusStrip.SuspendLayout() Me.MyMenuStrip.ResumeLayout(False) Me.MyMenuStrip.PerformLayout() Me.MyStatusStrip.ResumeLayout(False) Me.MyStatusStrip.PerformLayout() The code still builds, but there are no Menu or Status items rendered. Any ideas on what i can do? I do not want to just remove/add the menustrip for instance cause i would loose all of my menu items (and there are a lot) Thanks in advance!

    Read the article

  • Warning as Error - How to rid these

    - by coffeeaddict
    I cannot figure out how to get rid of errors that basically should not be halting my compile in VS 2010 and should not be show stoppers, or at least I will fix them later but I don't want the compile to just error and halt on these kinds of problems. For example I'm getting the following error: Error 1 Warning as Error: XML comment on 'ScrewTurn.Wiki.SearchEngine.Relevance.Finalize(float)' has a paramref tag for 'IsFinalized', but there is no parameter by that name C:\www\Wiki\Screwturn3_0_2_509\SearchEngine\Relevance.cs 60 70 SearchEngine for this code: /// /// Normalizes the relevance after finalization. /// /// The normalization factor. /// If is false ( was not called). public void NormalizeAfterFinalization(float factor) { if(factor < 0) throw new ArgumentOutOfRangeException("factor", "Factor must be greater than or equal to zero"); if(!isFinalized) throw new InvalidOperationException("Normalization can be performed only after finalization"); value = value * factor; } I looked in Tools | Options and I don't see where I can tweak the compiler and tell it not to worry about comment or XHTML based errors.

    Read the article

  • nullable type and a ReSharper warning

    - by Sarah Vessels
    I have the following code: private static LogLevel? _logLevel = null; public static LogLevel LogLevel { get { if (!_logLevel.HasValue) { _logLevel = readLogLevelFromFile(); } return _logLevel.Value; } } private static LogLevel readLogLevelFromFile() { ... } I get a ReSharper warning on the return statement about a possible System.InvalidOperationException and it suggests I check _logLevel to see if it is null first. However, readLogLevelFromFile returns LogLevel, not LogLevel?, so there is no way the return statement could be reached when _logLevel is null. Is this just an oversight by ReSharper, or am I missing something?

    Read the article

  • Warning vs. error

    - by Samuel
    I had an annoying issue, getting a "Possible loss of precision" error when compiling my Java program on BlueJ (But from what i read this isn't connected to a specific IDE). I was surprised by the fact that the compiler told me there is a possible loss of precision and wouldnt let me compile/run the program. Why is this an error and not a warning saying you might loose precision here, if you don't want that change your code? The program runs just fine when i drop the float values, it wouldn't matter since there is no point (e.g [143.08, 475.015]) on my screen. On the other hand when i loop through an ArrayList and in this loop i have an if clause removing elements from the ArrayList it runs fine, just throws an error and doesn't display the ArrayList [used for drawing circles] for a fraction of a second. This appears to me as a severe error but doesn't cause (hardly) any troubles, while i wouldn't want to have such a thing in my code at all. What's the boundary?

    Read the article

  • inode_operations , warning: initialization from incompatible pointer type

    - by djTeller
    Hi everyone, I'm trying to compile a simple Kernel program that read and write from a proc file. I'm trying to set permission to that file by overriding the permission fp in inode_operations struct (.permission) static int module_permission(struct inode *inode, int op, struct nameidata *foo) { . . . } static struct inode_operations Inode_Ops_4_Our_Proc_File = { .permission = module_permission, /* check for permissions */ }; Our_Proc_File->proc_iops = &Inode_Ops_4_Our_Proc_File; For some reason, when I compile this i get - warning: initialization from incompatible pointer type on the following line: .permission = module_permission, /* check for permissions */ Any idea how to solve this? Thanks!

    Read the article

  • Warning that users of the function must handle

    - by Hagai
    I am looking for a way to set warning that the user will have to respond. In a sense I would like to use late exception mechanize that occur after the function already finished executing.and returned the wanted value. SomeObject Foo(int input) { SomeObject result; // do something. oh, we need to warn the user. return result; } void Main() { SomeObject object; object = Foo(1); // after copy consturctor is done I would like an exception to be thrown } EDIT: The title to users of the function

    Read the article

  • Warning: session_start(): Cannot send session cache limiter - headers already sent

    - by shyam
    I am receiving this warning in a page while I try starting the session. <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Video</title> </head> -this is the part of the code. There are no characters (not even space) before the first line. This page is reached after logging in from another page, through redirection. Any help? (PHP version is 5.2)

    Read the article

  • android: getting rid of "warning: unmappable character for encoding ascii"

    - by Lo'oris
    I'm compiling using android tools without eclipse. I compile launching "ant debug" from command line. I have found many many instructions around the web about how to remove with annoying warning, but I haven't been able to make any of them work. I've tried -D option, I've tried randomly tweaking build.* files, I've tried exporting an environment variable... nothing. I guess some of these methods just don't work, and some others would work but I've been doing them incorrectly. Anything is possible and I can't stand it any more: any advice on how to do it?

    Read the article

  • Reading in a file - Warning Message in R

    - by Sheila
    I have a file that has 22268 rows BY 2521 columns. When I try to read in the file using this line of code: file <- read.table(textfile, skip=2, header=TRUE, sep="\t", fill=TRUE, blank.lines.skip=FALSE) I get the following error: Warning message: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : number of items read is not a multiple of the number of columns I also used this command to see what rows had an incorrect number of columns: x <-count.fields("train.gct", sep="\t", skip=2) which(x != 2521) and got back a list of about 20 rows that were incorrect. Is there a way to fill these rows with NA values? I thought that is what the "fill" parameter does in the read.table function, but it doesn't appear so. Any help would be greatly appreciated. Thank you.

    Read the article

  • D_WIN32_WINNT compiler warning with Boost

    - by bobber205
    Not sure what to make of this error. Added -D_WIN32_WINNT=0x0501 to Visual Studio's "Command Line" options under Project Properties but it says it doesn't recognize it and the warning still appears. I am also not sure how to add the Preprocessor Definition. :) Thanks for any help! 1Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example: 1- add -D_WIN32_WINNT=0x0501 to the compiler command line; or 1- add _WIN32_WINNT=0x0501 to your project's Preprocessor Definitions.

    Read the article

  • Warning that users must handle

    - by hagaik
    I am looking for a way to set warning that the user will have to respond. In a sense I would like to use late exception mechanize that occur after the function already finished executing.and returned the wanted value. SomeObject Foo(int input) { SomeObject result; // do something. oh, we need to warn the user. return result; } void Main() { SomeObject object; object = Foo(1); // after copy consturctor is done I would like an exception to be thrown }

    Read the article

  • getUserPrincipal() in JCIFS / Lan-Manager authentitation level setting in Windows 2k8

    - by Chris
    I have to find out in which exact format JCIFS stores the user principal in the "getUserPrincipal()" property. Therefor i created a test Environment like this: Windows Server 2008 Domain Controller Domain named "MYDOMAIN" Many Testusers in Active Directory Tomcat Application Server with my Web Application (which simply reads the user Principal and displays its values). The user should be logged in to the web-application with SSO therefor i need the format that jcifs is using to store the user. (For example user@MYDOMAIN or MYDOMAIN\user...) I tested the Authentication with other SSO frameworks with Kerberos Method and it works as expected. I'm now trying to use SSO through the NTLMHttpFilter of JCIFS. When i try to login i get the following error message: jcifs.smb.SmbException: The parameter is incorrect. jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:541) jcifs.smb.SmbTransport.send(SmbTransport.java:641) jcifs.smb.SmbSession.sessionSetup(SmbSession.java:322) jcifs.smb.SmbSession.send(SmbSession.java:224) jcifs.smb.SmbTree.treeConnect(SmbTree.java:176) jcifs.smb.SmbSession.logon(SmbSession.java:153) jcifs.smb.SmbSession.logon(SmbSession.java:146) jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:189) jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:121) Regarding to the documentation i'm using to configure this, this is a know issue with the Group policy. It is stated there, that i have to change the Group policy "Networkaccess: lan-manager authentication level" to respond to NTLMv1 request. I have done this, but it's still not working. So what i also have to configure is the same policy on the client computer. I have to change the policy, so that the client computer sends NTLMv1. But it is always sending NTLMv2 tokens. The problem now is that i'm somehow not able to change this setting. (I already was before) because the dropdown box to choose the authentication method is "greyed out". edit: just to make this clear, this dialog is on the client-side in the "local-security policies" As you can see from this screenshot, the chosen method is "Only send NTLMv2 responses" which is the wrong setting and i'm pretty sure that this is causing the error above. My question is now, why can't i change this setting? Why is it greyd out?

    Read the article

  • Postfix flow/hook reference, or high-level overview?

    - by threecheeseopera
    The Postfix MTA consists of several components/services that work together to perform the different stages of delivery and receipt of mail; these include the smtp daemon, the pickup and cleanup processes, the queue manager, the smtp service, pipe/spawn/virtual/rewrite ... and others (including the possibility of custom components). Postfix also provides several types of hooks that allow it to integrate with external software, such as policy servers, filters, bounce handlers, loggers, and authentication mechanisms; these hooks can be connected to different components/stages of the delivery process, and can communicate via (at least) IPC, network, database, several types of flat files, or a predefined protocol (e.g. milter). An old and very limited example of this is shown at this page. My question: Does anyone have access to a resource that describes these hooks, the components/delivery stages that the hook can interact with, and the supported communication methods? Or, more likely, documentation of the various Postfix components and the hooks/methods that they support? For example: Given the requirement "if the recipient primary MX server matches 'shadysmtpd', check the recipient address against a list; if there is a match, terminate the SMTP connection without notice". My software would need to 1) integrate into the proper part of the SMTP process, 2) use some method to perform the address check (TCP map server? regular expressions? mysql?), and 3) implement the required action (connection termination). Additionally, there will probably be several methods to accomplish this, and another requirement would be to find that which best fits (ex: a network server might be faster than a flat-file lookup; or, if a large volume of mail might be affected by this check, it should be performed as early in the mail process as possible). Real-world example: The apolicy policy server (performs checks on addresses according to user-defined rules) is designed as a standalone TCP server that hooks into Postfix inside the smtpd component via the directive 'check_policy_service inet:127.0.0.1:10001' in the 'smtpd_client_restrictions' configuration option. This means that, when Postfix first receives an item of mail to be delivered, it will create a TCP connection to the policy server address:port for the purpose of determining if the client is allowed to send mail from this server (in addition to whatever other restrictions / restriction lookup methods are defined in that option); the proper action will be taken based on the server's response. Notes: 1)The Postfix architecture page describes some of this information in ascii art; what I am hoping for is distilled, condensed, reference material. 2) Please correct me if I am wrong on any level; there is a mountain of material, and I am just one man ;) Thanks!

    Read the article

  • UAC: How to remove "mandatory level" label from the file?

    - by Roman Pokrovskij
    1) How to remove "mandatory level" label from the file? I have two files, for first icalcs return Mandatory Label\Medium Mandatory Level:(NW) for second icalcs doesn't return anything (that means use "default") Problem is that icalcs /setintegritylevel [(CI)(OI)]Level can only set level label, when I need to remove it.. 2) What are other methods (GUI/utilities) to manipulate file's mandatory level labels?

    Read the article

  • How to suppress a compiler warning in C# without using #pragma ?

    - by Dylan Lin
    Hi, I need to suppress a specfic compiler warning in C#. Now I can do it like this: #pragma warning disable 0649 private string _field; #pragma warning restore 0649 Is there a way to do it like the following? [SuppressCompilerWarning("0649")] private string _field; Because I only need to suppress warnings for this field, not a code block. Note: I want to suppress the compiler warning, not the Code-Analysis warning. Thanks!

    Read the article

  • Class/Model Level Validation (as opposed to Property Level)? (ASP.NET MVC 2.0)

    - by Erx_VB.NExT.Coder
    Basically, what the title says. I have several properties that combine together to really make one logical answer, and i would like to run a server-side validation code (that i write) which take these multiple fields into account and hook up to only one validation output/error message that users see on the webpage. I looked at scott guthries method of extending an attribute and using it in yoru dataannotations declarations, but, as i can see, there is no way to declare a dataannotations-style attribute on multiple properties, and you can only place the declarations (such as [Email], [Range], [Required]) over one property :(. i have looked at the PropertiesMustMatchAttribute in the default mvc 2.0 project that appears when you start a new project, this example is as useful as using a pair of pins to check your motor oil - useless! i have tried this method, however, creating a class level attribute, and have no idea how to display the error from this in my aspx page. i have tried html.ValidationMessage("ClassNameWhereAttributeIsAdded") and a variety of other thing, and it has not worked. and i should mention, there is NOT ONE blog post on doing validation at this level - despite this being a common need in any project or business logic scenario! can anyone help me in having my message displayed in my aspx page, and also if possible a proper document or reference explaining validation at this level?

    Read the article

  • Transaction Isolation Level of Serializable not working for me

    - by Shahriar
    I have a website which is used by all branches of a store and what it does is that it records customer purchases into a table called myTransactions.myTransactions table has a column named SerialNumber.For each purchase i create a record in the transactions table and assign a serial to it.The stored procedure that does this calls a UDF function to get a new serialNumber before inserting the record.Like below : Create Procedure mytransaction_Insert as begin insert into myTransactions(column1,column2,column3,...SerialNumber) values( Value1 ,Value2,Value3,...., getTransactionNSerialNumber()) end Create function getTransactionNSerialNumber as begin RETURN isnull(SELECT TOP (1) SerialNumber FROM myTransactions READUNCOMMITTED ORDER BY SerialNumber DESC),0) + 1 end The website is being used by so many users in different stores at the same time and it is creating many duplicate serialNumbers(same SerialNumbers).So i added a Sql transaction with ReadCommitted level to the transaction and i still got duplicate transaction numbers.I changed it to SERIALIZABLE in order to lock the resources and i not only got duplicate transaction numbers(!!HOW!!) but i also got sporadic deadlocks between the same stored procedure calls.This is what i tried : (With ommissions of try catch blocks and rollbacks) Create Procedure mytransaction_Insert as begin SET TRANSACTION ISOLATION LEVEL SERIALIZABLE BEGIN TRASNACTION ins insert into myTransactions(column1,column2,column3,...SerialNumber) values( Value1 ,Value2 , Value3, ...., getTransactionNSerialNumber()) COMMIT TRANSACTION ins SET TRANSACTION ISOLATION READCOMMITTED end I even copied the function that gets the serial number directly into the stored procedure instead of the UDF function call and still got duplicate serialNumbers.So,How can a stored procedure line create something Like the c# lock() {} block. By the way,i have to implement the transaction serial number using the same pattern and i can't change the serialNumber to any other identity field or whatever.And for some reasons i need to generate the serialNumber inside the databse and i can't move SerialNumber generation to application level. Thank you.

    Read the article

  • help on developing enterprise level software solutions

    - by wefwgeweg
    there is a specific niche which I would like to target by providing a complete enterprise level software solution.... the problem is, where do i begin ? meaning, i come from writing just desktop software on VB/ASP .net/PHP/mysql and suddenly unfamiliar terms popup like Oracle, SAP Business Information Warehouse, J2EE.... obviously, something is pointing towards Java, is it common for software suites, or solutions to be developed 100% on Java technology and standards? Are there any other platform to build enterprise level software on ? i am still lacking understanding what exactly is "Enterprise level" ? what is sufficient condition to call a software that sells for $199 and then suddenly it's $19,999 for "enterprise" package. I dont understand why there is such a huge discrepancy between "standard" and "enterprise" versions of software. Is it just attempting to bag large corporations on a spending spree ? so why does one choose to develop so called "enterprise" softwares ? is it because of the large inflated price tag you can justify with ? i would also like some more enterpreneural resources on starting your own enterprise software company in a niche.... Thank you for reading, i am still trying to find the right questions.

    Read the article

  • newbie hibernate first level cache confusion

    - by Bruce
    Hi all I'm just geting to grips with hibernate. Little bit confused. I just wanted to watch the operation of the first level cache, which I understood to batch up queries until the end of the session. But if I create an object, hibernate saves it immediately, so that when I later update it in the same transaction, it has to do an update too: Session session = factory.getCurrentSession(); session.beginTransaction(); Test1 test1 = new Test1(); test1.setName("Test 1"); test1.setValue(10); // Touch it session.save(test1); System.out.println("At checkpoint 1"); test1.setValue(20); session.getTransaction().commit(); I see the sql for the save, then 'At checkpoint 1', then the sql for the update. Do I have something set up wrong or am I misunderstanding hibernate's first level cache? Is there a good document on the first level cache - I didn't find anything in the hibernate docs, but I could easily have missed it.. Thanks!

    Read the article

  • Stopping a SoundPlayer loop at the local level

    - by EvanRyan
    I'm working on setting up an alarm that pops up as a dialog with multiple sound file options the user can choose from. The problem I'm having is creating a sound player at the local level that I can close with a button. The problem I'm having is that the sound keeps looping when I close the form because the SoundPlayer doesn't exist within the button click event. here's what I have: void callsound() { if (SoundToggle == 0) // if sound enabled { if ((SoundFile == 0) && (File.Exists(@"attention.wav"))) { System.Media.SoundPlayer alarm = new System.Media.SoundPlayer(@"attention.wav"); alarm.PlayLooping(); } if ((SoundFile == 1) && (File.Exists(@"aahh.wav"))) { System.Media.SoundPlayer alarm = new System.Media.SoundPlayer(@"aahh.wav"); alarm.PlayLooping(); } } private void button1_Click(object sender, EventArgs e) { //alarm.Stop(); Only works if SoundPlayer declared at class level this.Close(); } Is there a way I can do what I want to do by declaring the SoundPlayer instances where I am? Or is there a way to declare it at the class level, and still be able to change the sound file based on user settings?

    Read the article

  • Simpler / more efficient method of nested if ... else flow?

    - by Scott
    I'm currently working on an emulation server for a flash-client based game, which has a "pets system", and I was wondering if there was a simpler way of going about checking the level of specified pets. Current code: public int Level { get { if (Expirience > 100) // Level 2 { if (Expirience > 200) // Level 3 { if (Expirience > 400) // Level 4 - Unsure of Goal { if (Expirience > 600) // Level 5 - Unsure of Goal { if (Expirience > 1000) // Level 6 { if (Expirience > 1300) // Level 7 { if (Expirience > 1800) // Level 8 { if (Expirience > 2400) // Level 9 { if (Expirience > 3200) // Level 10 { if (Expirience > 4300) // Level 11 { if (Expirience > 7200) // Level 12 - Unsure of Goal { if (Expirience > 8500) // Level 13 - Unsure of Goal { if (Expirience > 10100) // Level 14 { if (Expirience > 13300) // Level 15 { if (Expirience > 17500) // Level 16 { if (Expirience > 23000) // Level 17 { return 17; // Bored } return 16; } return 15; } return 14; } return 13; } return 12; } return 11; } return 10; } return 9; } return 8; } return 7; } return 6; } return 5; } return 4; } return 3; } return 2; } return 1; } } Yes, I'm aware I've misspelt Experience, I had made the mistake in a previous function and hadn't gotten around to updating everything.

    Read the article

  • C# Simpler / more efficient method of if ... else flow?

    - by Scott
    I'm currently working on an emulation server for a flash-client based game, which has a "pets system", and I was wondering if there was a simpler way of going about checking the level of specified pets. Current code: public int Level { get { if (Expirience 100) // Level 2 { if (Expirience 200) // Level 3 { if (Expirience 400) // Level 4 - Unsure of Goal { if (Expirience 600) // Level 5 - Unsure of Goal { if (Expirience 1000) // Level 6 { if (Expirience 1300) // Level 7 { if (Expirience 1800) // Level 8 { if (Expirience 2400) // Level 9 { if (Expirience 3200) // Level 10 { if (Expirience 4300) // Level 11 { if (Expirience 7200) // Level 12 - Unsure of Goal { if (Expirience 8500) // Level 13 - Unsure of Goal { if (Expirience 10100) // Level 14 { if (Expirience 13300) // Level 15 { if (Expirience 17500) // Level 16 { if (Expirience 23000) // Level 17 { return 17; // Bored } return 16; } return 15; } return 14; } return 13; } return 12; } return 11; } return 10; } return 9; } return 8; } return 7; } return 6; } return 5; } return 4; } return 3; } return 2; } return 1; } } Yes, I'm aware I've misspelt Experience, I had made the mistake in a previous function and hadn't gotten around to updating everything... :P

    Read the article

  • Warning: Cannot modify header information - headers already sent

    - by Pankaj Khurana
    Hi, I am using code available on http://www.forosdelweb.com/f18/zip-lib-php-archivo-zip-vacio-431133/ for creating zip file. First file-zip.lib.php <?php /* $Id: zip.lib.php,v 1.1 2004/02/14 15:21:18 anoncvs_tusedb Exp $ */ // vim: expandtab sw=4 ts=4 sts=4: /** * Zip file creation class. * Makes zip files. * * Last Modification and Extension By : * * Hasin Hayder * HomePage : www.hasinme.info * Email : [email protected] * IDE : PHP Designer 2005 * * * Originally Based on : * * http://www.zend.com/codex.php?id=535&single=1 * By Eric Mueller <[email protected]> * * http://www.zend.com/codex.php?id=470&single=1 * by Denis125 <[email protected]> * * a patch from Peter Listiak <[email protected]> for last modified * date and time of the compressed file * * Official ZIP file format: http://www.pkware.com/appnote.txt * * @access public */ class zipfile { /** * Array to store compressed data * * @var array $datasec */ var $datasec = array(); /** * Central directory * * @var array $ctrl_dir */ var $ctrl_dir = array(); /** * End of central directory record * * @var string $eof_ctrl_dir */ var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00"; /** * Last offset position * * @var integer $old_offset */ var $old_offset = 0; /** * Converts an Unix timestamp to a four byte DOS date and time format (date * in high two bytes, time in low two bytes allowing magnitude comparison). * * @param integer the current Unix timestamp * * @return integer the current date in a four byte DOS format * * @access private */ function unix2DosTime($unixtime = 0) { $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime); if ($timearray['year'] < 1980) { $timearray['year'] = 1980; $timearray['mon'] = 1; $timearray['mday'] = 1; $timearray['hours'] = 0; $timearray['minutes'] = 0; $timearray['seconds'] = 0; } // end if return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1); } // end of the 'unix2DosTime()' method /** * Adds "file" to archive * * @param string file contents * @param string name of the file in the archive (may contains the path) * @param integer the current timestamp * * @access public */ function addFile($data, $name, $time = 0) { $name = str_replace('', '/', $name); $dtime = dechex($this->unix2DosTime($time)); $hexdtime = 'x' . $dtime[6] . $dtime[7] . 'x' . $dtime[4] . $dtime[5] . 'x' . $dtime[2] . $dtime[3] . 'x' . $dtime[0] . $dtime[1]; eval('$hexdtime = "' . $hexdtime . '";'); $fr = "\x50\x4b\x03\x04"; $fr .= "\x14\x00"; // ver needed to extract $fr .= "\x00\x00"; // gen purpose bit flag $fr .= "\x08\x00"; // compression method $fr .= $hexdtime; // last mod time and date // "local file header" segment $unc_len = strlen($data); $crc = crc32($data); $zdata = gzcompress($data); $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug $c_len = strlen($zdata); $fr .= pack('V', $crc); // crc32 $fr .= pack('V', $c_len); // compressed filesize $fr .= pack('V', $unc_len); // uncompressed filesize $fr .= pack('v', strlen($name)); // length of filename $fr .= pack('v', 0); // extra field length $fr .= $name; // "file data" segment $fr .= $zdata; // "data descriptor" segment (optional but necessary if archive is not // served as file) $fr .= pack('V', $crc); // crc32 $fr .= pack('V', $c_len); // compressed filesize $fr .= pack('V', $unc_len); // uncompressed filesize // add this entry to array $this -> datasec[] = $fr; // now add to central directory record $cdrec = "\x50\x4b\x01\x02"; $cdrec .= "\x00\x00"; // version made by $cdrec .= "\x14\x00"; // version needed to extract $cdrec .= "\x00\x00"; // gen purpose bit flag $cdrec .= "\x08\x00"; // compression method $cdrec .= $hexdtime; // last mod time & date $cdrec .= pack('V', $crc); // crc32 $cdrec .= pack('V', $c_len); // compressed filesize $cdrec .= pack('V', $unc_len); // uncompressed filesize $cdrec .= pack('v', strlen($name) ); // length of filename $cdrec .= pack('v', 0 ); // extra field length $cdrec .= pack('v', 0 ); // file comment length $cdrec .= pack('v', 0 ); // disk number start $cdrec .= pack('v', 0 ); // internal file attributes $cdrec .= pack('V', 32 ); // external file attributes - 'archive' bit set $cdrec .= pack('V', $this -> old_offset ); // relative offset of local header $this -> old_offset += strlen($fr); $cdrec .= $name; // optional extra field, file comment goes here // save to central directory $this -> ctrl_dir[] = $cdrec; } // end of the 'addFile()' method /** * Dumps out file * * @return string the zipped file * * @access public */ function file() { $data = implode('', $this -> datasec); $ctrldir = implode('', $this -> ctrl_dir); return $data . $ctrldir . $this -> eof_ctrl_dir . pack('v', sizeof($this -> ctrl_dir)) . // total # of entries "on this disk" pack('v', sizeof($this -> ctrl_dir)) . // total # of entries overall pack('V', strlen($ctrldir)) . // size of central dir pack('V', strlen($data)) . // offset to start of central dir "\x00\x00"; // .zip file comment length } // end of the 'file()' method /** * A Wrapper of original addFile Function * * Created By Hasin Hayder at 29th Jan, 1:29 AM * * @param array An Array of files with relative/absolute path to be added in Zip File * * @access public */ function addFiles($files /*Only Pass Array*/) { foreach($files as $file) { if (is_file($file)) //directory check { $data = implode("",file($file)); $this->addFile($data,$file); } } } /** * A Wrapper of original file Function * * Created By Hasin Hayder at 29th Jan, 1:29 AM * * @param string Output file name * * @access public */ function output($file) { $fp=fopen($file,"w"); fwrite($fp,$this->file()); fclose($fp); } } // end of the 'zipfile' class ?> My second file newzip.php <? include("zip.lib.php"); $ziper = new zipfile(); $ziper->addFiles(array("index.htm")); //array of files // the next three lines force an immediate download of the zip file: header("Content-type: application/octet-stream"); header("Content-disposition: attachment; filename=test.zip"); echo $ziper -> file(); ?> I am getting this warning while executing newzip.php Warning: Cannot modify header information - headers already sent by (output started at E:\xampp\htdocs\demo\zip.lib.php:233) in E:\xampp\htdocs\demo\newzip.php on line 6 I am unable to figure out the reason for the same. Please help me on this. Thanks

    Read the article

  • Correct level of abstraction for a 3d rendering component?

    - by JohnB
    I've seen lots of questions around this area but not this exact question so apologies if this is a duplicate. I'm making a small 3d game. Well to be honest, it's just a little hobby project and likely won't turn out to be an actual game, I'll be happy to make a nice graphics demo and learn about 3d rendering and c++ design. My intent is to use direct3d9 for rendering as I have some little experience of it, and it seems to meet my requirements. However if I've learned one thing as a programmer it's to ask "is there any conceivable reason that this component might be replaced by a different implmentation" and if the answer is yes then I need to design a proper abstraction and interface to that component. So even though I intend to implment d3d9 I need to design a 3d interface that could be implemented for d3d11, opengl... My question then is what level is it best to do this at? I'm thinking that an interface capable of creating and later drawing Vertex buffers and index buffers Textures Vertex and Pixel "shaders" Some representation of drawing state (blending modes etc...) In other words a fairly low level interface where my code to draw for example an animated model would use the interface to obtain abstract vertex buffers etc. I worry though that it's too low level to abstract out all the functionallity I need efficiently. The alternative is to do this at a higher level where the interface can draw objects, animations, landscapes etc, and implement them for each system. This seems like more work, but it more flexible I guess. So that's my question really, when abstracting out the drawing system, what level of interface works best?

    Read the article

  • How to load data for specific level at runtime?

    - by Siddharth
    I'm trying to create a game with many levels loaded from XML files. In my game I have many objects in each level. At present my game contains 20 levels, and I load all the textures at once on startup. But I think the correct way to do it is to only load textures used in the current level. I don't know how to do that. So please explain this by providing some example code. At present I create a class for each type of entity by extending my Sprite class. This subclass loads the appropriate image. I know this is not the best way to do things. Basically I want to know how to load large levels efficiently in Andengine. What is the proper method for loading textures, level data and background images from files when the level is run?

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >