Search Results

Search found 20383 results on 816 pages for 'hello'.

Page 44/816 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • utf8 codification problem C#, writing a tex file, and compiling with pdflatex

    - by voodoomsr
    Hi, i have the next code written in C#....it create a tex file using utf-8.....the problem is that appears that is not a real valid utf-8 file because, when i use pdflatex it doesn't recognize the characters with accents. Somebody knows a way to write a real UTF-8 file? When i use TexmakerX to create a utf8 file with the same latex code, pdflatex doesn't complaints, so the problem must be in the generation. FileInfo file = new FileInfo("hello.tex"); StreamWriter writer = new StreamWriter("hello.tex", false, Encoding.UTF8); writer.Write(@"\documentclass{article}" + "\n" + @"\usepackage[utf8]{inputenc}" + "\n" + @"\usepackage[spanish]{babel}" + "\n" + @"\usepackage{listings}" + "\n" + @"\usepackage{fancyvrb}" + "\n" + @"\begin{document}" + "\n" + @"\title{asd}" + "\n" + @"\maketitle" + "\n" + @"\section{canción}" + "\n" + @"canción" + "\n" + @"\end{document}"); writer.Close();

    Read the article

  • Objective-C (iPhone) Memory Management

    - by Steven
    I'm sorry to ask such a simple question, but it's a specific question I've not been able to find an answer for. I'm not a native objective-c programmer, so I apologise if I use any C# terms! If I define an object in test.h @interface test : something { NSString *_testString; } Then initialise it in test.m -(id)init { _testString = [[NSString alloc] initWithString:@"hello"]; } Then I understand that I would release it in dealloc, as every init should have a release -(void)dealloc { [_testString release]; } However, what I need clarification on is what happens if in init, I use one of the shortcut methods for object creation, do I still release it in dealloc? Doesn't this break the "one release for one init" rule? e.g. -(id)init { _testString = [NSString stringWithString:@"hello"]; } Thanks for your helps, and if this has been answered somewhere else, I apologise!! Steven

    Read the article

  • Create a permalink with Javascript

    - by Jon Romero
    I have a textbox where a user puts a string like this: "hello world! I think that __i__ am awesome (yes I am!)" I need to create a correct url like this: hello-world-i-think-that-i-am-awesome-yes-i-am How can be done using reg expressions? Also, is it possible to do it with Greek (for example)? "Ge?a s?? ??sµe" turns to geia-sou-kosme In other programming languages (python/ruby) I am using a translation array. Should I do the same here?

    Read the article

  • gdb+osx: no output when using printf/CFShow

    - by yairchu
    I attached to a program with gdb in OSX and I want to use CFShow in the gdb console etc. However, nothing shows up. printf shows nothing as well: (gdb) call (int) printf("Hello\n") $10 = 6 (gdb) call (int) printf("Hello World!\n") $11 = 13 Apple suggests the following tip for when attaching with gdb, to make the output appear in the gdb console: (gdb) call (void) close(1) (gdb) call (void) close(2) (gdb) shell tty /dev/ttyp1 (gdb) call (int) open("/dev/ttyp1", 2, 0) $1 = 1 (gdb) call (int) open("/dev/ttyp1", 2, 0) $2 = 2 In xcode's gdb console tty gives "not a tty", so I tried it in gdb in a terminal. There tty does work but after redirecting stdout there's still no output. Also no output if I direct stdout to a file.. :/ Any salvation?

    Read the article

  • f:ajax problem JSF

    - by Nitesh Panchal
    This is my code :- <p:carousel var="item" animate="true" circular="true" rows="2" effect="easeOutStrong" value="#{RegisterBean.objBlogTemplateList}"> <h:inputHidden id="hdnBlogTemplateId" binding="#{RegisterBean.hdnBlogTemplateId}" value="#{item.templateId}"/> <h:graphicImage alt="#{item.templatePicName}" style="border: solid 5px white;width: 200px;height: 200px;" value="#{app:getCommonImagePath(item.templatePicName)}"> <f:ajax event="click" execute="hdnBlogTemplateId" listener="#{RegisterBean.setBlogTheme}"/> </h:graphicImage> </p:carousel> This is my managed bean code :- private HtmlInputHidden hdnBlogTemplateId; public HtmlInputHidden getHdnBlogTemplateId() { return hdnBlogTemplateId; } public void setHdnBlogTemplateId(HtmlInputHidden hdnBlogTemplateId) { this.hdnBlogTemplateId = hdnBlogTemplateId; } public void setBlogTheme(AjaxBehaviorEvent e){ System.out.println("Hello"); //System.out.println(hdnBlogTemplateId.getValue()); //System.out.println(objGraphic.toString()); } Hello is never printed in my console. Please help.

    Read the article

  • Traversing Scheme function as a list

    - by csl
    Isn't it possible to treat functions in Scheme as any other list? Basically, what I want do to is something like this: (define (foo) "hello") (cdr foo) ; or similar, should return the list ((foo) "hello") I've found a similar discussion about this, and I feel a bit disappointed if this is not possible with Scheme. If so, why is this impossible? Is it possible in other lisps? EDIT: Changed (cdr 'foo) to (cdr foo) -- it was misleading. I'm asking, why can't I access a function as a list?

    Read the article

  • Using a javax.servlet.Filter with Compojure

    - by mikera
    I'm trying to build a simple web site using Clojure / Compojure and want to feed apply a servlet filter to the request / response (i.e. a standard javax.servlet.Filter instance). e.g. if the current source code is: (defroutes my-app (GET "/*" (html [:h1 "Hello Foo!!"])) ) I would like to add a filter like this: (defroutes my-app (GET "/*" (FILTER my-filter-name (html [:h1 "Hello Foo!!"]))) ) Where my-filter-name is some arbitrary instance of javax.servlet.Filter. Any idea how to do this effectively and elegantly?

    Read the article

  • How to remove default header from WCF REST Outgoing Response?

    - by bmsantos
    The following C# WCF based REST service gives me some undesired headers that I'm not sure if I can remove them trough the API. The interface: [ServiceContract] public interface IControlSystem { [OperationContract] [WebGet] System.IO.Stream About(); } The implementation: public class ControlSystem : IControlSystem { public System.IO.Stream About() { return new System.IO.MemoryStream(ASCIIEncoding.Default.GetBytes("Hello World")); } } Out of a raw socket connection it gives the following response: HTTP/1.1 200 OK Server: ASP.NET Development Server/9.0.0.0 Date: Tue, 15 Jun 2010 13:12:51 GMT X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: application/octet-stream Content-Length: 39 Connection: Close Hello World Question is, is it possible to get the server to not report anything other than the actual message? Need it in some calls so due to some small embedded device clients that will try to connect to the server and I would like to minimize the amount of parsing. Thanks, B.

    Read the article

  • SCJP question: Method ambiguous

    - by Markos Fragkakis
    Take a look at this code: public class Test { public static void main(String... args) { flipFlop("hello", new Integer(4), 2004); // flipFlop("hello", 10, 2004); // this works! } private static void flipFlop(String str, int i, Integer iRef) { System.out.println(str + " (String, int, Integer)"); } private static void flipFlop(String str, int i, int j) { System.out.println(str + " (String, int, int)"); } } The compiler gives an error that the invocation is ambiguous: Description Resource Path Location Type The method flipFlop(String, int, Integer) is ambiguous for the type Test Test.java scjp19 - inheritence/src line 3 Java Problem But if the commented-out line is used ti invoke flip-flop, the method is unambiguously invoked (the second one, because autoboxing comes after using the primitive itself). I would expect the compiler to see that the second argument will be unboxed one way or the other, and judge what method must be invoked depending on the third argument. Why does not this happen? What is the rationale?

    Read the article

  • WCF Method is returning xml fragment but no xml UTF-8 header

    - by horls
    My method does not return the header, just the root element xml. internal Message CreateReturnMessage(string output, string contentType) { // create dictionaryReader for the Message byte[] resultBytes = Encoding.UTF8.GetBytes(output); XmlDictionaryReader xdr = XmlDictionaryReader.CreateTextReader(resultBytes, 0, resultBytes.Length, Encoding.UTF8, XmlDictionaryReaderQuotas.Max, null); if (WebOperationContext.Current != null) WebOperationContext.Current.OutgoingResponse.ContentType = contentType; // create Message return Message.CreateMessage(MessageVersion.None, "", xdr); } However, the output I get is: <Test> <Message>Hello World!</Message> </Test> I would like the output to render as: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <Test> <Message>Hello World!</Message> </Test>

    Read the article

  • java json/object to array

    - by heldopslippers
    Hi people. I have a question about type casting. I have the following json String: {"server":"clients","method":"whoIs","arguments":["hello"]} I am parsing it to the following Map< String, Object {arguments=[hello], method=whoIs, server=clients} It is now possible to do the following: request.get("arguments"); This works fine. But i need to get the array the is stored in the arguments. How can i accomplish this? I tried (for example) the following: System.out.println(request.get("arguments")[0]); But of course this doesn't work.. Does anybody know how this would be possible?

    Read the article

  • Python 3 with the range function

    - by Leif Andersen
    I can type in the following code in the terminal, and it works: for i in range(5): print(i) And it will print: 0 1 2 3 4 as expected. However, I tried to write a script that does a similar thing: print(current_chunk.data) read_chunk(file, current_chunk) numVerts, numFaces, numEdges = current_chunk.data print(current_chunk.data) print(numVerts) for vertex in range(numVerts): print("Hello World") current_chunk.data is gained from the following method: def read_chunk(file, chunk): line = file.readline() while line.startswith('#'): line = file.readline() chunk.data = line.split() The output for this is: ['OFF'] ['490', '518', '0'] 490 Traceback (most recent call last): File "/home/leif/src/install/linux2/.blender/scripts/io/import_scene_off.py", line 88, in execute load_off(self.properties.path, context) File "/home/leif/src/install/linux2/.blender/scripts/io/import_scene_off.py", line 68, in load_off for vertex in range(numVerts): TypeError: 'str' object cannot be interpreted as an integer So, why isn't it spitting out Hello World 490 times? Or is the 490 being thought of as a string? I opened the file like this: def load_off(filename, context): file = open(filename, 'r')

    Read the article

  • gridComplete is not working in jquery?

    - by kumar
    script type="text/javascript"> $(document).ready(function() { var RegisterGridEvents = function(excGrid) { //Register column chooser $(excGrid).jqGrid('navButtonAdd', excGrid + '_pager', { caption: "Columns", title: "Reorder Columns", onClickButton: function() { $(excGrid).jqGrid('columnChooser'); }, gridComplete: funtion(){ alert("hello"); } }); $(".ui-pg-selbox").hide(); $('.ui-jqgrid-htable th:first').prepend('Select All').attr('style', 'font-size:7px'); //Register grid resize $(excGrid).jqGrid('gridResize', { minWidth: 350, maxWidth: 1500, minHeight: 400, maxHeight: 12000 }); }; $('#specialist-tab').tabs("option", "disabled", [2, 3, 4]); $('.button').button(); RegisterButtonEvents(); RegisterGridEvents("#ExceptionsGrid") }); </script> i am not able to display hello mesage after the grid loading? thanks

    Read the article

  • Actual table Vs. Div table

    - by omfgroflmao
    This <table> <tr> <td>Hello</td> <td>World</td> </tr> </table> Can be done with this: <div> <div style="display: table-row;"> <div style="display: table-cell;">Hello</div> <div style="display: table-cell;">World</div> </div> </div> Now, is there any difference between these two in terms of performance and/or render speed or they're just the same?

    Read the article

  • Java JEditorPane Format

    - by ikurtz
    im trying to implement a Chat feature in my application. i have used 2 JEditorPane. one for holding chat history and the other for sending chat to the previous JEditorPane. the JEditorPane is text/html type. the problem i am having is when i put more than one space between characters it is automatically removed by the parser because it is HTML! how can i make it so, that the spaces are not stripped? example: hello world becomes: hello world. also i am having to parse the html tags so the new messages can be added to the history window. is there a better option than using JEditorPane? if i used JTextPane would it be easier to implement? i would like the chat boxes/panes to be able to handle bold, URL embedding for now. thank you and look forward to your guidance.

    Read the article

  • Outputting Javascript from PHP?

    - by Aristotle
    Are there any libraries or tools specifically designed to help PHP programmers write Javascript? Essentially, converting the PHP logic into Javascript logic. For instance: $myFoo = $document->getElementById("foo"); $myFoo->value = "Hello World"; Being converted into the following output: var myFoo = document.getElementById("foo"); myFoo.value = "Hello World"; Of course it would be excellent if more complicated solutions could be derived too, perhaps converting objects and internal methods into javascript-objects, etc.

    Read the article

  • Adding Functions to an Implementation of Vector

    - by Meursault
    I have this implementation of vector that I've been working on for a few days using examples from a textbook: #include <iostream> #include <string> #include <cassert> #include <algorithm> #include <cstring> // Vector.h using namespace std; template <class T> class Vector { public: typedef T * iterator; Vector(); Vector(unsigned int size); Vector(unsigned int size, const T & initial); Vector(const Vector<T> & v); // copy constructor ~Vector(); unsigned int capacity() const; // return capacity of vector (in elements) unsigned int size() const; // return the number of elements in the vector bool empty() const; iterator begin(); // return an iterator pointing to the first element iterator end(); // return an iterator pointing to one past the last element T & front(); // return a reference to the first element T & back(); // return a reference to the last element void push_back(const T & value); // add a new element void pop_back(); // remove the last element void reserve(unsigned int capacity); // adjust capacity void resize(unsigned int size); // adjust size void erase(unsigned int size); // deletes an element from the vector T & operator[](unsigned int index); // return reference to numbered element Vector<T> & operator=(const Vector<T> &); private: unsigned int my_size; unsigned int my_capacity; T * buffer; }; template<class T>// Vector<T>::Vector() { my_capacity = 0; my_size = 0; buffer = 0; } template<class T> Vector<T>::Vector(const Vector<T> & v) { my_size = v.my_size; my_capacity = v.my_capacity; buffer = new T[my_size]; for (int i = 0; i < my_size; i++) buffer[i] = v.buffer[i]; } template<class T>// Vector<T>::Vector(unsigned int size) { my_capacity = size; my_size = size; buffer = new T[size]; } template<class T>// Vector<T>::Vector(unsigned int size, const T & initial) { my_size = size; //added = size my_capacity = size; buffer = new T [size]; for (int i = 0; i < size; i++) buffer[i] = initial; } template<class T>// Vector<T> & Vector<T>::operator = (const Vector<T> & v) { delete[ ] buffer; my_size = v.my_size; my_capacity = v.my_capacity; buffer = new T [my_size]; for (int i = 0; i < my_size; i++) buffer[i] = v.buffer[i]; return *this; } template<class T>// typename Vector<T>::iterator Vector<T>::begin() { return buffer; } template<class T>// typename Vector<T>::iterator Vector<T>::end() { return buffer + size(); } template<class T>// T& Vector<T>::Vector<T>::front() { return buffer[0]; } template<class T>// T& Vector<T>::Vector<T>::back() { return buffer[size - 1]; } template<class T> void Vector<T>::push_back(const T & v) { if (my_size >= my_capacity) reserve(my_capacity +5); buffer [my_size++] = v; } template<class T>// void Vector<T>::pop_back() { my_size--; } template<class T>// void Vector<T>::reserve(unsigned int capacity) { if(buffer == 0) { my_size = 0; my_capacity = 0; } if (capacity <= my_capacity) return; T * new_buffer = new T [capacity]; assert(new_buffer); copy (buffer, buffer + my_size, new_buffer); my_capacity = capacity; delete[] buffer; buffer = new_buffer; } template<class T>// unsigned int Vector<T>::size()const { return my_size; } template<class T>// void Vector<T>::resize(unsigned int size) { reserve(size); my_size = size; } template<class T>// T& Vector<T>::operator[](unsigned int index) { return buffer[index]; } template<class T>// unsigned int Vector<T>::capacity()const { return my_capacity; } template<class T>// Vector<T>::~Vector() { delete[]buffer; } template<class T> void Vector<T>::erase(unsigned int size) { } int main() { Vector<int> v; v.reserve(2); assert(v.capacity() == 2); Vector<string> v1(2); assert(v1.capacity() == 2); assert(v1.size() == 2); assert(v1[0] == ""); assert(v1[1] == ""); v1[0] = "hi"; assert(v1[0] == "hi"); Vector<int> v2(2, 7); assert(v2[1] == 7); Vector<int> v10(v2); assert(v10[1] == 7); Vector<string> v3(2, "hello"); assert(v3.size() == 2); assert(v3.capacity() == 2); assert(v3[0] == "hello"); assert(v3[1] == "hello"); v3.resize(1); assert(v3.size() == 1); assert(v3[0] == "hello"); Vector<string> v4 = v3; assert(v4.size() == 1); assert(v4[0] == v3[0]); v3[0] = "test"; assert(v4[0] != v3[0]); assert(v4[0] == "hello"); v3.pop_back(); assert(v3.size() == 0); Vector<int> v5(7, 9); Vector<int>::iterator it = v5.begin(); while (it != v5.end()) { assert(*it == 9); ++it; } Vector<int> v6; v6.push_back(100); assert(v6.size() == 1); assert(v6[0] == 100); v6.push_back(101); assert(v6.size() == 2); assert(v6[0] == 100); v6.push_back(101); cout << "SUCCESS\n"; } So far it works pretty well, but I want to add a couple of functions to it that I can't find examples for, a SWAP function that would look at two elements of the vector and switch their values and and an ERASE function that would delete a specific value or range of values in the vector. How should I begin implementing the two extra functions?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >