Daily Archives

Articles indexed Sunday November 10 2013

Page 7/15 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Why does filter: blur(0) still cause text to blur under Webkit?

    - by johnkavanagh
    I've come across a bug today that's taken far longer than I would like to admit to identify. Essentially: setting a filter: blur(0) (or the vendor-specific -webkit-filter) on an element should - I believe - mean that no form of blur is applied. However, having tested this today, it would appear that Webkit based browsers still blur the text within any element with either blur(0) or blur(0px) assigned to it. I've knocked together a quick Fiddle here: http://jsfiddle.net/f9rBE/ These are three identical dixs containing text (no custom fonts): This has absolutely nothing assigned Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam facilisis orci in quam venenatis, in tempus ipsum sagittis. Suspendisse potenti. Donec ullamcorper lacus vel odio accumsan, vel aliquam libero tempor. Praesent nec libero venenatis, ultrices arcu non, luctus quam. Morbi scelerisque sit amet turpis sit amet tincidunt. Praesent semper erat non purus pretium consequat. Aenean et iaculis turpis. Curabitur diam tellus, consectetur non massa et, commodo venenatis metus. One has no styles at all assigned, the other two have blur(0) and blur(0px): .no-blur{} .zero-px-blur{ -webkit-filter: blur(0px); -moz-filter: blur(0px); -o-filter: blur(0px); -ms-filter: blur(0px); filter: blur(0px); } .zero-blur{ -webkit-filter: blur(0); -moz-filter: blur(0); -o-filter: blur(0); -ms-filter: blur(0); filter: blur(0); } If you preview this under Chrome/Safari you'll see that the text in the second two are still blurred: A few things worth noting: This unintentional blurring occurs in Safari on iOS7 devices (both iPhones and iPads); It also occurs on Chrome and Safari under OSX; It doesn't happen under FireFox in OSX. Of course, this isn't supported at all in Firefox just yet so it's hard to tell whether the behaviour I'm seeing is intentional/expected behaviour, or whether this is a bug in Webkit? Is it possible that this is only prevalent in higher-density resolution devices (ie: retina MacBook/iPhone/iPad)? With this in mind, how do you actually overwrite an item that has blur applied to it to set it back to non-blurred?

    Read the article

  • Difference between var and Class class in object creation

    - by Divine
    Its a silly question, however shocked to see different behaviors. Learning a lot. Lets say I have two classes below Class A { public void Display() { } } Class B : A { public void Display() { } } Class C : B { public void Display() { } } Class Final { static void Main() { var c = new C(); // B c = new C(); //My doubt is, both of the above gives different results. May I know B c = new C() creates object of B or C? What I understood is, it creates object of B. Then why we say "new C()"? I agree with C c = new C(); But I thought, B b = new C(); creates object of B. Where we use this style? Only when utilizing runtime polymorphism? (Overriding methods)? } }

    Read the article

  • Current stock price by using sockets in java

    - by user2976396
    My program is to find the current stock price of a symbol ..this is the code which i m using `String yahoo = "finance.yahoo.com" ; final int httpd = 80; Socket sock = new Socket(yahoo,httpd); PrintWriter out = new PrintWriter( sock.getOutputStream(), true ); BufferedReader in =new BufferedReader(new InputStreamReader( sock.getInputStream() ) ); out.println( "GET http://finance.yahoo.com/q?s=ibm&f=1l HTTP/1.0\r\n\r\n " ); out.println(""); out.flush();` I am just getting the output as ibm .Can anyone please suggest how to get the price.

    Read the article

  • Java BoxLayout alignment issue

    - by ManInMoon
    Can anyone help me. Why is the Label "Current" NOT left aligned in Panel/Frame? public static void main(String[] args) { JFrame TFrame = new JFrame("Test DisplayLayout"); TFrame.setResizable(true); TFrame.setSize(new Dimension(900, 840)); TFrame.setLocationRelativeTo(null); TFrame.setTitle("DisplayLayout"); TFrame.setVisible(true); JPanel P = DisplayLayout2(); P.setVisible(true); P.setOpaque(true); P.setLayout(new BoxLayout(P, BoxLayout.Y_AXIS)); TFrame.add(P); TFrame.revalidate(); TFrame.repaint(); } public static JPanel DisplayLayout2() { JPanel Panel=new JPanel(); Panel.setVisible(true); Panel.setOpaque(true); Panel.setLayout(new BoxLayout(Panel, BoxLayout.Y_AXIS)); Panel.setAlignmentX(Component.LEFT_ALIGNMENT); JLabel lab = new JLabel("Current"); lab.setHorizontalAlignment(SwingConstants.LEFT); lab.setForeground(Color.WHITE); lab.setBackground(Color.PINK); lab.setOpaque(true); Panel.add(lab,Component.LEFT_ALIGNMENT); JPanel posPanel = new JPanel(); JScrollPane scrollPane = new JScrollPane(posPanel,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setPreferredSize(new Dimension(290, 200)); scrollPane.setOpaque(true); posPanel.setBackground(Color.YELLOW); posPanel.setPreferredSize(new Dimension(290, 200)); posPanel.setLayout(new BoxLayout(posPanel, BoxLayout.Y_AXIS)); posPanel.setAlignmentX(Component.LEFT_ALIGNMENT); Panel.add(scrollPane); return Panel; }

    Read the article

  • how can I read only one value of my dictionary?

    - by Gianfranco Cotumaccio
    I created my own dictionary by taking the values ??from a json file in the dictionary I have a set of values??, the other can take them and use them, instead of these start with a brace can not seem to get them: weather = ( { description = "broken clouds"; icon = 04d; id = 803; main = Clouds; } ); Use this command to take the values ??in the Dictionary: NSString *currweather = myDict[@"weather"][@"main"]; The application quits when the launch. How can I fix?

    Read the article

  • Strange behavior of Switch Case statement in Java

    - by supernova
    I understand that Java switch case are designed this way but why is this behavior in Java int x = 1; switch(x){ case 1: System.out.println(1); case 2: System.out.println(2); case 3: System.out.println(3); default: System.out.println("default"); } output : 1 2 3 default My question is why case 2 and 3 are executed? I know I omitted break statement but x was never 2 or 3 but case 2 and case 3 still executes?

    Read the article

  • geom_ribbon doesn't work - Error in eval(expr, envir, enclos) : object 'variable' not found

    - by Marciszka
    I try to add a geom_ribbon object to my ggplot2 plot. In my data frame, I have an NA values that (I guess) may cause a problem. This is a reproducible example of data drame I have: base <- c(1:10, rep(NA, 10)) output1 <- c(rep(NA, 9), 10 - 0:10) output2 <- c(rep(NA, 9), 10 + 0:10) xaxis <- 1:20 df <- data.frame(xaxis, base, output1, output2) df xaxis base output1 output2 1 1 1 NA NA 2 2 2 NA NA 3 3 3 NA NA 4 4 4 NA NA 5 5 5 NA NA 6 6 6 NA NA 7 7 7 NA NA 8 8 8 NA NA 9 9 9 NA NA 10 10 10 10 10 11 11 NA 9 11 12 12 NA 8 12 13 13 NA 7 13 14 14 NA 6 14 15 15 NA 5 15 16 16 NA 4 16 17 17 NA 3 17 18 18 NA 2 18 19 19 NA 1 19 20 20 NA 0 20 And my attempt to plot a ggplot2 object with a geom_ribbon: dfm <- melt(df, id=1) ggplot(dfm, aes(x = xaxis, y = value, colour = variable)) + geom_line(aes(group=variable)) + geom_ribbon(data=df, aes(group = 1, ymin=output1, ymax=output2)) And, eventually, I got an error I cannot deal with: Error in eval(expr, envir, enclos) : object 'variable' not found Thank ypu in advance for any suggestions.

    Read the article

  • jquery slide to attribute with specific data attribute value

    - by Alex M
    Ok, so I have the following nav with absolute urls: <ul class="nav navbar-nav" id="main-menu"> <li class="first active"><a href="http://example.com/" title="Home">Home</a></li> <li><a href="http://example.com/about.html" title="About">About</a></li> <li><a href="http://example.com/portfolio.html" title="Portfolio">Portfolio</a></li> <li class="last"><a href="example.com/contact.html" title="Contact">Contact</a></li> </ul> and then articles with the following data attributes: <article class="row page" id="about" data-url="http://example.com/about.html"> <div class="one"> </div> <div class="two" </div> </article> and when you click the link in the menu I would like to ignore the fact it is a hyperlink and slide to the current article based on its attribute data-url. I started with what I think is the obvious: $('#main-menu li a').on('click', function(event) { event.preventDefault(); var pageUrl = $(this).attr('href'); )}; and have tried find and animate but then I don't know how to reference the article with data-url="http://example.com/about.html". Any help would be most appreciated. Thanks

    Read the article

  • Return color on hover

    - by alonblack
    Here i created 3 images that goes from color to grayscale and i want to show the color on hover what i'v done wrong? here is the fiddle link: http://jsfiddle.net/4tHWg/6/ css code: .box { float: left; position: relative; width: 14.285714286%; } .boxInner img { width: 100%; display: block; } .boxInner img:hover { -webkit-filter: grayscale(0%); } @-webkit-keyframes toGrayScale { to { -webkit-filter: grayscale(100%); } } .box:nth-child(1) img { -webkit-animation: toGrayScale 1s 0.5s forwards; } .box:nth-child(2) img { -webkit-animation: toGrayScale 2s 1s forwards; } .box:nth-child(3) img { -webkit-animation: toGrayScale 3s 1.5s forwards; }

    Read the article

  • TextAppearance_Holo_Large - No resource found

    - by npmaster
    When compiling my app I get the following error: android-apt-compiler: ... \res\values-v14\styles.xml:12: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance_Holo_Large. The code it is complaining about is: <style name="Title" parent="@android:style/TextAppearance_Holo_Large"> <item name="android:layout_height">wrap_content</item> <item name="android:layout_width">wrap_content</item> </style> I checked my manifest file and I have set the SDK to: <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" /> Which i believe allows for using the Holo Themes. I am using Android Studio though I doubt that is the cause of the error. Any ideas what I am doing wrong?

    Read the article

  • How to check html tag with Rspec

    - by Tetsu
    I'm learning from this site. I tested the following with rspec, and it passed. describe "About page" do it "should have the content 'About Us'" do visit '/static_pages/about' expect(page).to have_content('About Us') end end I changed About Us to <h1>About Us</h1> to check whether it works as I expected, but the test fails even when about.html.erb has the string <h1>About Us</h1>. Could you show me how I can use html tag expression in rspec file?

    Read the article

  • Remove duplication's from my DropDownList

    - by user2976270
    In my controller i am returning list of my object with specific property: public ActionResult Index() { List<MyObject> list = db.MyObjects.Where(x => x.family == "Web").ToList(); ViewBag.Files = new SelectList(list, "Id", "protocol"); return View(); } This is my object: public class MyObject { public int id { get; set; } public string fileName { get; set; } public string browser { get; set; } public string protocol { get; set; } public string family { get; set; } } Index.cshtml: @Html.DropDownList("File", new SelectList(ViewBag.Files, "Id", "protocol_site"), "Select webmail site", new { style = "vertical-align:middle;" }) And i try to made 2 changes with no succeed: Remove all the duplication protocol from my DropDownListfor exapmle if i have 10 objects : 9 is doc protocol and 1 pdf i wand to see in my DropDownList only 2 items: DOC and PDF and not all the 10 items. Sort this DropDownList in alphabet order

    Read the article

  • Stuck at being unable to print a substring no more than 4679 characters

    - by Newcoder
    I have a program that does string manipulation on very large strings (around 100K). The first step in my program is to cleanup the input string so that it only contains certain characters. Here is my method for this cleanup: public static String analyzeString (String input) { String output = null; output = input.replaceAll("[-+.^:,]",""); output = output.replaceAll("(\\r|\\n)", ""); output = output.toUpperCase(); output = output.replaceAll("[^XYZ]", ""); return output; } When i print my 'input' string of length 97498, it prints successfully. My output string after cleanup is of length 94788. I can print the size using output.length() but when I try to print this in Eclipse, output is empty and i can see in eclipse output console header. Since this is not my final program, so I ignored this and proceeded to next method that does pattern matching on this 'cleaned-up' string. Here is code for pattern matching: public static List<Integer> getIntervals(String input, String regex) { List<Integer> output = new ArrayList<Integer> (); // Do pattern matching Pattern p1 = Pattern.compile(regex); Matcher m1 = p1.matcher(input); // If match found while (m1.find()) { output.add(m1.start()); output.add(m1.end()); } return output; } Based on this program, i identify the start and end intervals of my pattern match as 12351 and 87314. I tried to print this match as output.substring(12351, 87314) and only get blank output. Numerous hit and trial runs resulted in the conclusion that biggest substring that i can print is of length 4679. If i try 4680, i again get blank input. My confusion is that if i was able to print original string (97498) length, why i couldnt print the cleaned-up string (length 94788) or the substring (length 4679). Is it due to regular expression implementation which may be causing some memory issues and my system is not able to handle that? I have 4GB installed memory.

    Read the article

  • How to get Rid of this strange Border on JButton in Windows System look and Feel?

    - by Timo J.
    I have a small Problem with the Layout of my Frame. As You could see in a picture (if i would have my 10 rep ;) ) there is a small Border around my JButtons. I'm already searching long time on this topic and i finally decided to ask for help, i'm just out of ideas. Is this Part of the Windows Theme which shouldn't be changed? It just doesnt fit into my current Layout, as I'm Listing TextBoxes and Comboboxes on Page Axis without any Border. I would be very happy if there is solution for this issue. Thanks in advance! EDIT 1: I do not mean the Focus Border. I like the Highlighting of a focussed Element. What i mean is the Border in the Background Color which causes a small distance of background-colored space beetween a JButton and another Element. (Picture on Personnal Webspace: http://tijamocobs.no-ip.biz/border_jbutton.png) EDIT 2: I'm using the Windows 8 Look and Feel but saw this Problem on Windows 7 Look and Feel, too. short Example import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class TestFrame extends JFrame { public TestFrame(){ setLayout(new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS)); for (int i = 0; i < 3; i++) { JButton btn = new JButton("."); // not working: // btn.setBorder(null); // btn.setBorder(BorderFactory.createEmptyBorder()); add(btn); } pack(); } public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); TestFrame tiss = new TestFrame(); tiss.setVisible(true); } } Example Code (long version): import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class TestFrame extends JFrame { public TestFrame(){ JPanel muh = new JPanel(); muh.setLayout(new BoxLayout(muh, BoxLayout.PAGE_AXIS)); for (int i = 0; i < 3; i++) { Container c = new JPanel(); c.setLayout(new BoxLayout(c, BoxLayout.LINE_AXIS)); Box bx = Box.createHorizontalBox(); final String[] tmp = {"anything1","anything2"}; JComboBox<String> cmbbx = new JComboBox<String>(tmp); cmbbx.setMinimumSize(new Dimension(80,20)); bx.add(cmbbx); JButton btn = new JButton("."); btn.setMinimumSize(new Dimension(cmbbx.getMinimumSize().height,cmbbx.getMinimumSize().height)); btn.setPreferredSize(new Dimension(30,30)); btn.setMaximumSize(new Dimension(30,30)); bx.add(btn); c.setMaximumSize(new Dimension(Integer.MAX_VALUE,30)); c.add(new JLabel("Just anything")); c.add(bx); muh.add(c); } add(muh,BorderLayout.CENTER); pack(); } public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); TestFrame tiss = new TestFrame(); tiss.setVisible(true); } }

    Read the article

  • how to aggregate information on UIImage?

    - by user1582281
    I want to draw on each drawing cycle 1000 more lines on my UIIMage, right now I do it by : -(void)drawRect { for(int i=0;i<1000;i++) { UIGraphicsBeginImageContext(myImage.size); code to draw line on current context... draw previous info from myImage: [myImage drawInRect:myRect]; //store info from context back to myImage myImage=UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } //append the image on the right side of current context: [myImage drawInRect:myRightRect]; } problem is that I think that drawing entire image each time just for the few lines added is very expensive, anyone has any idea how to optimize it?

    Read the article

  • jquery adding required to a dropdownbox [SOLVED]

    - by Crays
    Hi i would like to know how do i add a required attribute to a dropdownbox? I've search numerous ways but none worked, here's my code <script> $(document).ready(function(){ $('.orderingmenu .burgers').change(function(){ var selectVal= $(this).val(); if(selectVal != 'none'){ $(this).next().attr('required', true); } }); }); </script> i am really out of idea on how to do this, i tested the selectors and they're working fine, but it just doesn't seem to add in the required attribute to that select field =/ any help please? what i have tried is $(this).next().prop('required', true); $(this).next().attr('required', 'true'); $(this).next().attr('required', ''); $(this).next().prop('required'); none have worked =/ EDIT the HTML <div class="orderingmenu" style="margin-bottom: 0.5%;"> <select name="burgerlist" class="burgers" style="width: 35%; float: left; font-size: 12px;"> <option selected="selected" value="none">NONE</option> <option value="A">A</option> </select> <select name="option" id="option" class="setornot" style="width: 30%; font-size: 12px;"> <option selected="selected" value="none">NONE</option> <option value="ALA CARTE">ALA CARTE</option> <option value="SET">SET</option> </select> <input type="text" placeholder="ANY REMARKS?" name="remarks" style="width: 30%; float: right; font-size: 12px;"> </div> i had it looped with a php script, but basically what i wanted to do is so that if there is any selection other than 'none', the other selection is required. EDIT 2 found out the problem was that i had the value for none!

    Read the article

  • flex and bison: wrong output

    - by user2972227
    I am doing a homework using flex and bison to make a complex number calculator. But my program cannot give a correct output. .lex file: %option noyywrap %{ #include<stdio.h> #include<stdlib.h> #include "complex_cal.h" #define YYSTYPE complex #include "complex_cal.tab.h" void RmWs(char* str); %} /* Add your Flex definitions here */ /* Some definitions are already provided to you*/ ws [ \t]+ digits [0-9] number (0|[1-9]+{digits}*)\.?{digits}* im [i] complexnum {ws}*[-]*{ws}*{number}{ws}*[+|-]{ws}*{number}{ws}*{im}{ws}* op [-+*/()] %% {complexnum} {RmWs(yytext); sscanf(yytext,"%lf %lf",&(yylval.real),&(yylval.img)); return CNUMBER;} {ws} /**/ {op} return *yytext; %% /* function provided to student to remove */ /* all the whitespaces from a string. */ void RmWs(char* str){ int i=0,j=0; char temp[strlen(str)+1]; strcpy(temp,str); while (temp[i]!='\0'){ while (temp[i]==' '){i++;} str[j]=temp[i]; i++; j++; } str[j]='\0'; } .y file: %{ #include <stdio.h> #include <stdlib.h> #include "complex_cal.h" /* prototypes of the provided functions */ complex complex_add (complex, complex); complex complex_sub (complex, complex); complex complex_mul (complex, complex); complex complex_div (complex, complex); /* prototypes of the provided functions */ int yylex(void); int yyerror(const char*); %} %token CNUMBER %left '+' '-' %left '*' '/' %nonassoc '(' ')' %% /* start: Add your grammar rules and actions here */ complexexp: complexexp '+' complexexpmultidiv {$$=complex_add($1, $3);} | complexexp '-' complexexpmultidiv {$$=complex_sub($1, $3);} | complexexpmultidiv {$$.real=$1.real;$$.img=$1.img;} ; complexexpmultidiv: complexexpmultidiv '*' complexsimple {$$=complex_mul($1, $3);} | complexexpmultidiv '/' complexsimple {$$=complex_div($1, $3);} | complexsimple {$$.real=$1.real;$$.img=$1.img;} ; complexsimple: '(' complexexp ')' {$$.real=$2.real;$$.img=$2.img;} | '(' CNUMBER ')' {$$.real=$2.real;$$.img=$2.img;} ; /* end: Add your grammar rules and actions here */ %% int main(){ return yyparse(); } int yyerror(const char* s){ printf("%s\n", s); return 0; } /* function provided to do complex addition */ /* input : complex numbers c1, c2 */ /* output: nothing */ /* side effect : none */ /* return value: result of addition in c3 */ complex complex_add (complex c1, complex c2){ /* c1 + c2 */ complex c3; c3.real = c1.real + c2.real; c3.img = c1.img + c2.img; return c3; } /* function provided to do complex subtraction */ /* input : complex numbers c1, c2 */ /* output: nothing */ /* side effect : none */ /* return value: result of subtraction in c3 */ complex complex_sub (complex c1, complex c2){ /* c1 - c2 */ complex c3; c3.real = c1.real - c2.real; c3.img = c1.img - c2.img; return c3; } /* function provided to do complex multiplication */ /* input : complex numbers c1, c2 */ /* output: nothing */ /* side effect : none */ /* return value: result of multiplication in c3 */ complex complex_mul (complex c1, complex c2){ /* c1 * c2 */ complex c3; c3.real = c1.real*c2.real - c1.img*c2.img; c3.img = c1.img*c2.real + c1.real*c2.img; return c3; } /* function provided to do complex division */ /* input : complex numbers c1, c2 */ /* output: nothing */ /* side effect : none */ /* return value: result of c1/c2 in c3 */ complex complex_div (complex c1, complex c2){ /* c1 / c2 (i.e. c1 divided by c2 ) */ complex c3; double d; /*divisor calculation using the conjugate of c2*/ d = c2.real*c2.real + c2.img*c2.img; c3.real = (c1.real*c2.real + c1.img*c2.img)/d; c3.img = (c1.img*c2.real - c1.real*c2.img)/d; return c3; } .h file: #include <string.h> /* struct for holding a complex number */ typedef struct { double real; double img; } complex; /* define the return type of FLEX */ #define YYSTYPE complex Script for compiling the file: bison -d -v complex_cal.y flex -ocomplex_cal.lex.yy.c complex_cal.lex gcc -o complex_cal complex_cal.lex.yy.c complex_cal.tab.c ./complex_cal Some correct sample run of the program: input:(5+6i)*(6+1i) output:24.000000+41.000000i input:(7+8i)/(-3-4i)*(5+7i) output:-11.720000-14.040000i input:(7+8i)/((-3-4i)*(5+7i)) output:-0.128108+0.211351i But when I run this program, the program only give an output which is identical to my input. For example, when I input (5+6i)(6+1i), it just gives (5+6i)(6+1i). Even if I input any other things, for example, input "abc" it just gives "abc" and is not syntax error. I don't know where the problem is and I hope to know how to solve it.

    Read the article

  • Java split giving opposite order of arabic characters

    - by MuhammadA
    I am splitting the following string using \\| in java (android) using the IntelliJ 12 IDE. Everything is fine except the last part, somehow the split picks them up in the opposite order : As you can see the real positioning 34,35,36 is correct and according to the string, but when it gets picked out into split part no 5 its in the wrong order, 36,35,34 ... Any way I can get them to be in the right order? My Code: public ArrayList<Book> getBooksFromDatFile(Context context, String fileName) { ArrayList<Book> books = new ArrayList<Book>(); try { // load csv from assets InputStream is = context.getAssets().open(fileName); try { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); String line; while ((line = reader.readLine()) != null) { String[] RowData = line.split("\\|"); books.add(new Book(RowData[0], RowData[1], RowData[2], RowData[3], RowData[4], RowData[5])); } } catch (IOException ex) { Log.e(TAG, "Error parsing csv file!"); } finally { try { is.close(); } catch (IOException e) { Log.e(TAG, "Error closing input stream!"); } } } catch (IOException ex) { Log.e(TAG, "Error reading .dat file from assets!"); } return books; }

    Read the article

  • Why SQL functions are faster than UDF

    - by Zerotoinfinite
    Though it's a quite subjective question but I feel it necessary to share on this forum. I have personally experienced that when I create a UDF (even if that is not complex) and use it into my SQL it drastically decrease the performance. But when I use SQL inbuild function they happen to work pretty faster. Conversion , logical & string functions are clear example of that. So, my question is "Why SQL in build functions are faster than UDF"? and it would be an advantage if someone can guide me how can I judge/manipulate function cost either mathematically or logically.

    Read the article

  • Is it possible to configure a CDN so that it will step out of the way for a subset of regional IPs?

    - by rwired
    We have a website which targets customers in China, both expat and local Chinese. We have an ICP license which allows us to host in a datacenter inside China. Internet in China is actually as fast as anywhere else (faster than most places actually), so long as the content is served-up within the boundaries of the Great-Firewall. Anything that crosses the wall is horribly slow. The problem is that most expats have some sort of VPN installed so that they can access all the blocked stuff. What this means is that when they access our site, the traffic first has to go out of China through the firewall to their VPN, and then back in. The performance is terrible, worse than if we were just hosting outside of China directly (which we used to do before the ICP was issued). So I want to use a global CDN to mirror the site automatically, but I only want to deliver the content via the CDN if the user's request IP address is outside of China. Inside China I would like the content to be served by our own server. I also want to be careful with the domain names. We currently use www.xxx.com and www.xxx.cn for language selection purposes, as these perform well in SEO on Google (which the expats use), and Baidu (which the locals use). If possible I would like to avoid having one domain on the outside, and the other on the inside since not all expats use a VPN, and some Chinese speakers also use VPNs. Also some of our legitimate customers in both languages are from outside of China. I also don't want to resort to using something like www2.xxx.com/cn for the outside connection if at all possible, since I have worries about duplicate content and canonical URLs ruining our SEO (unless you know of a quick fix for that). CDNs I'm considering are: Google PageSpeed, CloudFlare, Amazon CloudFront. None of which have datacenters inside China. I have complete control of the .com DNS zone records, but the .cn zones are under the control of the domain issuing body in China. I'm not sure at this time if they would allow even a CNAME to point to an IP outside of China (although I don't see why not). They no longer allow outside registrars like they used to.

    Read the article

  • rsync on QNAP NAS fails recently

    - by user192702
    I have been using rsync to copy a large backup file from a remote host to my QNAP NAS. It's been working fine until recently. It seems like almost every time when it executes it's giving a time out after 15s. Following is what I have captured in the log. Any ideas? 2013-11-10 23:10:01 HKT - Executing: rsync -t -v -e ssh [email protected]:/home/backup/backup/backup_file-11102013* /share/homes/backup/backup/web/database [receiver] io timeout after 10 seconds -- exiting rsync error: timeout in data send/receive (code 30) at io.c(140) [receiver=3.0.7] rsync: connection unexpectedly closed (73 bytes received so far) [generator] rsync error: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7] 2013-11-10 23:10:15 HKT - Done rsync

    Read the article

  • How to generate a private/public key pair to use for a Linux server on Windows Azure?

    - by MainMa
    Following Windows Azure documentation, I generated a pair of private/public keys on an Ubuntu machine using the exact comment as given: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout myPrivateKey.key -out myCert.pem When I open the private key in puttygen, the following error is displayed: Couldn't load private key (unrecognised key type) The private key generated by openssl looks correct: -----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG6w0xAQEFAASCBKcwggSjAgEsAoIBAQC6OEZ5ULe6F6u2 Cybhqqfqqh2ao9sd2tpqB+HGIoMMHrmnD3YegRgZJIddTQaWKdwaKrYul21YNt5y ... P0RyfL9kDnX/XmIOM38FOoucGvO+Zozsbmgmvw6AUhE0sPhkZnlaodAU1OnfaWJz KpBxkXulBaCJnC8w29dGKng= -----END PRIVATE KEY----- Note that the comments to Azure documentation (the same link as above) report that the pair should be generated using OpenSSL for Windows instead of openssl on Linux. This doesn't help, since the same error appears for a private key generated by OpenSSL for Windows. What am I doing wrong?

    Read the article

  • Does disable log error for MySQL increasing it's performance ? How disable it?

    - by adnan
    Does disable log error for MySQL increasing it's performance ? How disable it ? This is my service status Server load 0.63 (8 CPUs) Memory Used 23.38% (957,600 of 4,096,000) Swap Used 0% (0 of 1) And this is print screen for process manager http://elnhrda.com/promgr.jpg This is my.cnf [mysqld] query_cache_size=64M skip-name-resolve #innodb_file_per_table=1 query_cache_limit=2M read_buffer_size = 2M read_rnd_buffer_size = 16M sort_buffer_size = 8M join_buffer_size = 8M thread_cache_size = 8 thread_concurrency = 8 innodb_buffer_pool_size = 2G Iam looking for doing any thing to increase my website speed I have VPS 4G.B RAM CENTOS 6 X86_64 Note please : this statics taken now which no any queries executed & site have not any visitors in the same time

    Read the article

  • Is there a difference in page fault rates between CPU bound and I/O bound processes?

    - by user198864
    I was thinking, should there be any difference in expectation of the page fault rate on CPU-bound vs I/O bound processes? At first I thought maybe we could, since CPU-bound processes would likely be using more memory accesses per time quantum, so I expect it would move from locality to locality faster. At the same time, the CPU-bound process is probably given a larger working set... but this doesn't affect the fault overhead as it hits a new locality IF this wasn't pre-paged in. Is there actually any real difference in the page fault rates or am I just musing about something nonexistent? And if there is, how would it impact a real-world OS like linux?

    Read the article

  • Maximum MTU size

    - by user192702
    Thought one of the issues I'm experiencing with the following question is due to MTU rightfully so. ESXi 5 VM Putty session hangs, vSphere client timing out However, when I tried testing the maximum MTU size it seems there's just no limit. Thought Ethernet only allows maximum MTU. But I'm up to 54450. ping -l 54450 192.168.10.7 Pinging 192.168.50.7 with 54450 bytes of data: Reply from 192.168.10.7: bytes=54450 time=1081ms TTL=62 Reply from 192.168.10.7: bytes=54450 time=1079ms TTL=62 Reply from 192.168.10.7: bytes=54450 time=1079ms TTL=62 Reply from 192.168.10.7: bytes=54450 time=1079ms TTL=62 Ping statistics for 192.168.10.7: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1079ms, Maximum = 1081ms, Average = 1079ms

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >