Search Results

Search found 29 results on 2 pages for 'sidney yin'.

Page 1/2 | 1 2  | Next Page >

  • How the yin-yang puzzle works?

    - by Hrundik
    I'm trying to grasp the semantics of call/cc in Scheme, and the Wikipedia page on continuations shows the yin-yang puzzle as an example: (let* ((yin ((lambda (cc) (display #\@) cc) (call-with-current-continuation (lambda (c) c)))) (yang ((lambda (cc) (display #\*) cc) (call-with-current-continuation (lambda (c) c)))) ) (yin yang)) It should output @\*@\**@\**\*@\**\**@..., but I don't understand why; I'd expect it to output @\*@\**\**\**\**\*... Can somebody explain in detail why the yin-yang puzzle works the way it works?

    Read the article

  • Problem with develop of XML Schema based on an existent XML

    - by farhad
    Hello! I have a problem with the validation of this piece of XML: <?xml version="1.0" encoding="UTF-8"?> <i-ching xmlns="http://www.oracolo.it/i-ching"> <predizione> <esagramma nome="Pace"> <trigramma> <yang/><yang/><yang/> </trigramma> <trigramma> <yin/><yin/><yin/> </trigramma> </esagramma> <significato>Questa combinazione preannuncia <enfasi>boh</enfasi>, e forse anche <enfasi>mah, chissa</enfasi>.</significato> </predizione> <predizione> <esagramma nome="Ritorno"> <trigramma> <yang/><yin/> <yin/> </trigramma> <trigramma> <yin/><yin/><yin/> </trigramma> </esagramma> <significato>Si prevede con certezza <enfasi>qualcosa</enfasi>, <enfasi>ma anche <enfasi>no</enfasi></enfasi>.</significato> </predizione> </i-ching> This XML Schema was developed with Russian Dolls technique: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.oracolo.it/i-ching" targetNamespace="http://www.oracolo.it/i-ching" > <xsd:element name="i-ching"> <xsd:complexType> <xsd:sequence> <xsd:element name="predizione" minOccurs="0" maxOccurs="64"> <xsd:complexType> <xsd:sequence> <xsd:element name="esagramma"> <xsd:complexType> <!-- vi sono 2 trigrammi --> <xsd:sequence> <xsd:element name="trigramma" minOccurs="2" maxOccurs="2"> <xsd:complexType> <xsd:sequence minOccurs="3" maxOccurs="3"> <xsd:choice> <xsd:element name="yang"/> <xsd:element name="yin"/> </xsd:choice> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> <xsd:attribute name="nome" type="xsd:string"/> </xsd:complexType> </xsd:element> <!-- significato: context model misto --> <xsd:element name="significato"> <xsd:complexType mixed="true"> <xsd:sequence> <xsd:element name="enfasi" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> For exercise I have to develop an XML Schema to validate the previous XML. The problem is that oxygen says me this: cvc-complex-type.2.4.a: Invalid content was found starting with element 'predizione'. One of '{predizione}' is expected. Start location: 3:6 End location: 3:16 URL: http://www.w3.org/TR/xmlschema-1/#cvc-complex-type why? is it something wrong with my xml schema? thank you very much

    Read the article

  • Change language encoding for file uploading

    - by jc.yin
    Previously we were running a Wordpress site on a Mac OS Server machine. We had several hundred images with Chinese characters for the image names. Now we're trying to migrate to a Ubuntu system and everything is fine except the images. Every time I try to upload an image with a Chinese name via FTP, I get the following message: "MyImage contains illegal characters. Please choose an appropriate text encoding" I have no idea how to solve this issue, do I need to somehow change the system language encoding in Ubuntu to allow for image uploading? Thanks

    Read the article

  • How to FTP transfer files to /var/www?

    - by jc.yin
    I'm new to linux and I've set up a web server with Ubuntu Desktop edition so I can practice with the GUI a bit before transitioning to Ubuntu Server. I've already set up a LAMP stack as well as FTP. Now I just need to know how to transfer my web files to the /var/www folder in Ubuntu. Previously I've worked on Mac OS and there's a central server for all the web files where I can FTP to. Anyone able to help me understand how do I FTP to the /var/www folder in Ubuntu? Thanks

    Read the article

  • Wireless card overheating?

    - by Sidney
    Ok, so I've had my laptop for several years (I wanna say 4, but possibly more), it's a Toshiba Satellite. I'm running Linux mint 15, and am having a strange new issue, after several hours of running my wireless stops. It can SEE wireless networks, but refuses to connect to any of them. (On a sidenote, connecting to a router with a cable at this point works fine) The fact that it can SEE the networks make me think the card is in good condition, and it's software related The fact that it works for several hours before booting me makes me think perhaps the transmitter is getting too hot. I don't use my laptop in dusty environments, and keep it on an elevated surface (alternatively, I actively try not to let it sit on soft surfaces where the vents get covered). I spray out the cpu fan about once a year with compressed air about once a year, so I really don't think the insides should be too dirty. Finally, unfortunately, sensors only gives me CPU temps, but they run about 40-50 degrees C, which from my understanding is perfectly normal for an I3. Does anyone have any suggestions on what I can do to determine the root cause of this?

    Read the article

  • Inconsistent accessibility error in xna.

    - by Tom
    Hey all, you may remember me asking a question regarding a snake game I was creating about two weeks ago. Well I'm quite far now into making the game (thanks to a brilliant tutorial I found). But I've come across the error described named above. So heres my problem; I have a SnakeFood class that has a method called "Reposition". In the game1 class I have a method called "UpdateInGame" which calls the reposition method to load an orange that spawns in a random place every second. My latest piece of code changed the reposition method to allow the snake I have on the screen to not be overlapped by the orange that randomly spawns. Now I get the error (in full): Error 1 Inconsistent accessibility: parameter type 'TheMathsSnakeGame.Snake' is less accessible than method 'TheMathsSnakeGame.SnakeFood.Reposition(TheMathsSnakeGame.Snake)' C:\Users\Tom\Documents\Visual Studio 2008\Projects\TheMathsSnakeGame\TheMathsSnakeGame\SnakeFood.cs 33 21 TheMathsSnakeGame I understand what the errors trying to tell me but having changed the accessiblity of the methods, I still can't get it to work. Sorry about the longwinded question. Thanks in advance :) Edit: Code I'm using (Game1 Class) private void UpdateInGame(GameTime gameTime) { //Calls the oranges "reposition" method every second if (gameTime.TotalGameTime.Milliseconds % 1000 == 0) orange.Reposition(sidney); sidney.Update(gameTime); } (SnakeFood Class) public void Reposition(Snake snake) { do { position = new Point(rand.Next(Grid.maxHeight), rand.Next(Grid.maxWidth)); } while (snake.IsBodyOnPoint(position)); }

    Read the article

  • In Django, how to create tables from an SQL file when syncdb is run

    - by Sidney
    Hi, How do I make syncdb execute SQL queries (for table creation) defined by me, rather then generating tables automatically. I'm looking for this solution as some particular models in my app represent SQL-table-views for a legacy-database table. So, I've created their SQL-views in my django-DB like this: CREATE VIEW legacy_series AS SELECT * FROM legacy.series; I have a reverse engineered model that represents the above view/legacytable. But whenever I run syncdb, I have to create all the views first by running sql scripts, otherwise syncdb simply creates tables for them (if a view is not found). How do I make syncdb run the above mentioned SQL?

    Read the article

  • How much Java should I have learnt before trying Android programming?

    - by Sidney Yin
    Hi - I have been seeking beginner learning books in Android, and of course found out that I should learn Java first. So I began studying Java and now I am quite comfortable with objects, classes, inheritance, interfaces, and just moved onto Layouts in Swing as well as Swing Features. But I am starting to wonder.... do I know enough about Java now? Can I start programming Android yet? Of course I can keep going in Java, but have been itching to begin programming Android apps. Any definitive answer here about how much Java I need to know before Android? Thanks so much!

    Read the article

  • Create 301 Redirection in Amazon Route 53 for Wildcard Subdomains

    - by Eric Yin
    My domain name hosted on Route 53 DNS. Amazon has a guide to do 301 redirection for www. To naked domain by point www. version to a S3 static website with 301 setted up. My question is, how can I have *.domain.com all have 301 redirec to naked domain name. I guess either: Some way to get all wildcard subdomains end up into one S3 bucket, how? Or: Use CloudFront on the www. version S3 site and put wildcard subdomains on the CloudFront, but how? Or: There's some hidden settings just lies on Router 53, then where? Or: use EC2, better not suggest me this, too costing for this task. Please advice.

    Read the article

  • Ubuntu how to FTP transfer files to folder /var/www?

    - by jc.yin
    I'm new to linux and I've set up a web server with Ubuntu Desktop edition so I can practice with the GUI a bit before transitioning to Ubuntu Server. I've already set up a LAMP stack as well as FTP. Now I just need to know how to transfer my web files to the /var/www folder in Ubuntu. Previously I've worked on Mac OS and there's a central server for all the web files where I can FTP to. Now after I've managed to connect via FTP to the Ubuntu server, I see all the folders such as Desktop, Downloads, Documents etc but no web folder. Anyone able to help me understand how do I FTP to the /var/www folder in Ubuntu? Thanks

    Read the article

  • Good projects to learn OCaml and F#

    - by Yin Zhu
    After learning the basic syntax, reading some non-trivial code is a fast way to learn a language. We can also learn how to design a library/software during reading others' code. I have following lists. A Chess program in OCaml by Tomek Czajka. Hal Daumé has written several machine learning libraries in Ocaml. Including decision trees, logistic regression and SVM. All of them are near-production-quality code. A Chess Game Analysis program in F# in Microsoft Research. The above three are my favorites. Will you suggest some other sources? General purpose open source software are good, specialized open source like the three I list here are even more welcome.

    Read the article

  • How to disable Excel's auto recognition of numbers and text

    - by Yin Zhu
    I used Python to generate a CSV file. But when I open it in Excel, Excel will auto recognize a string into a number if it could be converted. e.g.33E105, which is actually an ID, not a number. How to disable this in Excel while opening a CSV file? Or I need to resort to a excel-python library to output a excel file and specify the format myself? Thanks!

    Read the article

  • read a file with both text and binary information in .Net

    - by Yin Zhu
    I need to read binary PGM image files. Its format: P5 # comments nrows ncolumns max-value binary values start at this line. (totally nrows*ncolumns bytes/unsigned char) I know how to do it in C or C++ using FILE handler by reading several lines first and read the binary block. But don't know how to do it in .Net.

    Read the article

  • The speed of .NET in numerical computing

    - by Yin Zhu
    In my experience, .net is 2 to 3 times slower than native code. (I implemented L-BFGS for multivariate optimization). I have traced the ads on stackoverflow to http://www.centerspace.net/products/ the speed is really amazing, the speed is close to native code. How can they do that? They said that: Q. Is NMath "pure" .NET? A. The answer depends somewhat on your definition of "pure .NET". NMath is written in C#, plus a small Managed C++ layer. For better performance of basic linear algebra operations, however, NMath does rely on the native Intel Math Kernel Library (included with NMath). But there are no COM components, no DLLs--just .NET assemblies. Also, all memory allocated in the Managed C++ layer and used by native code is allocated from the managed heap. Can someone explain more to me? Thanks!

    Read the article

  • PInvoke or using /clr:pure to compile

    - by Yin Zhu
    I have a set of numerical libraries in C++ and I want to call them interactively in a interpretive language like F# or IronPython. So I have two choices now: Compile the library in native DLL and use PInvoke to call functions in it. Compile the C++ library to .Net dll using visual c++ (/clr:pure compile option). The advantage of 1 is that it is very fast, however there are more work in it, e.g. I cannot PInvoke double pointer (e.g. float **), I must write another wrapper in the C++ library to make the interface friendly to .Net. The advantage of 2 is that I don't need to do know Mashaling strings, arrays, etc. However, the .net dll is slower compared to the native one. What others factors should be considered when choosing between the two?

    Read the article

  • Compiling a c++ project using blas (Fortran) in Matlab mex

    - by Yin Zhu
    I am trying to use a package here. I have no problem compiling it under 64-bit Linux as all the Makefiles are already provides. Only minor changes are needed, which I can handle. However, I have a problem compiling it under 64-bit Windows. I have installed gfortran and also compiled BLAS and CBLAS to their static libraries. The problem is that Matlab mex does not support GCC in windows, so I need to use VC 2008 instead. I found in the Makefile this line is to get the final klr_train.mexw64: klr_train.$(MEX_EXT): klr_train.cpp $(MEX) $(MEX_OPTION) klr_train.cpp ../libklr/libklr.cpp $(CBLASDIR)/lib/LINUX/cblas_LINUX.a $(BLASDIR)/blas_LINUX.a -lgfortran I don't know how to execute this line using VC 2008's command line tool cl. As cl obviously does not support -lgfortran, which I think is used to link some library in gfortran to support BLAS.

    Read the article

  • Understanding F# Asynchronous Programming

    - by Yin Zhu
    I kind of know the syntax of asynchronous programming in F#. E.g. let downloadUrl(url:string) = async { let req = HttpWebRequest.Create(url) // Run operation asynchronously let! resp = req.AsyncGetResponse() let stream = resp.GetResponseStream() // Dispose 'StreamReader' when completed use reader = new StreamReader(stream) // Run asynchronously and then return the result return! reader.AsyncReadToEnd() } In F# expert book (and many other sources), they say like let! var = expr simply means "perform the asynchronous operation expr and bind the result to var when the operation completes. Then continue by executing the rest of the computation body" I also know that a new thread is created when performing async operation. My original understanding was that there are two parallel threads after the async operation, one doing I/O and one continuing to execute the async body at the same time. But in this example, I am confused at let! resp = req.AsyncGetResponse() let stream = resp.GetResponseStream() What happens if resp has not started yet and the thread in the async body wants to GetResponseStream? Is this a possible error? So maybe my original understanding was wrong. The quoted sentences in the F# expert book actually means that "creating a new thread, hang the current thread up, when the new thread finishes, wake up the body thread and continue", but in this case I don't see we could save any time. In the original understanding, the time is saved when there are several independent IO operations in one async block so that they could be done at the same time without intervention with each other. But here, if I don't get the response, I cannot create the stream; only I have stream, I can start reading the stream. Where's the time gained?

    Read the article

  • Best method to compress JSON string in term of performance and compress radio

    - by Eric Yin
    For a JSON string, contains all kinds of settings, numbers, string etc. Total JSON string fairly fall into 10k~50K range. I want to compress it before save to database. So I wonder which compress method should I choose, I am using c# 4, I know I can choose gzip and deflate but the compression radio is not good (although speed is good). More specific, compress can be a little slow (since only once) but should be small. Decompress should be lighting fast since decompress happens lots. Please give some advice.

    Read the article

  • How to compile a svn python binding for windows from the source?

    - by yin-gang
    I'm setting up a new svn+trac environment, the svn server's version is 1.6.11, then I can't find any corresponding pre-compiled svn-python binding, finally I found the following thread: http://stackoverflow.com/questions/677252/python-svn-bindings-for-windows so, my question is: how to compile from these source? http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/python/

    Read the article

  • The internal implementation of R's dataset

    - by Yin Zhu
    I am trying to build a data processing program. Currently I use a double matrix to represent the data table, each row is an instance, each column represents a feature. I also have an extra vector as the target value for each instance, it is of double type for regression, it is of integer for classification. I want to make it more general. I am wondering how what kind of structure R uses to store a dataset, i.e. the internal implementation in R.

    Read the article

  • code folding in Visual Studio for F#

    - by Yin Zhu
    I find that I tend to write long source files in F#. Some open source projects in F# also have long source files, e.g. FPersec and F# for excel. So it would be very helpful if code folding (even very limited support) is available in VS for F#. E.g. in a module, we can fold out functions that are stable, only leave functions that are subject to change unfold. Is this feature easy to be supported, e.g. by a third party vendor?

    Read the article

  • git merge, git rebase none seems to work, should I delete my github fork and refork from the upstream master?

    - by Joan Yin
    I have to confess my github sins. 4 month ago, I forked a upstream repo, without knowing much of git and pull request, i did some work on master branch locally, later on I realized the mistake, created a new branch, and squashed the changes to one and successfully send a PR later from that branch. the PR is accepted, and I moved on. Now I need to submit another PR. But my master branch is so messed up, when I do merge, or rebase, there are so many mistakes. I probably committed a few more sins this morning. I have been battling this for the whole morning now. so it comes to the point that I want a clean start. Can I delete the github fork and refork from the upstream master? What are the correct steps?

    Read the article

  • Le PDG de Netgear s'en prend à Apple et à « l'égo » de Steve Job et trouve que Windows Phone 7 est « Game Over »

    Le PDG de Netgear s'en prend à Apple et à « l'égo » de Steve Job Et trouve que Windows Phone 7 n'a aucune chance Apple, dont l'écosystème fermé suscite les critiques de cetains, s'est vu très vertement critiqué par Patrick Lo, le PDG de Netgear, qui s'en est également pris à la personnalité de Steve Jobs et à Microsoft. Interrogé par le Sidney Morning Herald, Lo a ainsi critiqué la décision de Steve Jobs dans l'affaire Flash - iOS « Quelle raison a-t-il de s'en prendre à Flash ? ». Un point de vue qui est partagé par d'autres. Mais Lo a sa propre explication : « Il n'y a aucune autre raison que son égo ». Lo trouve aussi critiquable la décision d'Apple de cent...

    Read the article

  • SQL Query - Count column values separately

    - by user575535
    I have a hard time getting a Query to work right. This is the DDL for my Tables CREATE TABLE Agency ( id SERIAL not null, city VARCHAR(200) not null, PRIMARY KEY(id) ); CREATE TABLE Customer ( id SERIAL not null, fullname VARCHAR(200) not null, status VARCHAR(15) not null CHECK(status IN ('new','regular','gold')), agencyID INTEGER not null REFERENCES Agency(id), PRIMARY KEY(id) ); Sample Data from the Tables AGENCY id|'city' 1 |'London' 2 |'Moscow' 3 |'Beijing' CUSTOMER id|'fullname' |'status' |agencyid 1 |'Michael Smith' |'new' |1 2 |'John Doe' |'regular'|1 3 |'Vlad Atanasov' |'new' |2 4 |'Vasili Karasev'|'regular'|2 5 |'Elena Miskova' |'gold' |2 6 |'Kim Yin Lu' |'new' |3 7 |'Hu Jintao' |'regular'|3 8 |'Wen Jiabao' |'regular'|3 I want to produce the following output, but i need to count separately for ('new','regular','gold') 'city' |new_customers|regular_customers|gold_customers 'Moscow' |1 |1 |1 'Beijing'|1 |2 |0 'London' |1 |1 |0

    Read the article

1 2  | Next Page >