Search Results

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

Page 86/1118 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • CodeIgniter output XML in View

    - by Peter
    I tried to output XML in the view file. The view file is result_view.php and its first line is <?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> But I get the error "Content is not allowed in prolog". So how to do this correctly? I use Eclipse + PDT.

    Read the article

  • List input and output audio devices in Applet

    - by Jhonny Everson
    I am running a signed applet that needs to provide the ability for the user to select the input and output audio devices ( similar to what skype provides). I borrowed the following code from other thread: import javax.sound.sampled.*; public class SoundAudit { public static void main(String[] args) { try { System.out.println("OS: "+System.getProperty("os.name")+" "+ System.getProperty("os.version")+"/"+ System.getProperty("os.arch")+"\nJava: "+ System.getProperty("java.version")+" ("+ System.getProperty("java.vendor")+")\n"); for (Mixer.Info thisMixerInfo : AudioSystem.getMixerInfo()) { System.out.println("Mixer: "+thisMixerInfo.getDescription()+ " ["+thisMixerInfo.getName()+"]"); Mixer thisMixer = AudioSystem.getMixer(thisMixerInfo); for (Line.Info thisLineInfo:thisMixer.getSourceLineInfo()) { if (thisLineInfo.getLineClass().getName().equals( "javax.sound.sampled.Port")) { Line thisLine = thisMixer.getLine(thisLineInfo); thisLine.open(); System.out.println(" Source Port: " +thisLineInfo.toString()); for (Control thisControl : thisLine.getControls()) { System.out.println(AnalyzeControl(thisControl));} thisLine.close();}} for (Line.Info thisLineInfo:thisMixer.getTargetLineInfo()) { if (thisLineInfo.getLineClass().getName().equals( "javax.sound.sampled.Port")) { Line thisLine = thisMixer.getLine(thisLineInfo); thisLine.open(); System.out.println(" Target Port: " +thisLineInfo.toString()); for (Control thisControl : thisLine.getControls()) { System.out.println(AnalyzeControl(thisControl));} thisLine.close();}}} } catch (Exception e) {e.printStackTrace();}} public static String AnalyzeControl(Control thisControl) { String type = thisControl.getType().toString(); if (thisControl instanceof BooleanControl) { return " Control: "+type+" (boolean)"; } if (thisControl instanceof CompoundControl) { System.out.println(" Control: "+type+ " (compound - values below)"); String toReturn = ""; for (Control children: ((CompoundControl)thisControl).getMemberControls()) { toReturn+=" "+AnalyzeControl(children)+"\n";} return toReturn.substring(0, toReturn.length()-1);} if (thisControl instanceof EnumControl) { return " Control:"+type+" (enum: "+thisControl.toString()+")";} if (thisControl instanceof FloatControl) { return " Control: "+type+" (float: from "+ ((FloatControl) thisControl).getMinimum()+" to "+ ((FloatControl) thisControl).getMaximum()+")";} return " Control: unknown type";} } But what I get: Mixer: Software mixer and synthesizer [Java Sound Audio Engine] Mixer: No details available [Microphone (Pink Front)] I was expecting the get the real list of my devices (My preferences panels shows 3 output devices and 1 Microphone). I am running on Mac OS X 10.6.7. Is there other way to get that info from Java?

    Read the article

  • While loop: Output something different on every second result

    - by Wade D Ouellet
    Hi, I am running a plugin called Category Posts Widget for WordPress: http://wordpress.org/extend/plugins/category-posts/ It uses a while loop to display the names of all posts in a certain category. I want to get it so that there is a different class attached to the li tag on every second output. Here is the block of code for the plugin: // Post list echo "<ul>\n"; while ( $cat_posts->have_posts() ) { $cat_posts->the_post(); ?> <li class="cat-post-item"> <a class="post-title" href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a> <?php if ( function_exists('the_post_thumbnail') && current_theme_supports("post-thumbnails") && $instance["thumb"] && has_post_thumbnail() ) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail( 'cat_post_thumb_size'.$this->id ); ?> </a> <?php endif; ?> <?php if ( $instance['date'] ) : ?> <p class="post-date"><?php the_time("j M Y"); ?></p> <?php endif; ?> <?php if ( $instance['excerpt'] ) : ?> <?php the_excerpt(); ?> <?php endif; ?> <?php if ( $instance['comment_num'] ) : ?> <p class="comment-num">(<?php comments_number(); ?>)</p> <?php endif; ?> </li> <?php } echo "</ul>\n"; I am just trying to get it so on each second one in the output list, the li has a different class, so cat-post-item-alt for example. Thanks, Wade

    Read the article

  • Capture console output in TestNG?

    - by Misha Koshelev
    Dear All: I am using TestNG+ReportNG per wiki instructions in gradle (I fixed on cookbook as default example did not work form me). http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-addreporters I would like to somehow capture console output in TestNG. Is this possible? Thank you Misha

    Read the article

  • Wordpress Taxonomy title output

    - by Blackbird
    I'm trying to output the title of a taxonomy page when viewing it... So like, if i was on a 'tag' page i would go: <?php if (is_tag()) {?> <h1><?php single_cat_title(); ?></h1> <?php } ?> But how would i achieve the same thing for if the user is viewing a specific taxonomy page? is_taxonomy() doesn't exist so i'm suck! :/

    Read the article

  • Display output in HTML format by perl

    - by aladine
    Hi, I have a hashmap with some information(key and value) in a perl file. I want to display them in HTML output and each displayed (key, value) will link to something. When I click the link then there will be some information there. Anyone suggests me how can I do that. Is this similar to creating a CGI file and use CGI.pm? I will update more detail on this question later.

    Read the article

  • Command line or library "compare tables" utility for SQL server with comprehensive diff output to a

    - by MicMit
    I can't find anything like that. Commercial or free ( XSQL Lite is suitable for my case and ) tools show diffs in grids with possibility to export to CSV. Also they generate sync SQL scripts when run from command line. What I need is an output as a comprehensive report ( XML , HTML ) suitable for parsing so that I would be able to show similar diff grid in my application ( updated old/new values for each column , added - all values for row , deleted - all values for row and etc... ) .

    Read the article

  • How to output two ddl files at the same time with using maven hbm2ddl plugin

    - by daniel-cai
    Our application needs to use two different kinds of databases.One is oracle, the other is mysql and we want to use maven plugin hbm2ddl to generate the ddl file, and want to output the two ddl files at the same time, I don't know how to set the configuration in pom.xml. I tried to use this plugin twice, but it always generated one ddl file. Any one encountered such case before ? could u please give some advice.

    Read the article

  • Make Fluent NHibernate output schema update to file

    - by Bender
    I am successfully getting Fluent NHibernate to update my database by calling UpdateBaseFiles: Public Sub UpdateBaseFiles() Dim db As SQLiteConfiguration db = SQLiteConfiguration.Standard.UsingFile(BASE_DBNAME) Fluently.Configure() _ .Database(db) _ .Mappings(Function(m) m.FluentMappings.AddFromAssemblyOf(Of FluentMap)()) _ .ExposeConfiguration(AddressOf UpdateSchema) _ .BuildConfiguration() End Sub Private Sub UpdateSchema(ByVal Config As Configuration) Dim SchemaUpdater As New SchemaUpdate(Config) SchemaUpdater.Execute(True, True) End Sub How do I output the DDL to a file, I do this when initially creating the schema by using: Private Sub BuildSchema(ByVal Config As Configuration) Dim SchemaExporter As New SchemaExport(Config) SchemaExporter.SetOutputFile("schema.sql") SchemaExporter.Create(False, True) End Sub but SchemaUpdate does not have a SetOutputFile method.

    Read the article

  • Twitter json output

    - by Bunny Rabbit
    $(function(){ $.ajax({ url:'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=user_name&callback=?', //dataType:'json', success:function(data){$('body').append('the data is' +data);} }); }); the above code with dataType line prints out [objects] while with the dataType line commented it prints out nothing ...how can i get it to print the json output from the server rather then the javascript object?

    Read the article

  • Output a NULL cell value in Excel

    - by Peter
    I have an IF statement. If a cell = n, then do something, else output NULL =IF(A1=5, "Success", NULL) // #NAME? =IF(A1=5, "Success", "NULL") // NULL (as in text, not actually NULL!) =IF(A1=5, "Success", "") // blank but not NULL =IF(A1=5, "Success", 0) // zero value but not NULL

    Read the article

  • C++ simple logging class with UTF-8 output [code example]

    - by Andrew
    Hello everyone, I was working on one of my academic projects and for the first time I needed pure C++ without GUI. After googling for a while, I did not find any simple and easy to use implementation for logging and created my own. This is a simple implementation with iostreams that logs messages to screen and to the file simultaneously. I was thinking of using templates but then I realized that I do not expect any changes and removed that. It is modified std::wostream with two added modifiers: 1. TimeStamp - prints time-stamp 2. LogMode(LogModes) - switches output: file only, screen only, file+screen. *Boost::utf8_codecvt_facet* is used for UTF-8 output. // ############################################################################ // # Name: MyLog.h # // # Purpose: Logging Class Header # // # Author: Andrew Drach # // # Modified by: <somebody> # // # Created: 03/21/10 # // # SVN-ID: $Id$ # // # Copyright: (c) 2010 Andrew Drach # // # Licence: <license> # // ############################################################################ #ifndef INCLUDED_MYLOG_H #define INCLUDED_MYLOG_H // headers -------------------------------------------------------------------- #include <string> #include <iostream> #include <fstream> #include <exception> #include <boost/program_options/detail/utf8_codecvt_facet.hpp> using namespace std; // definitions ---------------------------------------------------------------- // ---------------------------------------------------------------------------- // DblBuf class // Splits up output stream into two // Inspired by http://wordaligned.org/articles/cpp-streambufs // ---------------------------------------------------------------------------- class DblBuf : public wstreambuf { private: // private member declarations DblBuf(); wstreambuf *bf1; wstreambuf *bf2; virtual int_type overflow(int_type ch) { int_type eof = traits_type::eof(); int_type not_eof = !eof; if ( traits_type::eq_int_type(ch,eof) ) return not_eof; else { char_type ch1 = traits_type::to_char_type(ch); int_type r1( bf1on ? bf1->sputc(ch1) : not_eof ); int_type r2( bf2on ? bf2->sputc(ch1) : not_eof ); return (traits_type::eq_int_type(r1,eof) || traits_type::eq_int_type(r2,eof) ) ? eof : ch; } } virtual int sync() { int r1( bf1on ? bf1->pubsync() : NULL ); int r2( bf2on ? bf2->pubsync() : NULL ); return (r1 == 0 && r2 == 0) ? 0 : -1; } public: // public member declarations explicit DblBuf(wstreambuf *bf1, wstreambuf *bf2) : bf1(bf1), bf2(bf2) { if (bf1) bf1on = true; else bf1on = false; if (bf2) bf2on = true; else bf2on = false; } bool bf1on; bool bf2on; }; // ---------------------------------------------------------------------------- // logstream class // Wrapper for a standard wostream with access to modified buffer // ---------------------------------------------------------------------------- class logstream : public wostream { private: // private member declarations logstream(); public: // public member declarations DblBuf *buf; explicit logstream(wstreambuf *StrBuf, bool isStd = false) : wostream(StrBuf, isStd), buf((DblBuf*)StrBuf) {} }; // ---------------------------------------------------------------------------- // Logging mode Class // ---------------------------------------------------------------------------- enum LogModes{LogToFile=1, LogToScreen, LogToBoth}; class LogMode { private: // private member declarations LogMode(); short mode; public: // public member declarations LogMode(short mode1) : mode(mode1) {} logstream& operator()(logstream &stream1) { switch(mode) { case LogToFile: stream1.buf->bf1on = true; stream1.buf->bf2on = false; break; case LogToScreen: stream1.buf->bf1on = false; stream1.buf->bf2on = true; break; case LogToBoth: stream1.buf->bf1on = true; stream1.buf->bf2on = true; } return stream1; } }; logstream& operator<<(logstream &out, LogMode mode) { return mode(out); } wostream& TimeStamp1(wostream &out1) { time_t time1; struct tm timeinfo; wchar_t timestr[512]; // Get current time and convert it to a string time(&time1); localtime_s (&timeinfo, &time1); wcsftime(timestr, 512,L"[%Y-%b-%d %H:%M:%S %p] ",&timeinfo); return out1 << timestr; } // ---------------------------------------------------------------------------- // MyLog class // Logs events to both file and screen // ---------------------------------------------------------------------------- class MyLog { private: // private member declarations MyLog(); auto_ptr<DblBuf> buf; string mErrorMsg1; string mErrorMsg2; string mErrorMsg3; string mErrorMsg4; public: // public member declarations explicit MyLog(string FileName1, wostream *ScrLog1, locale utf8locale1); ~MyLog(); void NewEvent(wstring str1, bool TimeStamp = true); string FileName; wostream *ScrLog; wofstream File; auto_ptr<logstream> Log; locale utf8locale; }; // ---------------------------------------------------------------------------- // MyLog constructor // ---------------------------------------------------------------------------- MyLog::MyLog(string FileName1, wostream *ScrLog1, locale utf8locale1) : // ctors mErrorMsg1("Failed to open file for application logging! []"), mErrorMsg2("Failed to write BOM! []"), mErrorMsg3("Failed to write to file! []"), mErrorMsg4("Failed to close file! []"), FileName(FileName1), ScrLog(ScrLog1), utf8locale(utf8locale1), File(FileName1.c_str()) { // Adjust error strings mErrorMsg1.insert(mErrorMsg1.length()-1,FileName1); mErrorMsg2.insert(mErrorMsg2.length()-1,FileName1); mErrorMsg3.insert(mErrorMsg3.length()-1,FileName1); mErrorMsg4.insert(mErrorMsg4.length()-1,FileName1); // check for file open errors if ( !File ) throw ofstream::failure(mErrorMsg1); // write UTF-8 BOM File << wchar_t(0xEF) << wchar_t(0xBB) << wchar_t(0xBF); // switch locale to UTF-8 File.imbue(utf8locale); // check for write errors if ( File.bad() ) throw ofstream::failure(mErrorMsg2); buf.reset( new DblBuf(File.rdbuf(),ScrLog->rdbuf()) ); Log.reset( new logstream(&*buf) ); } // ---------------------------------------------------------------------------- // MyLog destructor // ---------------------------------------------------------------------------- MyLog::~MyLog() { *Log << TimeStamp1 << "Log finished." << endl; // clean up objects Log.reset(); buf.reset(); File.close(); // check for file close errors if ( File.bad() ) throw ofstream::failure(mErrorMsg4); } //--------------------------------------------------------------------------- #endif // INCLUDED_MYLOG_H Tested on MSVC 2008, boost 1.42. I do not know if this is the right place to share it. Hope it helps anybody. Feel free to make it better.

    Read the article

  • Wrap output of struts2 ServletDispatcherResult ?

    - by krosenvold
    I'd like to do much the same thing as the Struts2 sitemesh servlet-filter does, i.e. wrap the output of an action with some chosen content. The "problem" with the sitemesh approach is that it AFIK it does not have any relationship to the ActionInvocation, and I would like to be able to query information from the ActionInvocation when determining which content to add. I have looked through the ServletDispatcherResult, and I'm not entirly sure what's the best way to achieve this. Any suggestions ?

    Read the article

  • How to write a function to output unconstant loop

    - by tunpishuang
    Here is the function description test($argv) $argv is an array, for example $argv=array($from1,$to1,$from2,$to2.....); array items must be even. $argv=array(1,2,4,5) : this will output values like below: 1_4 1_5 2_4 2_5 The number of array $argv's is not constant. Maybe 3 or 4 levels of loop will be outputed. I know this will used RECURSIVE , but i don't know exactly how to code.

    Read the article

  • Unexpected output from Bubblesort program with MSVC vs TCC

    - by Sujith S Pillai
    One of my friends sent this code to me, saying it doesn't work as expected: #include<stdio.h> void main() { int a [10] ={23, 100, 20, 30, 25, 45, 40, 55, 43, 42}; int sizeOfInput = sizeof(a)/sizeof(int); int b, outer, inner, c; printf("Size is : %d \n", sizeOfInput); printf("Values before bubble sort are : \n"); for ( b = 0; b &lt; sizeOfInput; b++) printf("%d\n", a[b]); printf("End of values before bubble sort... \n"); for ( outer = sizeOfInput; outer &gt; 0; outer-- ) { for ( inner = 0 ; inner &lt; outer ; inner++) { printf ( "Comparing positions: %d and %d\n",inner,inner+1); if ( a[inner] &gt; a[inner + 1] ) { int tmp = a[inner]; a[inner] = a [inner+1]; a[inner+1] = tmp; } } printf ( "Bubble sort total array size after inner loop is %d :\n",sizeOfInput); printf ( "Bubble sort sizeOfInput after inner loop is %d :\n",sizeOfInput); } printf ( "Bubble sort total array size at the end is %d :\n",sizeOfInput); for ( c = 0 ; c &lt; sizeOfInput; c++) printf("Element: %d\n", a[c]); } I am using Micosoft Visual Studio Command Line Tool for compiling this on a Windows XP machine. cl /EHsc bubblesort01.c My friend gets the correct output on a dinosaur machine (code is compiled using TCC there). My output is unexpected. The array mysteriously grows in size, in between. If you change the code so that the variable sizeOfInput is changed to sizeOfInputt, it gives the expected results! A search done at Microsoft Visual C++ Developer Center doesn't give any results for "sizeOfInput". I am not a C/C++ expert, and am curious to find out why this happens - any C/C++ experts who can "shed some light" on this? Unrelated note: I seriously thought of rewriting the whole code to use quicksort or merge sort before posting it here. But, after all, it is not Stooge sort... Edit: I know the code is not correct (it reads beyond the last element), but I am curious why the variable name makes a difference.

    Read the article

  • I want Oracle Query for Formatted Output

    - by reply2viveksshah
    The following is my table design: Ecode Degree YOQ 7654321 SSC 2000 7654321 HSC 2002 7654321 Bcom 2006 7654321 MCA 2010 7654322 SSC 2002 7654322 HSC 2004 7654322 Bcom 2007 7654323 SSC 2002 7654323 HSC 2004 7654323 BE 2008 I want the following formatted output using an oracle query: Ecode Degree year 7654321 SSC,HSC,Bcom,MCA 2000,2002,2006,2010 7654322 SSC,HSC,Bcom 2002,2004,2007 7654323 SSC,HSC,BE 2002,2004,2008 How can this be done?

    Read the article

  • how to write a function to output unconstant loop with PHP

    - by tunpishuang
    here is the function description test($argv) $argv is an array , for example $argv=array($from1,$to1,$from2,$to2.....); array items must be even. $argv=array(1,2,4,5) : this will output values like below: 1_4 1_5 2_4 2_5 the number of arrray $argv's is not constant. maybe 3 or 4 levels of loop will be outputed. i know this will used RECURSIVE , but i don't know exatly how to code.

    Read the article

  • C puzzle: Output of printf should be '5' always

    - by pragadheesh
    Hi, I found this puzzle in a C aptitude paper. void change() { //write something in this function so that output of printf in main function //should always give 5.you can't change the main function } int main() { int i = 5; change(); i = 10; printf("%d", i); return 0; } Any solutions.?

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >