Search Results

Search found 8219 results on 329 pages for 'less'.

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

  • Gtk Scrollbar Less Scrolling Window with GtkViewPort

    - by PP
    I am totally stuck on this, i want to implement Scroll Bar Less Scrolling Window. can some one provide me some hint on how to implement scrolling window using GtkViewport. I want to implement something as displayed follows: When user clicks on the ScrollUp or ScrollDown button list will scroll up or down. Is it easy to implement or it is very very complected?

    Read the article

  • CSS optimization - extra classes in dom or preprocessor-repetitive styling in css file?

    - by anna.mi
    I'm starting on a fairly large project and I'm considering the option of using LESS for pre-processing my css. the useful thing about LESS is that you can define a mixin that contains for example: .border-radius(@radius) { -webkit-border-radius: @radius; -moz-border-radius: @radius; -o-border-radius: @radius; -ms-border-radius: @radius; border-radius: @radius; } and then use it in a class declaration as .rounded-div { .border-radius(10px); } to get the outputted css as: .rounded-div { -webkit-border-radius: 10px; -moz-border-radius: 10px; -o-border-radius: 10px; -ms-border-radius: 10px; border-radius: 10px; } this is extremely useful in the case of browser prefixes. However this same concept could be used to encapsulate commonly-used css, for example: .column-container { overflow: hidden; display: block; width: 100%; } .column(@width) { float: left; width: @width; } and then use this mixin whenever i need columns in my design: .my-column-outer { .column-container(); background: red; } .my-column-inner { .column(50%); font-color: yellow; } (of course, using the preprocessor we could easily expand this to be much more useful, eg. pass the number of columns and the container width as variables and have LESS determine the width of each column depending on the number of columns and container width!) the problem with this is that when compliled, my final css file would have 100 such declarations, copy&pasted, making the file huge and bloated and repetitive. The alternative to this would be to use a grid system which has predefined classes for each column-layout option, eg .c-50 ( with a "float: left; width:50%;" definition ), .c-33, .c-25 to accomodate for a 2-column, 3-column and 4-column layout and then use these classes to my dom. i really mislike the idea of the extra classes, from experience it results to bloated dom (creating extra divs just to attach the grid classes to). Also the most basic tutorial for html/css would tell you that the dom should be separated from the styling - grid classes are styling related! to me, its the same as attaching a "border-radius-10" class to the .rounded-div example above! on the other hand, the large css file that would result from the repetitive code is also a disadvantage so i guess my question is, which one would you recommend? and which do you use? and, which solution is best for optimization? apart from the larger file size, has there even been any research on whether browser renders multiple classes faster than a large css file, or the other way round? tnx! i'd love to hear your opinion!

    Read the article

  • Creating a "less"-like console pager interface for pysqlite3 database

    - by Eric
    I would like to add some interactive capability to a python CLI application I've writen that stores data in a SQLite3 database. Currently, my app reads-in a certain type of file, parses and analyzes, puts the analysis data into the db, and spits the formatted records to stdout (which I generally pipe to a file). There are on-the-order-of a million records in this file. Ideally, I would like to eliminate that text file situation altogether and just loop after that "parse and analyze" part, displaying a screen's worth of records, and allowing the user to page through them and enter some commands that will edit the records. The backend part I know how to do. Can anyone suggest a good starting point for creating that pager frontend either directly in the console (like the pager "less"), through ncurses, or some other system?

    Read the article

  • mercurial: less duplication in hgrc file

    - by zaharpopov
    Hi there. I have using Hg for some projects on my google code hosting. For each projects I set in [auth] section of .hgrc the username/password to push without every asking for password. But it is lots of duplication like: [auth] proj1.prefix = ... 111 proj1.username = google code username proj1.password = google code password proj2.prefix = ... 222 proj2.username = google code username proj2.password = google code password Can this somehow be doing with less duplications? Maybe set variable in hgrc and refer to it from all username/password lines? Thanks in advance for your help

    Read the article

  • Generate an image / thumbnail of a webpage using X/Gui-less linux

    - by dassouki
    There are a lot of solutions out there on generating a thumbnail or an image preview of a webpage. Some of these are websites like websnapshots, windows libraries such as PHP's imagegrabscreen (only works on windows), and KDE's wkhtml. Many more do exist. However, I'm looking for a GUI-less solution. Something I can create an API around and link it to php or python. I'm comfortable with python, php, C, and shell. This is a personal project, so I'm not interested in commercial applications as I'm aware of their existence. Any ideas?

    Read the article

  • how to check an ANTLR token is only used once or less in the parser

    - by Simon Kenyon Shepard
    In Antlr, if I have a rule for example: someRule : TOKENA TOKENB; it would accept : "tokena tokenb" if I would like TOKENA to be optional, I can say, someRule : TOKENA* TOKENB; then I can have : "tokena tokenb" or "tokenb" or "tokena tokena tokenb" but this also means it can be repeated more that once. Is there anyway I can say this token can be there 1 or less times but not more than one? so it would accept: "tokena tokenb" or "tokenb" BUT NOT "tokena tokena tokenb"? Many thanks

    Read the article

  • Express highest floating point quantity that is less than 1

    - by edA-qa mort-ora-y
    I was doing some rounding calculations and happened upon a question. How can I express the highest quantity less than 1 for a given floating point type? That is, how I write/represent value x such that x < 1, x + y >= 1 for any y > 0. In fractions this would be x = (q-1)/q where q is the precision of the type. For example, if you are counting in 1/999 increments then x = 998/999. For a given type (float, double, long double), how could one express the value x in code? I also wonder if such a value actually exists for all values of y. That is, as y's exponent gets smaller perhaps the relation doesn't hold anymore. So an answer with some range restriction on y is also acceptable. (The value of x I want still does exist, the relationship may just not properly express it.)

    Read the article

  • Is there a way to make XmlDocument parsing less strict

    - by Istrebitel
    I am making a program that will store its data in an XML file. When people write XML they can make subtle mistakes, like ending a comment with - so it looks like <!-- comment ---> or adding a </>inside an attribute. Naturally, the XML still can be read all right, but trying to input this text into XmlDocument will give a syntax error (and it wont be parsed). Is there a way to make XmlDocument less strict and make it ignore violations of the standard that do not make the document unparseable? For example, its clear that <!-- comment ---> is still a comment even though it contains - at the end which is against the standard specification).

    Read the article

  • Repairing broken XML file - removing extra less-than/greater-than signs

    - by peku
    I have a large XML file which in the middle contains the following: <ArticleName>Article 1 <START </ArticleName> Obviously libxml and other XML libraries can't read this because the less-than sign opens a new tag which is never closed. My question is, is there anything I can do to fix issues like this automatically (preferably in Ruby)? The solution should of course work for any field which has an error like this. Someone said SAX parsing could do the trick but I'm not sure how that would work.

    Read the article

  • Any way to make GetTypes() less brittle.

    - by scope-creep
    I'm iterating through all the types in GAC, GAC_32 and GAC_MSIL looking for specific types, fundamentally to match those using clauses in my source code, so when I compile the source. I'll know exactly what assembly dll's to provide. I'm getting all the file names from each of those directory and applying GetTypes to each assembly in turn and comparing the returned types against my using list. But the problem I have is that GetTypes() keeps crapping out with an exception, when it can't load the types from a loaded assembly. Is their any way to make GetTypes() less brittle. For instance, when parsing this assembly on my box, {blbmmc, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}, it craps out. Any suggestions welcome. I know this is a fairly lengthly process, but I figure i'll eventually use a subset of common assemblies to search, or possibly cache the list of types-assembly dll name at program start. Thanks.

    Read the article

  • How to find the largest power of 2 less than the given number

    - by nazar_art
    I need to find the largest power of 2 less than the given number. And I stuck and can't find any solution. Code: public class MathPow { public int largestPowerOf2 (int n) { int res = 2; while (res < n) { res =(int)Math.pow(res, 2); } return res; } } This doesn't work correctly. Testing output: Arguments Actual Expected ------------------------- 9 16 8 100 256 64 1000 65536 512 64 256 32 How to solve this issue?

    Read the article

  • Different characters take more/less data?

    - by Nathan
    I am working on a personal project and I'm wondering if certain characters take up more data in a text file than others. I need to choose a character to seperate items in my file, but if a 0 uses less bytes than a ! or something, it would be best to do that. I know all characters have an ASCII value, but would a lower ASCII value mean the character can be stored in fewer bytes? This might be an incredibly stupid question, but I don't see any information on the topic online so I came here to check. Thanks!

    Read the article

  • Jquery menu with less code

    - by Sergio
    I'm using Jquery for menu created like: <div class="prof_info1">home</div><div class="prof_info2">info2</div><div class="prof_info3">info3</div> And Jquery code like: $(document).ready(function(){ $(".prof_info1").unbind("click").click(function(event) { $("#main").html('<img src="img/spin.gif" class="spin">'); location.replace("?&id=<?=$id?>") return false; }); $(".prof_info2").unbind("click").click(function(event) { $("#main").html('<img src="img/spin.gif" class="spin">'); $("#main").load('?a=2&id=<?=$id?>'); return false; }); $(".prof_info3").unbind("click").click(function(event) { $("#glavni").html('<img src="img/spin.gif" class="spin">'); $("#glavni").load('?a=3&id=<?=$id?>'); return false; }); }); Is there any easier way to do write this Jquery code and make it with less code? Something like if click somethind{ ... }elseif{ ....}

    Read the article

  • Schema-less design guidelines for Google App Engine Datastore and other NoSQL DBs

    - by jamesaharvey
    Coming from a relational database background, as I'm sure many others are, I'm looking for some solid guidelines for setting up / designing my datastore on Google App Engine. Are there any good rules of thumb people have for setting up these kinds of schema-less data stores? I understand some of the basics such as denormalizing since you can't do joins, but I was wondering what other recommendations people had. The particular simple example I am working with concerns storing searches and their results. For example I have the following 2 models defined in my Google App Engine app using Python: class Search(db.Model): who = db.StringProperty() what = db.StringProperty() where = db.StringProperty() createDate = db.DateTimeProperty(auto_now_add=True) class SearchResult(db.Model): title = db.StringProperty() content = db.StringProperty() who = db.StringProperty() what = db.StringProperty() where = db.StringProperty() createDate = db.DateTimeProperty(auto_now_add=True) I'm duplicating a bunch of properties between the models for the sake of denormalization since I can't join Search and SearchResult together. Does this make sense? Or should I store a search ID in the SearchResult model and effectively 'join' the 2 models in code when I retrieve them from the datastore? Please keep in mind that this is a simple example. Both models will have a lot more properties and the way I'm approaching this right now, I would put any property I put in the Search model in the SearchResult model as well.

    Read the article

  • how to make war file take up less memory

    - by Myy
    I need help on how to decrease the memory usage of my web app. so I can fit more into my webserver. so I'm building a java web app with JSF 2.0 developing in eclipse helios and running on an Apache tomcat Server. And I have a dedicated virtual server with a tomcat aswell where I deploy these war files. the webApp is about 35MB in size ( it has a lot of jars and such) but when I deploy it to my tomcat webserver, I can see it takes about 300MB of RAM, is this normal? my dedicated server only has 2GB of ram from which normally have 1 to use. so I as soon as I deploy 3 apps I get an OOM error, I've gotten permgen OOM and a out of swamp Memory error; to fix this I upped my MaxPermGen to about a gig and resytarted the server to get back some swamp space. so I tried deploying smaller older apps ( about 15MB) and they take up waay less memory. If I have 1 GB of ram I want to be able to fit more apps into my webserver without getting any OOM Errors. now I found this stack overflow Question, Can that be applied to my case? and if so, which are the common folders in the tomcat server? anyone done this before or have a different more effective, not so complicated approach? Any ideas, and or commets are more than appreciated. Thanks! Myy

    Read the article

  • How to partition bits in a bit array with less than linear time

    - by SiLent SoNG
    This is an interview question I faced recently. Given an array of 1 and 0, find a way to partition the bits in place so that 0's are grouped together, and 1's are grouped together. It does not matter whether 1's are ahead of 0's or 0's are ahead of 1's. An example input is 101010101, and output is either 111110000 or 000011111. Solve the problem in less than linear time. Make the problem simpler. The input is an integer array, with each element either 1 or 0. Output is the same integer array with integers partitioned well. To me, this is an easy question if it can be solved in O(N). My approach is to use two pointers, starting from both ends of the array. Increases and decreases each pointer; if it does not point to the correct integer, swap the two. int * start = array; int * end = array + length - 1; while (start < end) { // Assume 0 always at the end if (*end == 0) { --end; continue; } // Assume 1 always at the beginning if (*start == 1) { ++start; continue; } swap(*start, *end); } However, the interview insists there is a sub-linear solution. This makes me thinking hard but still not get an answer. Can anyone help on this interview question?

    Read the article

  • which sql consumes less memory

    - by prmatta
    Yesterday I asked a question on how to re-write sql to do selects and inserts in batches. I needed to do this to try and consume less virtual memory, since I need to move millions of rows here. The object is to move rows from Table B into Table A. Here are the ways I can think of doing this: SQL #1) INSERT INTO A (x, y, z) SELECT x, y, z FROM B b WHERE ... SQL #2) FOREACH SELECT x,y,z FROM B b WHERE ... INSERT INTO A(x,y,z); END FOREACH; SQL #3) FOREACH SELECT FIRST 2000 x,y,z FROM B b WHERE ... INSERT INTO A(x,y,z); END FOREACH; SQL #4) FOREACH SELECT FIRST 2000 x,y,z FROM B b WHERE ... AND NOT EXISTS IN (SELECT * FROM A) INSERT INTO A(x,y,z); END FOREACH; Are any of the above incorrect? The database is informix 11.5.

    Read the article

  • generate k distinct number less then n

    - by davit-datuashvili
    hi i have following question task is this generate k distinct positive numbers less then n without duplication my method is following first create array size of k where we should write these numbers int a[]=new int[k]; //now i am going to cretae another array where i check if (at given number position is 1 then generate number again else put this number in a array and continue cycle i put here a piece of code and explanations int a[]=new int[k]; int t[]=new int[n+1]; Random r=new Random(); for (int i==0;i<t.length;i++){ t[i]=0;//initialize it to zero } int m=0;//initialize it also for (int i=0;i<a.length;i++){ m=r.nextInt(n);//random element between 0 and n if (t[m]==1){ //i have problem with this i want in case of duplication element occurs repeats this steps afain until there will be different number else{ t[m]=1; x[i]=m; } } so i fill concret my problem if t[m]==1 it means that this element occurs already so i want to generate new number but problem is that number of generated numbers will not be k beacuse if i==0 and occurs duplicate element and we write continue then it will switch at i==1 i need like goto for repeat step or for (int i=0;i<x.length;i++){ loop: m=r.nextInt(n); if ( x[m]==1){ continue loop; } else{ x[m]=1; a[i]=m; continue;//continue next step at i=1 and so on } } i need this code in java please help

    Read the article

  • Visual studio - precompile - dotless

    - by Pickels
    I wonder if there is a way to precompile *.less files(http://www.dotlesscss.com/) with visual studio. The site gives me a dotless.compiler.exe but I am not sure how to hook this up to visual studio. I am looking for a solution for both Webforms and Mvc. Friendly Greetings, Pickels

    Read the article

  • Clear OS always showing "Operation too slow. Less than 1 bytes/sec"

    - by Blue Gene
    Have been trying to install clear os addon but nothing is working as i am facing this error on every mirror in the .repo file. Yum install squid http://mirror2-dallas.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: [Errno 12] Timeout on http://mirror2-dallas.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds') Trying other mirror. mirror2-dc.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: [Errno 12] Timeout on mirror2-dc.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds') Trying other mirror. mirror1.timburgess.net/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: [Errno 12] Timeout on mirror1.timburgess.net/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds') Trying other mirror. mirror2-houston.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: [Errno 12] Timeout on mirror2-houston.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds') Trying other mirror. mirror3-toronto.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: [Errno 12] Timeout on mirror3-toronto.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds') Trying other mirror. mirror2-dallas.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: [Errno 12] Timeout on mirror2-dallas.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: (28, 'O*peration too slow. Less than 1 bytes/sec transfered the last 30 seconds'*) Trying other mirror. mirror2-dc.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: [Errno 12] Timeout on mirror2-dc.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds') Trying other mirror. mirror1.timburgess.net/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: [Errno 12] Timeout on mirror1.timburgess.net/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds') Trying other mirror. mirror3-toronto.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: [Errno 12] Timeout on mirror3-toronto.clearsdn.com/clearos/core/6/x86_64/repodata/primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds') Trying other mirror. Error: failure: repodata/primary.sqlite.bz2 from clearos-core: [Errno 256] No more mirrors to try. How can i fix this.i am able to access repo through web,and it seems nothing wrong with the repo.Where can be the problem. Tried yum clean all but it also didnt help. Is there a way to fix it as i am not able to install any package in it.

    Read the article

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