Search Results

Search found 2565 results on 103 pages for 'reduce'.

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

  • TIME REDUCE(OPTIMISE QUERY)

    - by user2527657
    select a.userid,(select firstName from user where userid=NOTUSED.userid) as z, (select max(login_time) from userLoginTime AS b where userid = a.user_id GROUP BY b.user_id ORDER BY b.user_id) as y From(SELECT DISTINCT a.user_id FROM user AS a LEFT OUTER JOIN (SELECT (userid) FROM userlogintime where serialid=15400012)AS b ON user.user_id = b.user_id where a.Serialid=15400012 AND b.userid IS NULL) NOTUSED, Relation r, user a where r.childuserid = NOTUSED.userid and guarduserid = a.userid

    Read the article

  • How to reduce the size of a pdf file?

    - by Nicole
    I'm looking for a way in Ubuntu to reduce the size of a pdf (by reducing the quality of the images). I know that this can be done in Ghostscript by typing the following command in terminal: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf The problem is that I can't specify the quality with any accuracy. The parameter -dPDFSETTINGS=/screen is the one that decides the quality; but the alternatives are quite rigid (for example it is possible to do -dPDFSETTINGS=/ebook for slightly better quality). I'm looking for a way to reduce the size of a pdf in a way that allows me to specify the desired quality numerically. I know that this is possible in a Mac, so it must be possible in Linux -- right? Any help would be well appreciated.

    Read the article

  • I know of three ways in which SRP helps reduce coupling. Are there even more? [closed]

    - by user1483278
    I'd like to figure all the possible ways SRP helps us reduce coupling. Thus far I can think of three: 1) If class A has more than one responsibility, these responsibilities become coupled and as such changes to one of these responsibilities may require changes to other of A's responsibilities. 2) Related functionality usually needs to be changed for the same reason and by grouping it togerther in a single class, the changes can be made in as few places as possible ( at best changes only need be made to the class which groups together these functionalities) 3) Assuming class A performs two tasks ( thus may change for two reasons ), then number of classes utilising A will be greater than if A performed just a single task ( reason being that some classes will need A to perform first task, other will need A for second task, and still others will utilise it for both tasks ).This also means that when A breaks, the number of classes ( utilising A ) being impaired will be greater than if A performed just a single task. Can SRP also help reduce coupling in any other way, not described above? Thank you

    Read the article

  • Can all code be represented as a series of Map / Filter / Reduce operations?

    - by Mongus Pong
    I have recently been refactoring large chunks of code and replacing them with Linq queries. Removing the language bias - Linq is essentially a set of Map / Filter and Reduce operations that operate on a sequence of data. This got me thinking, how far would I theoretically be able to take this. Would I be able to rewrite the whole code base into a series (or even a single) of Map / Filter and Reduce operations. Unfortunately I get paid to do useful stuff, so I haven't been able to experiment much further, but I can't think of any code structure that couldn't be re structured as such. Side effected code can be dealt with via monads.. Even output is essentially mapping memory addresses to screen addresses. Is there anything that couldn't be (theoretically) rewritten as a Linq query?

    Read the article

  • Need help figuring out scala compiler errors.

    - by klactose
    Hello all, I have been working on a project in scala, but I am getting some error messages that I don't quite understand. The classes that I am working with are relatively simple. For example: abstract class Shape case class Point(x: Int, y: Int) extends Shape case class Polygon(points: Point*) extends Shape Now suppose that I create a Polygon: val poly = new Polygon(new Point(2,5), new Point(7,0), new Point(3,1)) Then if I attempt to determine the location and size of the smallest possible rectangle that could contain the polygon, I get various errors that I don't quite understand. Below are snippets of different attempts and the corresponding error messages that they produce. val upperLeftX = poly.points.reduceLeft(Math.min(_.x, _.x)) Gives the error: "missing parameter type for expanded function ((x$1) = x$1.x)" val upperLeftX = poly.points.reduceLeft((a: Point, b: Point) => (Math.min(a.x, b.x))) Gives this error: "type mismatch; found : (Point, Point) = Int required: (Any, Point) = Any" I am very confused about both of these error messages. If anyone could explain more clearly what I am doing incorrectly, I would really appreciate it. Yes, I see that the second error says that I need type "Any" but I don't understand exactly how to implement a change that would work as I need it. Obviously simply changing "a: Point" to "a: Any" is not a viable solution, so what am I missing?

    Read the article

  • Is it OK to use dynamic typing to reduce the amount of variables in scope?

    - by missingno
    Often, when I am initializing something I have to use a temporary variable, for example: file_str = "path/to/file" file_file = open(file) or regexp_parts = ['foo', 'bar'] regexp = new RegExp( regexp_parts.join('|') ) However, I like to reduce the scope my variables to the smallest scope possible so there is less places where they can be (mis-)used. For example, I try to use for(var i ...) in C++ so the loop variable is confined to the loop body. In these initialization cases, if I am using a dynamic language, I am then often tempted to reuse the same variable in order to prevent the initial (and now useless) value from being used latter in the function. file = "path/to/file" file = open(file) regexp = ['...', '...'] regexp = new RegExp( regexp.join('|') ) The idea is that by reducing the number of variables in scope I reduce the chances to misuse them. However this sometimes makes the variable names look a little weird, as in the first example, where "file" refers to a "filename". I think perhaps this would be a non issue if I could use non-nested scopes begin scope1 filename = ... begin scope2 file = open(filename) end scope1 //use file here //can't use filename on accident end scope2 but I can't think of any programming language that supports this. What rules of thumb should I use in this situation? When is it best to reuse the variable? When is it best to create an extra variable? What other ways do we solve this scope problem?

    Read the article

  • Reducing number of include files to reduce server load/speed up site?

    - by rein
    You can reduce the number of HTTP requests to speed up your site, such as css sprite images. I'm wondering does reducing the number of php includes/requires also speed up your site or reduce server load? For example, I have a index.php with <?php include './file.php'; ?> If instead I copy and paste the code from file.php and just put it into index.php, thus removing the include code, would it reduce the server load? This might make things less organized, but if it does reduce server load I might need to do that. For a small to medium sized site, I assume there might not be a difference, but how about for high traffic sites? Thanks in advance.

    Read the article

  • Can I do a reduce on a list comprehension into two lists, based on two values?

    - by pdknsk
    I've got the following code. sum_review = reduce(add,[book['rw'] for book in books]) sum_rating = reduce(add,[book['rg'] for book in books]) items = len(books) avg_review = sum_review/items avg_rating = sum_rating/items What I'd like is this. sum_review,sum_rating = reduce(add,([book['rw'],[book['rg']) for book in books]) items = len(books) avg_review = sum_review/items avg_rating = sum_rating/items Obviously this doesn't work. How can I solve this redundancy, without a regular loop?

    Read the article

  • What browser or any tool can reduce flash CPU usage?

    - by Stan
    OS: windows XP SP3 While listening to Pandora in Chrome, the CPU usage is almost to 100% for a single core in CPU. Is there any way to reduce CPU usage? Either by using another browser, any plugins that reduce flash CPU usage, or like in Linux, there's a lightweight client - Pithos for Pandora. Thanks.

    Read the article

  • How do I reduce the screen and file size of a recorded video, plus convert to FLV?

    - by Volomike
    I have used gtk-recordMyDesktop to make a video as an OGV file using the default settings. I need to do 3 things: How can I reduce the screen resolution (height and width) so that it can fit into a smaller video size on my website? How can I pull out like every third frame so that the file size is not so large, yet not mess up the sound? Not all Windows IE users can view OGV files. How can I convert to FLV (or, as a fallback, MP4) so that I can share on my blog?

    Read the article

  • How to reduce the time it takes to load my web game? [closed]

    - by Danial
    I created a puzzle game with Unity and uploaded it to one server. This works fine, but I bought a new server and uploaded my game to it as well. There, the loading time is much longer. These are the servers: http://pinheadsinteractive.com/Mozzie/ (fast) http://operation-mozzie-free.com/ (slow) The Unity files are exactly the same from one server to the next. My client is dissatisfied with the new, slow loading time. So, how can I reduce the time my Unity game takes to load? Even in some cases they faced the problem that they could not load the game at all. For the the moment, I'm using an iframe on the new sever as a workaround, but the issue still remains unsolved.

    Read the article

  • How does having assets saved on a secondary domain(s) reduce the load time of the website?

    - by AAA
    I went for an interview yesterday where I was asked this question: "How does having assets (images/videos) stored on a secondary domain (assets.example.com) reduce the load time of example.com?" To that I answered that by having the code "call" those assets from a secondary website it reduces the traffic that is coming to the main domain and therefore only applying bandwidth to the main domain vs having to also serve bandwidth to request assets. Is that correct? Also, If i am correct, would you say it makes sense to start new websites with this in mind or do you prefer having it done after large traffic rates are achieved?

    Read the article

  • How to reduce the fan noise and how to increase battery life?

    - by mehdi
    I have a brand new Sony Vaio S series laptop.(VPCSA2DGX) It came factory installed with Windows 7 professional Edition 64bit. Runs Intel core i5, 500 GB HDD , 4GB Ram. First I installed ubuntu 11.10 64 bit along side Windows to dual boot. Later,since the problem did not solve, I installed ubuntu 12.04 64bit along side Windows to dual boot. However the problem keeps annoying me. Problem: When running ubuntu 11.10/12.04, the battery lasts only about 1.5 hours. The Fan runs loud and continuously. And there is a lot of heat generated. System monitor shows less than 5% CPU used. My laptop enjoys hybrid graphic and I tried turning off ADM graphic card and keep Intel graphic card on. However I can not get the Fan noise or heat to go away and consequently the battery drain continues. BTW, in windows, the laptop gives 4-5 hours of battery power, Fan is silent and there is no heat problem. Any ideas on how to reduce the fan noise and how to increase battery life in ubuntu 11.10/12.04?

    Read the article

  • How to reduce the fan noise and how to increase battery life in ubuntu 11.10/12.04?

    - by mehdi
    I have a brand new Sony Vaio S series laptop.(VPCSA2DGX) It came factory installed with Windows 7 professional Edition 64bit. Runs Intel core i5, 500 GB HDD , 4GB Ram. First I installed ubuntu 11.10 64 bit along side Windows to dual boot. Later,since the problem did not solve, I installed ubuntu 12.04 64bit along side Windows to dual boot. However the problem keeps annoying me. Problem: When running ubuntu 11.10/12.04, the battery lasts only about 1.5 hours. The Fan runs loud and continuously. And there is a lot of heat generated. System monitor shows less than 5% CPU used. My laptop enjoys hybrid graphic and I tried turning off ADM graphic card and keep Intel graphic card on. However I can not get the Fan noise or heat to go away and consequently the battery drain continues. BTW, in windows, the laptop gives 4-5 hours of battery power, Fan is silent and there is no heat problem. Any ideas on how to reduce the fan noise and how to increase battery life in ubuntu 11.10/12.04?

    Read the article

  • What reasons are there to reduce the max-age of a logo to just 8 days? [closed]

    - by callum
    Most websites set max-age=31536000 (1 year) on the Cache-control headers of static assets such as logo images. Examples: YouTube Yahoo Twitter BBC But there is a notable exception: Google's logo has max-age=691200 (8 days). I've checked the headers on the Google logo in the past, and it definitely used to be 1 year. (Also, it used to be part of a sprite, and now it is a standalone logo image, but that's probably another question...) What could be valid technical reasons why they would want to reduce its cache lifetime to just 8 days? Google's homepage is one of the most carefully optimised pages in the world, so I imagine there's a good reason. Edit: Please make sure you understand these points before answering: Nobody uses short max-age lifetimes to allow modifying a static asset in future. When you modify it, you just serve it at a different URL. So no, it's nothing to do with Google doodles. Think about it: even if Google didn't understand this basic trick of HTTP, 8 days still wouldn't be appropriate, as only those users who don't have the original logo cached would see the doodle on doodle-day – and then that group of users would go on seeing the doodle for the following 8 days after Google changed it back :) Web servers do not worry about "filling up" the caches of clients (or proxies). The client manages this by itself – when it hits its own storage limit, it just starts dropping the lowest priority items to make space for new items. The priority score is based on the question "How likely am I to benefit from having cached this URL?", which is nothing to do with what max-age value the server sent when the URL was originally requested; it's a heuristic based on the "frecency" of requests for that URL. The max-age simply lets the server set a cut-off point – the time at which the client is supposed to discard the item regardless of how often it's being re-used. It would be very nice and trusting of a downstream client/proxy to rely on all origin servers "holding back" from filling up their caches, but I don't think we live in that world ;)

    Read the article

  • How to reduce the CPU load on a hosting with WordPress installed as a CMS? [on hold]

    - by Akky Awesøme
    I have been using hostgators hatchling plan for three months. I got an email from the hosting that my website is creating an over load on CPU. They said that I am eating up their processor and as a precaution, they have temporarily suspended my account. When I contacted their customer support, they said: You have to optimize your database and use some sort of caching mechanism, where the script does not need to generate a new page with every request, helps to lower the over load that a script will cause. I am not a technical geek, I am wondering how I will do this thing. I don't have any resource to hire a web developer to do this job. My website is down for 48hours. I was using wp super cache along with cloudfare's free support. Now I have intalled optimize-db plugin and optimized my database. Please provide me with some more tips on how to optimize my database to reduce CPU usage. Any help would be appreciated.

    Read the article

  • What packages are safe to uninstall to reduce installation size?

    - by mathematician1975
    This question is similar to a previous question I asked How can I turn my desktop Ubuntu 8.04 into a command line only install?. I was wondering if anyone can recommend any other bulky packages from the standard 8.04 installation that can reduce the size on disk of my installation. All I really require is socket functionality, g++ and gcc, some kind of text editor and SSH client and server. Things that I don't require are things like media players, audio packages, and the more "superficial" kind of desktop niceties. Is there anything particularly large in a standard install that is safe for me to remove without compromising my requirements above? I am a bit apprehensive about trying to uninstall items and I am not totally confident about removal of particular things having a negative effect on the functionality of any other things I might need (an example is would it be safe for me to remove everything to do with Perl, or does the system/kernel/other processes require this) ??? Basically I would like to be left with the kind of items that would have been installed in the CLI version of 8.04 (had the alternative iso image not been faulty). Any help/suggestions would be gratefully received.

    Read the article

  • how to reduce size (disk space) of windows 8?

    - by humanityANDpeace
    This questions is about what things I can do to reduce the size that Windows 8 uses. Background For example: At present and with only one programm installed (MS Access 2007) I have a about 15GB of my harddisk space used. I have little space (its a 17 GB partition on a SSD disk). I would like solutions that are like: Remove files not really needed (drivers not actually needed in the system) Help files not really needed (documentation) pagefile.sys (assuming I would have 4GB ram and no real need for swaping) hiberfil.sys (used for hibernate and sleep... I need that. though I would regain about 4GB space) At best I would like to delete mostly files that I would most likely not need. Though I have no good idea where to start there. Since my setup (hardware will not change) I would be willing to delete all the drivers that windows 8 has for hardware I do not have.... The question is about ways to reduce the space that Windows 8 uses.

    Read the article

  • How to use map/reduce to handle more than 10000 unique keys for grouping in MongoDB?

    - by Magnus Johansson
    I am using MongoDB v1.4 and the mongodb-csharp driver and I try to group on a data store that has more than 10000 keys, so I get this error: assertion: group() can't handle more than 10000 unique keys using c# code like this: Document query = new Document().Append("group", new Document() .Append("key", new Document().Append("myfieldname", true)) .Append("$reduce", new CodeWScope( "function(obj,prev) { prev.count++; }")) .Append("initial", new Document().Append("count", 0)) .Append("ns", "myitems")); I read that I should use map/reduce, but I can't figure out how. Can somebody please shed some light on how to use map/reduce? Or is there any other way to get around this limitation? Thanks.

    Read the article

  • In MongoDB, how can I replicate this simple query using map/reduce in ruby?

    - by Matthew Rathbone
    Hi, So using the regular MongoDB library in Ruby I have the following query to find average filesize across a set of 5001 documents: avg = 0 total = collection.count() Rails.logger.info "#{total} asset creation stats in the system" collection.find().each {|row| avg += (row["filesize"] * (1/total.to_f)) if row["filesize"]} Its pretty simple, so I'm trying to do the same using map/reduce as a learning exercise. This is what I came up with: map = 'function(){emit("filesizes", {size: this.filesize, num: 1});}' reduce = 'function(k, vals){ var result = {size: 0, num: 0}; for(var x in vals) { var new_total = result.num + vals[x].num; result.num = new_total result.size = result.size + (vals[x].size * (vals[x].num / new_total)); } return result; }' @results = collection.map_reduce(map, reduce) However the two queries come back with two different results! What am I doing wrong?

    Read the article

  • Big Data – Buzz Words: What is MapReduce – Day 7 of 21

    - by Pinal Dave
    In yesterday’s blog post we learned what is Hadoop. In this article we will take a quick look at one of the four most important buzz words which goes around Big Data – MapReduce. What is MapReduce? MapReduce was designed by Google as a programming model for processing large data sets with a parallel, distributed algorithm on a cluster. Though, MapReduce was originally Google proprietary technology, it has been quite a generalized term in the recent time. MapReduce comprises a Map() and Reduce() procedures. Procedure Map() performance filtering and sorting operation on data where as procedure Reduce() performs a summary operation of the data. This model is based on modified concepts of the map and reduce functions commonly available in functional programing. The library where procedure Map() and Reduce() belongs is written in many different languages. The most popular free implementation of MapReduce is Apache Hadoop which we will explore tomorrow. Advantages of MapReduce Procedures The MapReduce Framework usually contains distributed servers and it runs various tasks in parallel to each other. There are various components which manages the communications between various nodes of the data and provides the high availability and fault tolerance. Programs written in MapReduce functional styles are automatically parallelized and executed on commodity machines. The MapReduce Framework takes care of the details of partitioning the data and executing the processes on distributed server on run time. During this process if there is any disaster the framework provides high availability and other available modes take care of the responsibility of the failed node. As you can clearly see more this entire MapReduce Frameworks provides much more than just Map() and Reduce() procedures; it provides scalability and fault tolerance as well. A typical implementation of the MapReduce Framework processes many petabytes of data and thousands of the processing machines. How do MapReduce Framework Works? A typical MapReduce Framework contains petabytes of the data and thousands of the nodes. Here is the basic explanation of the MapReduce Procedures which uses this massive commodity of the servers. Map() Procedure There is always a master node in this infrastructure which takes an input. Right after taking input master node divides it into smaller sub-inputs or sub-problems. These sub-problems are distributed to worker nodes. A worker node later processes them and does necessary analysis. Once the worker node completes the process with this sub-problem it returns it back to master node. Reduce() Procedure All the worker nodes return the answer to the sub-problem assigned to them to master node. The master node collects the answer and once again aggregate that in the form of the answer to the original big problem which was assigned master node. The MapReduce Framework does the above Map () and Reduce () procedure in the parallel and independent to each other. All the Map() procedures can run parallel to each other and once each worker node had completed their task they can send it back to master code to compile it with a single answer. This particular procedure can be very effective when it is implemented on a very large amount of data (Big Data). The MapReduce Framework has five different steps: Preparing Map() Input Executing User Provided Map() Code Shuffle Map Output to Reduce Processor Executing User Provided Reduce Code Producing the Final Output Here is the Dataflow of MapReduce Framework: Input Reader Map Function Partition Function Compare Function Reduce Function Output Writer In a future blog post of this 31 day series we will explore various components of MapReduce in Detail. MapReduce in a Single Statement MapReduce is equivalent to SELECT and GROUP BY of a relational database for a very large database. Tomorrow In tomorrow’s blog post we will discuss Buzz Word – HDFS. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Big Data, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL

    Read the article

  • How to reduce the Number of threads running at instance in jetty server ?

    - by Thirst for Excellence
    i would like to reduce the live threads on server to reduce the bandwidth consumption for data(data pull while application launching time) transfer from my application to clients in my application. i did setting like is this setting enough to reduce the bandwidth consumption on jetty server ? Please help me any one 1) in Jetty.xml: <Set name="ThreadPool"> <New class="org.eclipse.jetty.util.thread.QueuedThreadPool"> <name="minThreads"> 1 > <Set name="maxThreads" value=50> 2: services-config.xml channel-definition id="my-longpolling-amf" class="mx.messaging.channels.AMFChannel" endpoint url="http://MyIp:8400/blazeds/messagebroker/amflongpolling" class="flex.messaging.endpoints.AMFEndpoint" properties <polling-enabled>true</polling-enabled> <polling-interval-seconds>1</polling-interval-seconds> <wait-interval-millis>60000</wait-interval-millis> <client-wait-interval-millis>1</client-wait-interval-millis> <max-waiting-poll-requests>50</max-waiting-poll-requests> </properties> </channel-definition>

    Read the article

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