Search Results

Search found 21 results on 1 pages for 'hei'.

Page 1/1 | 1 

  • What's the default traditional Chinese font?

    - by janoChen
    The only fonts that can render Chinese text are: WenQuanYi Micro Hei, WenQuanYi Micro Hei Mono, Droid Sans (I think is unicode), FreeSans (I think is unicode too). Changing Chinese text to Sans, FreeSans, Droid Sans render the same font). WenQuanYi Micro Hei, WenQuanYi Micro Hei Mono render 'bolder' Chinese text. EDIT: What I discovered so far: Is not WenQuanYi Micro Hei, WenQuanYi Micro Hei, Droid Sans Fallback (Droid with CJK support). It can only be FreeSans, or Deja vu Sans. I'm not sure which one is being used as default one (clean installation) Any idea?

    Read the article

  • Which data structures and algorithms book should I buy?

    - by Hei
    I know C and C++ and I have some experience with Java, but I don't know too much about Algorithms and Data Structures. I did a search on Amazon, but I don't know what book should I choose. I don't want a book which put its basis only on the theoretic part; I want the practical part too (probably more than the theoretical one :) ). I don't want the code to be implemented in a certain language, but if is in Java, probably I would happier. :)

    Read the article

  • How to insert into a table with just one IDENTITY column (SQL Server CE)

    - by Hei
    Hello I am trying to insert a value in a one IDENTITY column Table in SQL Server CE 3.5. I Tried the following: INSERT Target DEFAULT VALUES INSERT Target (ID) VALUES (DEFAULT) INSERT Target (ID) VALUES () But none of them worked. This is the SQL command I used to create the table (Using SQL Server Management Studio): CREATE TABLE Target( ID int NOT NULL IDENTITY (1, 1) PRIMARY KEY ); Microsoft help site (http://msdn.microsoft.com/en-us/library/ms174633%28SQL.90%29.aspx) mentions that DEFAULT values are not valid for identity columns however they do not mention any alternative. They mention something about uniqueidentifier and ROWGUID but I have not been able to make it work. I would appreciate any pointers on how to solve this problem or links to documentation about valid sql commands for sql server CE. Thank you

    Read the article

  • VB.NET: WithEvents not Working

    - by Hei
    Hello All, I have the following classes: Public Class Email Private Shared ReadOnly EMAIL_REGEX = "\b[a-zA-Z]+[a-zA-Z0-9._+-]+@" + _ "[a-zA-Z0-9.-]+\.[a-zA-Z]{2,3}\b" Private _email As String Public Event emailCreated() ' Declare empty constructor private so the only way to create an object ' is using new (email) Private Sub New() End Sub Sub New(ByVal email As String) If Regex.IsMatch(email, EMAIL_REGEX) Then _email = email RaiseEvent emailCreated() Else Throw New Exception("Email Not Valid") End If End Sub ReadOnly Property Email() As String Get Return _email End Get End Property End Class And Public Class EmailForm WithEvents myEmail As Email Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try myEmail = New Email(TextBox1.Text) Catch ex As Exception MessageBox.Show("Exception: " & ex.Message) End Try End Sub Public Sub emailCreated() Handles myEmail.emailCreated MessageBox.Show("New Email Created") End Sub End Class If a create a wrong email lets say "email" the exception is correctly cached and a message is showed however is i input a valid email the event is not raised, the object is being created but no message is shown and no error or exception is thrown i suspect it has something to do with using "myemail = new Email(email)" but i have seen examples of using new with withevents with no problem. I would apreciate any input about this problem thank you

    Read the article

  • Problem in IE8 with GET Parameters in opening a new windows with javascript.

    - by amfa95
    Hi, I have a problem with IE8 and the opening of a new window with javascript and submitting parameters with special characters. <a href="javascript:oWin('/html/de/4664286/printregistrationcontent.html?12-security question&#61;Wie hei&#223;t Ihr Lieblingsrestaurant','PRINT',800,600);" class="print">Seite drucken</a> The Problem is the letter 'ß' (sharp S). As you can see the string above is encodes due to anti XSS. This link works in FF and IE6 but IE8 is transmitting the URL Parameter as character with code 65*** (don't know the exaxt value). In the opening window you will only see a square (because character with 65000+ is not printable). I also tried to use URL Encoding instead of HTML encoding <a href="javascript:oWin('/html/de/4664286/printregistrationcontent.html?12-security question%3DWie hei%C3%9Ft Ihr Lieblingsrestaurant','PRINT',800,600);" class="print">Seite drucken</a> If i click on this Link in FF or IE6 it works as expected, but IE8 will fail to transmit the "ß" to the server and therefor will also get it back in the wrong way. If i paste this url to the IE8 it will work too, but not if the window is opened by javascript. The Javascript function oWin is defined as follows function oWin(url,title,sizeH,sizeV) { winHandle = top.open(url,title,'toolbar=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=no,width='+sizeH+',height='+sizeV); if(navigator.appVersion.indexOf("MSIE 3",0)==-1) id = setTimeout('winHandle.focus()',1000); } If someone has an idea where to look for the reason please answer to this. Thank you amfa

    Read the article

  • improving data extraction from text file in Java

    - by owca
    I have CSV file with sample data in this form : 220 30 255 0 0 Javascript 200 20 0 255 128 Thinking in java , where the first column is height, second thickness, next three are rgb values for color and last one is title. All need to be treated as separate variables. I have already written my own solution for this, but I'm wondering if there are no better/easier/shorter ways of doing this. Extracted data will then be used to create Book object, throw every Book into array of books and print it with swing. Here's the code : private static Book[] addBook(Book b, Book[] bookTab){ Book[] tmp = bookTab; bookTab = new Book[tmp.length+1]; for(int i = 0; i < tmp.length; i++){ bookTab[i] = tmp[i]; } bookTab[tmp.length] = b; return bookTab; } public static void main(String[] args) { Book[] books = new Book[0]; try { BufferedReader file = new BufferedReader(new FileReader("K:\\books.txt")); String s; while ((s = file.readLine()) != null) { int hei, thick, R, G, B; String tit; hei = Integer.parseInt(s.substring(0, 3).replaceAll(" ", "")); thick = Integer.parseInt(s.substring(4, 6).replaceAll(" ", "")); R = Integer.parseInt(s.substring(10, 13).replaceAll(" ", "")); G = Integer.parseInt(s.substring(14, 17).replaceAll(" ", "")); B = Integer.parseInt(s.substring(18, 21).replaceAll(" ", "")); tit = s.substring(26); System.out.println(tyt+wys+grb+R+G+B); books = addBook(new Book(wys, grb, R, G, B, tyt),books); } file.close(); } catch (IOException e) { //do nothing } }

    Read the article

  • Windows vista, IIS7 and error messages/pages

    - by Camila
    Hei, I have a new laptop installed with Windows Vista ultimate (Swedish version). I changed the display language to English, everything seems ok except error pages in IIS7 are still in Swedish. Is it possible to get error pages/messages in English ? How? Thanks in advance!

    Read the article

  • How to manipulate a string, variable in shell

    - by user558134
    Hei everyone! I have this variable in shell containing paths separated by a space: LINE="/path/to/manipulate1 /path/to/manipulate2" I want to add additional path string in the beginning of the string and as well right after the space so that the variable will have the result something like this: LINE="/additional/path1/to/path/to/manipulate1 additional/path2/to/path/to/manipulate2" Any help appreciated Thanks in advance

    Read the article

  • jquery select divs with same id

    - by mark
    hei guys i want to select two divs with the same id in jquery. how do i do it? i tried this and it did not work jQuery('#xx').each(function(ind,obj){ //do stuff; }); i have jquery countdown timers in a page, and i update them via ajax. some of these countdown timers repeat and that is why i need to use the same id on the divs.

    Read the article

  • the font of xubuntu

    - by ubuntu
    HI: How to set the default font for different language in the xubuntu? For example, I am using xubuntu9.10(English release),and I do not like the default English and Chinese font. I have tried to use "Application-setting-appearance-fonts" to edit the default font,however it just work for the English. The default font of Chinese is "WenQuanYi Zen Hei". I do not like it. I want to use "Microsoft YaHei", I copy this file from my Win7 system. And I tried remove the "WenQuanYi Zen Hei" by "sudo aptitude remove ttf-wqy",it show me it is successfully removed. Also I have modify the file: /etc/fonts/conf.avail/69-language-selector-zh-cn.conf to: <fontconfig> <match target="pattern"> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Microsoft YaHei</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>Bitstream Vera Serif</string> <string>DejaVu Serif</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans</string> <string>Microsoft YaHei</string> <string>DejaVu Sans</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans Mono</string> <string>Microsoft YaHei</string> <string>DejaVu Sans Mono</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> </fontconfig> However when I use the firefox, I found the title of the firefox window is not YaHei. See the image here So what is the problem?

    Read the article

  • the font of xubuntu

    - by ubuntu
    HI: How to set the default font for different language in the xubuntu? For example, I am using xubuntu9.10(English release),and I do not like the default English and Chinese font. I have tried to use "Application-setting-appearance-fonts" to edit the default font,however it just work for the English. The default font of Chinese is "WenQuanYi Zen Hei". I do not like it. I want to use "Microsoft YaHei", I copy this file from my Win7 system. And I tried remove the "WenQuanYi Zen Hei" by "sudo aptitude remove ttf-wqy",it show me it is successfully removed. Also I have modify the file: /etc/fonts/conf.avail/69-language-selector-zh-cn.conf to: <fontconfig> <match target="pattern"> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Microsoft YaHei</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>Bitstream Vera Serif</string> <string>DejaVu Serif</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans</string> <string>Microsoft YaHei</string> <string>DejaVu Sans</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans Mono</string> <string>Microsoft YaHei</string> <string>DejaVu Sans Mono</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> </fontconfig> However when I use the firefox, I found the title of the firefox window is not YaHei. See the image here So what is the problem?

    Read the article

  • the font of xubuntu

    - by ubuntu
    HI: How to set the default font for different language in the xubuntu? For example, I am using xubuntu9.10(English release),and I do not like the default English and Chinese font. I have tried to use "Application-setting-appearance-fonts" to edit the default font,however it just work for the English. The default font of Chinese is "WenQuanYi Zen Hei". I do not like it. I want to use "Microsoft YaHei", I copy this file from my Win7 system. And I tried remove the "WenQuanYi Zen Hei" by "sudo aptitude remove ttf-wqy",it show me it is successfully removed. Also I have modify the file: /etc/fonts/conf.avail/69-language-selector-zh-cn.conf to: <fontconfig> <match target="pattern"> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Microsoft YaHei</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>Bitstream Vera Serif</string> <string>DejaVu Serif</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans</string> <string>Microsoft YaHei</string> <string>DejaVu Sans</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Bitstream Vera Sans Mono</string> <string>Microsoft YaHei</string> <string>DejaVu Sans Mono</string> <string>AR PL UMing CN</string> <string>AR PL ShanHeiSun Uni</string> <string>AR PL UKai CN</string> <string>AR PL ZenKai Uni</string> </edit> </match> </fontconfig> However when I use the firefox, I found the title of the firefox window is not YaHei. See the image here So what is the problem?

    Read the article

  • best way to compute vertex normals from a Triangle's list

    - by nkint
    hi i'm a complete newbie in computergraphics so sorry if it's a stupid answer. i'm trying to make a simple 3d engine from scratch, more for educational purpose than for real use. i have a Surface object with inside a Triangle's list. For now i compute normals inside Triangle class, in this way: triangle.computeFaceNormals() { Vec3D u = v1.sub(v3) Vec3D v = v1.sub(v2) Vec3D normal = Vec3D.cross(u,v) normal.normalized() this.n1 = this.n2 = this.n3 = normal } and when building surface: t = new Triangle(v1,v2,v3).computeFaceNormals() surface.addTriangle(t) and i think this is the best way to do that.. isn't it? now.. what about for vertex normals? i've found this simple algorithm: flipcode vertex normal but.. hei this algorithm has.. exponential complexity? (if my memory doesn't fail my computer science background..) (bytheway.. it has 3 nested loops.. i don't think it's the best way to do it..) any suggestion?

    Read the article

  • ARM Debian (squeeze) USB driver with mismatch 3.3.3 kernel but /lib/modules/2.6.36

    - by frank
    Hei guys, my sheevaplug embedded server works fine, but when I wanted to use USB, the device gets not attached to /dev/tty/USB0 lsusb shows correctly: Bus 001 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port an modprobe usbserial raises: FATAL: Could not load /lib/modules/3.3.3/modules.dep: No such file or directory in the /lib/modules/ Folder there is instead a 2.6.36-Folder uname -r gives 3.3.3 How can I overcome this mismatch? Can I create a symlink? I can't flash this embedded device since it is deployed somewhere, only ssh? Please advise!

    Read the article

  • CentOS - Apache and SSL?

    - by NeoNmaN
    Hei all i have problem for my SSL setup, when i put SSL Engine to on my Apache will not start up, if i remove it, its work fine. i can't finde the Apache log, so i can find out of whats happen here, can sommen maby tell me the problem or link to the defualt log-path for Apache? here is my vhost config file. <VirtualHost *:443> # SSLEngine On SSLProtocol all SSLCertificateFile "/etc/pki/tls/schemecloud.co.uk.csr" SSLCertificateKeyFile "/etc/pki/tls/schemecloud.co.uk.key" SSLCACertificateFile "/etc/pki/tls/rapidssl.crt" ErrorLog "/var/www/error_ssl_log" <Directory /var/www/html> AllowOverride All </Directory> DocumentRoot /var/www/html/ ServerName schemecloud.co.uk </VirtualHost>

    Read the article

  • jquery find and replace multiple items

    - by client
    I have a monthly table that needs to be translated for each languages Something like this (doesnt work obviously) $('.lang-en #monthly th').each(function() { var text = $(this).text(); $(this).text(text.replace('Tam', 'Jan')); $(this).text(text.replace('Hel', 'Feb')); $(this).text(text.replace('Maa', 'Mar')); $(this).text(text.replace('Huh', 'Apr')); $(this).text(text.replace('Tou', 'May')); $(this).text(text.replace('Kes', 'Jun')); $(this).text(text.replace('Hei', 'Jul')); $(this).text(text.replace('Elo', 'Aug')); $(this).text(text.replace('Syy', 'Sep')); $(this).text(text.replace('Lok', 'Oct')); $(this).text(text.replace('Mar', 'Nov')); $(this).text(text.replace('Jou', 'Dec')); $(this).text(text.replace('Yht', 'Total')); });

    Read the article

  • WPF DataGrid adding extra "ghost" row

    - by hs2d
    Hei, In my application i'm using DataGrid to show some data. To get everything working with threading i'm using AsyncObservableCollection as DataContext of DataGrid. When my application starts it looks for files in some folders and updates AsyncObservableCollection. Now here's where things go bad, when i start the application for some reason i get 2 rows with same data in DataGrid even if there is one item in collection. If i add a delay(Thread.Sleep() 50ms minimum) before executing loading files method then DataGrid show everything correctly (no extra row). Have anybody encountered something similar or is there something else i should try? Thanks in advance!

    Read the article

  • NGINX MIME TYPE

    - by justanotherprogrammer
    I have my nginx conf file so that when ever a mobile device visits my site the url gets rewritten to m.mysite.com I did it by adding the following set $mobile_rewrite do_not_perform; if ($http_user_agent ~* "android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino") { set $mobile_rewrite perform; } if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-)") { set $mobile_rewrite perform; } if ($mobile_rewrite = perform) { rewrite ^ http://m.mywebsite.com redirect; break; } I got it from http://detectmobilebrowsers.com/ IT WORKS.But none of my images/js/css files load only the HTML. And I know its the chunk of code I mentioned above because when I remove it and visit m.mywebsite.com from my mobile device everything loads up.So this bit of code does SOMETHING to my css/img/js MIME TYPES. I found this out through the the console error messages from safari with the user agent set to iphone. text.cssResource interpreted as stylesheet but transferred with MIME type text/html. 960_16_col.cssResource interpreted as stylesheet but transferred with MIME type text/html. design.cssResource interpreted as stylesheet but transferred with MIME type text/html. navigation_menu.cssResource interpreted as stylesheet but transferred with MIME type text/html. reset.cssResource interpreted as stylesheet but transferred with MIME type text/html. slide_down_panel.cssResource interpreted as stylesheet but transferred with MIME type text/html. myrealtorpage_view.cssResource interpreted as stylesheet but transferred with MIME type text/html. head.jsResource interpreted as script but transferred with MIME type text/html. head.js:1SyntaxError: Parse error isaac:208ReferenceError: Can't find variable: head mrp_home_icon.pngResource interpreted as image but transferred with MIME type text/html. M_1_L_289_I_499_default_thumb.jpgResource interpreted as image but transferred with MIME type text/html. M_1_L_290_I_500_default_thumb.jpgResource interpreted as image but transferred with MIME type text/html. M_1_default.jpgResource interpreted as image but transferred with MIME type text/html. default_listing_image.pngResource interpreted as image but transferred with MIME type text/html. here is my whole nginx conf file just incase... worker_processes 1; events { worker_connections 1024; } http { include mime.types; include /etc/nginx/conf/fastcgi.conf; default_type application/octet-stream; sendfile on; keepalive_timeout 65; #server1 server { listen 80; server_name mywebsite.com www.mywebsite.com ; index index.html index.htm index.php; root /srv/http/mywebsite.com/public; access_log /srv/http/mywebsite.com/logs/access.log; error_log /srv/http/mywebsite.com/logs/error.log; #---------------- For CodeIgniter ----------------# # canonicalize codeigniter url end points # if your default controller is something other than "welcome" you should change the following if ($request_uri ~* ^(/main(/index)?|/index(.php)?)/?$) { rewrite ^(.*)$ / permanent; } # removes trailing "index" from all controllers if ($request_uri ~* index/?$) { rewrite ^/(.*)/index/?$ /$1 permanent; } # removes trailing slashes (prevents SEO duplicate content issues) if (!-d $request_filename) { rewrite ^/(.+)/$ /$1 permanent; } # unless the request is for a valid file (image, js, css, etc.), send to bootstrap if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?/$1 last; break; } #---------------------------------------------------# #--------------- For Mobile Devices ----------------# set $mobile_rewrite do_not_perform; if ($http_user_agent ~* "android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino") { set $mobile_rewrite perform; } if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-)") { set $mobile_rewrite perform; } if ($mobile_rewrite = perform) { rewrite ^ http://m.mywebsite.com redirect; #rewrite ^(.*)$ $scheme://mywebsite.com/mobile/$1; #return 301 http://m.mywebsite.com; #break; } #---------------------------------------------------# location / { index index.html index.htm index.php; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include /etc/nginx/conf/fastcgi_params; } }#sever1 #server 2 server { listen 80; server_name m.mywebsite.com; index index.html index.htm index.php; root /srv/http/mywebsite.com/public; access_log /srv/http/mywebsite.com/logs/access.log; error_log /srv/http/mywebsite.com/logs/error.log; #---------------- For CodeIgniter ----------------# # canonicalize codeigniter url end points # if your default controller is something other than "welcome" you should change the following if ($request_uri ~* ^(/main(/index)?|/index(.php)?)/?$) { rewrite ^(.*)$ / permanent; } # removes trailing "index" from all controllers if ($request_uri ~* index/?$) { rewrite ^/(.*)/index/?$ /$1 permanent; } # removes trailing slashes (prevents SEO duplicate content issues) if (!-d $request_filename) { rewrite ^/(.+)/$ /$1 permanent; } # unless the request is for a valid file (image, js, css, etc.), send to bootstrap if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?/$1 last; break; } #---------------------------------------------------# location / { index index.html index.htm index.php; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include /etc/nginx/conf/fastcgi_params; } }#sever2 }#http I could just detect the mobile browsers with php or javascript but i need to make the detection at the server level so that i can use the 'm' in m.mywebsite.com as a flag in my controllers (codeigniter) to serve up the right view. I hope someone can help me! Thank you!

    Read the article

  • JavaScript, jQuery, XML - if statement not executing for unknown reason

    - by Jack Roscoe
    Hi, I have a 'for' loop which extracts data from an XML document and adds it into some JavaScript objects, each time the loop executes I want it to run a certain function depending on the value of the attribute 'typ' which is being retrieved from the xml. Currently, the data from the XML is successfully being parsed, which is proven by the first 'alert' you can see which produces the correct value. However, neither of the 'alert' lines in the 'if' statement lower down are being executed and as a result I cannot test the 'ctyp3' function which is supposed to be called. Where have I gone wrong? for (j=0; j<arrayIds.length; j++) { $(xml).find("C[ID='" + arrayIds[j] + "']").each(function(){ // pass values questions[j] = { typ: $(this).attr('typ'), width: $(this).find("I").attr('wid'), height: $(this).find("I").attr('hei'), x: $(this).find("I").attr('x'), y: $(this).find("I").attr('x'), baC: $(this).find("I").attr('baC'), boC: $(this).find("I").attr('boC'), boW: $(this).find("I").attr('boW') } alert($(this).attr('typ')); if ($(this).attr('typ') == '3') { ctyp3(x,y,width,height,baC); alert('pass'); } else { // Add here alert('fail'); } }); }

    Read the article

  • Unsure how to design JavaScript / jQuery functionality which uses XML to create HTML objects

    - by Jack Roscoe
    Hi, I'm using JavScript and jQuery to read an XML document and subsequently use the information from the XML to create HTML objects. The main 'C' nodes in the XML document all have a type attribute, and depending on the type I want to run a function which will create a new html object using the other attributes assigned to that particular 'C' node node. Currently, I have a for loop which extracts each 'C' node from the XML and also it's attributes (e.g. width, height, x, y). Also inside the for loop, I have an if statement which checks the 'type' attribute of the current 'C' node being processed, and depending on the type it will run a different function which will then create a new HTML object with the attributes which have been drawn from the XML. The problem is that there may be more than one 'C' node of the same type, so for example when I'm creating the function that will run when a 'C' node of 'type=1' is detected, I cannot use the 'var p = document.createElement('p')' because if a 'C' node of the same type comes up later in the loop it will clash and override that element with that variable that has just been created. I'm not really sure how to approach this? Here is my entire script. If you need me to elaborate on any parts please ask, I'm sure it's not written in the nicest possible way: var arrayIds = new Array(); $(document).ready(function(){ $.ajax({ type: "GET", url: "question.xml", dataType: "xml", success: function(xml) { $(xml).find("C").each(function(){ arrayIds.push($(this).attr('ID')); }); var svgTag = document.createElement('SVG'); // Create question type objects function ctyp3(x,y,width,height,baC) { alert('test'); var r = document.createElement('rect'); r.x = x; r.y = y; r.width = width; r.height = height; r.fillcolor = baC; svgTag.appendChild(r); } // Extract question data from XML var questions = []; for (j=0; j<arrayIds.length; j++) { $(xml).find("C[ID='" + arrayIds[j] + "']").each(function(){ // pass values questions[j] = { typ: $(this).attr('typ'), width: $(this).find("I").attr('wid'), height: $(this).find("I").attr('hei'), x: $(this).find("I").attr('x'), y: $(this).find("I").attr('x'), baC: $(this).find("I").attr('baC'), boC: $(this).find("I").attr('boC'), boW: $(this).find("I").attr('boW') } alert($(this).attr('typ')); if ($(this).attr('typ') == '3') { ctyp3(x,y,width,height,baC); // alert('pass'); } else { // Add here // alert('fail'); } }); } } }); });

    Read the article

1