Search Results

Search found 4396 results on 176 pages for 'low poly'.

Page 2/176 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • What do you consider to be a high-level language and for what reason?

    - by Anto
    Traditionally, C was called a high-level language, but these days it is often referred to as a low-level language (it is high-level compared to Assembly, but it is very low-level compared to, for instance, Python, these days). Generally, everyone calls languages of the sort of Python and Java high-level languages nowadays. How would you judge whether a programming language really is a high-level language (or a low-level one)? Must you give direct instructions to the CPU while programming in a language to call it low-level (e.g. Assembly), or is C, which provides some abstraction from the hardware, a low-level language too? Has the meaning of "high-level" and "low-level" changed over the years?

    Read the article

  • Polynomial division overloading operator (solved)

    - by Vlad
    Ok. here's the operations i successfully code so far thank's to your help: Adittion: polinom operator+(const polinom& P) const { polinom Result; constIter i = poly.begin(), j = P.poly.begin(); while (i != poly.end() && j != P.poly.end()) { //logic while both iterators are valid if (i->pow > j->pow) { //if the current term's degree of the first polynomial is bigger Result.insert(i->coef, i->pow); i++; } else if (j->pow > i->pow) { // if the other polynomial's term degree is bigger Result.insert(j->coef, j->pow); j++; } else { // if both are equal Result.insert(i->coef + j->coef, i->pow); i++; j++; } } //handle the remaining items in each list //note: at least one will be equal to end(), but that loop will simply be skipped while (i != poly.end()) { Result.insert(i->coef, i->pow); ++i; } while (j != P.poly.end()) { Result.insert(j->coef, j->pow); ++j; } return Result; } Subtraction: polinom operator-(const polinom& P) const //fixed prototype re. const-correctness { polinom Result; constIter i = poly.begin(), j = P.poly.begin(); while (i != poly.end() && j != P.poly.end()) { //logic while both iterators are valid if (i->pow > j->pow) { //if the current term's degree of the first polynomial is bigger Result.insert(-(i->coef), i->pow); i++; } else if (j->pow > i->pow) { // if the other polynomial's term degree is bigger Result.insert(-(j->coef), j->pow); j++; } else { // if both are equal Result.insert(i->coef - j->coef, i->pow); i++; j++; } } //handle the remaining items in each list //note: at least one will be equal to end(), but that loop will simply be skipped while (i != poly.end()) { Result.insert(i->coef, i->pow); ++i; } while (j != P.poly.end()) { Result.insert(j->coef, j->pow); ++j; } return Result; } Multiplication: polinom operator*(const polinom& P) const { polinom Result; constIter i, j, lastItem = Result.poly.end(); Iter it1, it2, first, last; int nr_matches; for (i = poly.begin() ; i != poly.end(); i++) { for (j = P.poly.begin(); j != P.poly.end(); j++) Result.insert(i->coef * j->coef, i->pow + j->pow); } Result.poly.sort(SortDescending()); lastItem--; while (true) { nr_matches = 0; for (it1 = Result.poly.begin(); it1 != lastItem; it1++) { first = it1; last = it1; first++; for (it2 = first; it2 != Result.poly.end(); it2++) { if (it2->pow == it1->pow) { it1->coef += it2->coef; nr_matches++; } } nr_matches++; do { last++; nr_matches--; } while (nr_matches != 0); Result.poly.erase(first, last); } if (nr_matches == 0) break; } return Result; } Division(Edited): polinom operator/(const polinom& P) const { polinom Result, temp2; polinom temp = *this; Iter i = temp.poly.begin(); constIter j = P.poly.begin(); int resultSize = 0; if (temp.poly.size() < 2) { if (i->pow >= j->pow) { Result.insert(i->coef / j->coef, i->pow - j->pow); temp = temp - Result * P; } else { Result.insert(0, 0); } } else { while (true) { if (i->pow >= j->pow) { Result.insert(i->coef / j->coef, i->pow - j->pow); if (Result.poly.size() < 2) temp2 = Result; else { temp2 = Result; resultSize = Result.poly.size(); for (int k = 1 ; k != resultSize; k++) temp2.poly.pop_front(); } temp = temp - temp2 * P; } else break; } } return Result; } }; The first three are working correctly but division doesn't as it seems the program is in a infinite loop. Final Update After listening to Dave, I finally made it by overloading both / and & to return the quotient and the remainder so thanks a lot everyone for your help and especially you Dave for your great idea! P.S. If anyone wants for me to post these 2 overloaded operator please ask it by commenting on my post (and maybe give a vote up for everyone involved).

    Read the article

  • High level vs. low level programming. Do I really have to choose?

    - by EpsilonVector
    Every once in a while I'm asked in interviews which I like the best- low level or high level. It seems to me that the implicit message is that they are both a specialty and they want to know which direction I'm heading. The trouble is, I seem to like both. Low level is extremely challenging and often requires a great deal of esoteric knowledge. High level is where all the sexy things happen: applications that people use directly, results that can be easily demonstrated (showed off) in a way that is accessible to everybody, and you get to work with really advanced tools and interact with new technologies. I would really love to do both, even if it means alternating between them (I doubt there are jobs that will let me do both simultaneously), but I'm guessing that the industry rewards specialists more than generalists. Will it really be problematic career wise if I never choose one over the other? Is it practical to alternate between the two in the sense that if I were to leave a job doing one of them, I should experience no "friction" trying to get a job doing the other (assuming I'm reasonably in the loop)? Are there career opportunities where you get to do both? Do I really have to choose one over the other?

    Read the article

  • Low process priority problem

    - by Svepe
    I have just set Ubuntu 12.04 64bit with Cinnamon desktop and 3.5.0-030500 kernel on my new laptop with IvyBridge i7. I decided to test its performance by running a single threaded CPU-hungry program that I often use for camera calibration. Unfortunately, it ended up running much slower than I have ever expected. After some investigation it turned out that the program priority is automatically changed from normal to low which makes the program even slower. I have also noticed that all user programs such as Skype and Firefox are set to low priority. I tried manually resetting the priority to normal or even very high using the "renice" command, which works temporary until the kernel scheduler (I guess) resets the priority to low. Is this a normal behaviour and how can I overcome the problem with slowing down the execution? P.S. I also tried with the 3.2 kernel, but the problem is still present.

    Read the article

  • low level api or graphics library?

    - by German
    Well, I want to learn game development, I've already know a little bit about xna, ogre and DX but, I want to choose one of them and stick with it. I'm not trying to make a "directx vs xna, ogre vs opengl, etc." thread. Some people told me that it's better to learn an engine like Ogre because you can develop games directly and you don't have to worry about the low level details, I know that. Other people told me that it's better to learn a low level api before learning something like Ogre because you will able to understand how it works. Is it valuable to have experience with Ogre or another engine but don't know anything about a low level api? What do you recommend me? Thanks in advance.

    Read the article

  • QuickBox2D poly behaviour vs box or circle

    - by Ben Kanizay
    Hi I've played a little with Box2D before and have just started using QuickBox2D which makes things heaps easier. I am however getting different behaviour with a specific poly shape than I am with a box. All other properties are the same. I've included 3 simple examples and their source below. What I really want to work is Example 1 with both objects as poly. As you can see, it seems like the 'paddle' poly is the one that's failing - the 'ball' (whether it's a poly or circle) just falls straight through it instead of bouncing off as it does with a box 'paddle' object. Would appreciate some help or insight. As I can only post one line at this stage, the swf previews of the 3 examples can be seen here Example 1 source: package { import com.actionsnippet.qbox.QuickBox2D; import com.actionsnippet.qbox.QuickObject; import flash.display.MovieClip; public class Eg1 extends MovieClip { private var sim:QuickBox2D; private var paddle:QuickObject; private var ball:QuickObject; public function Eg1() { this.sim = new QuickBox2D(this); this.paddle = this.sim.addPoly({ x:13, y:19, angle:0, density:0, draggable:false, isBullet:true, verts:[[-3.84,-0.67,-2.84,-1,-2.17,-0.33,2.17,-0.33,2.84,-1,3.84,-0.67,2.84,1,-2.51,1]] }); this.ball = this.sim.addPoly({ x:13, y:1, restitution:1, friction:1, draggable:false, isBullet:true, verts:[[-0.34,-1,0.34,-1,0.67,-0.33,0.67,0.33,0.34,1,-0.34,1,-0.67,0.33,-0.67,-0.33]] }); this.sim.start(); } }} Example 2 source: package { import com.actionsnippet.qbox.QuickBox2D; import com.actionsnippet.qbox.QuickObject; import flash.display.MovieClip; public class Eg2 extends MovieClip { private var sim:QuickBox2D; private var paddle:QuickObject; private var ball:QuickObject; public function Eg2() { this.sim = new QuickBox2D(this); this.paddle = this.sim.addBox({ x:13, y:19, angle:0, density:0, draggable:false, isBullet:true, width:8 }); this.ball = this.sim.addPoly({ x:13, y:1, restitution:1, friction:1, draggable:false, isBullet:true, verts:[[-0.34,-1,0.34,-1,0.67,-0.33,0.67,0.33,0.34,1,-0.34,1,-0.67,0.33,-0.67,-0.33]] }); this.sim.start(); } }} Example 3 source: package { import com.actionsnippet.qbox.QuickBox2D; import com.actionsnippet.qbox.QuickObject; import flash.display.MovieClip; public class Eg3 extends MovieClip { private var sim:QuickBox2D; private var paddle:QuickObject; private var ball:QuickObject; public function Eg3() { this.sim = new QuickBox2D(this); this.paddle = this.sim.addPoly({ x:13, y:19, angle:0, density:0, draggable:false, isBullet:true, verts:[[-3.84,-0.67,-2.84,-1,-2.17,-0.33,2.17,-0.33,2.84,-1,3.84,-0.67,2.84,1,-2.51,1]] }); this.ball = this.sim.addCircle({ x:13, y:1, restitution:1, friction:1, draggable:false, isBullet:true, radius:1 }); this.sim.start(); } }}

    Read the article

  • Where can I find Cinema4D for game development tutorials ?

    - by George Profenza
    Hi, I started to learn Cinema 4D. I've noticed it's really easy to use for motion graphics, but I want to use it for modeling for games/realtime 3d engines. Before I used 3dsmax and it was easy to estimate how a model would look/behave in a 3d engine. The two main things I did was displaying Polygon triangles and displaying the Polygon Count. I've found the Total Polygons tick in HUD settings in Cinema 4D, but I can't find any display mode that will show triangles. Is there there a way to display triangle faces/not quads in Cinema4D ? If so how ? There is a Triangulate function, but I'd rather not Triangulate/Untriangulate all the time, especially since it's converting back and forth between the two doesn't always produce the same result. I imagine I'm asking for old school techniques, but I plan to use these to make low poly models for web(canvas/webGL) and mobile.

    Read the article

  • Working out of a vertex array for destrucible objects

    - by bobobobo
    I have diamond-shaped polygonal bullets. There are lots of them on the screen. I did not want to create a vertex array for each, so I packed them into a single vertex array and they're all drawn at once. | bullet1.xyz | bullet1.rgb | bullet2.xyz | bullet2.rgb This is great for performance.. there is struct Bullet { vector<Vector3f*> verts ; // pointers into the vertex buffer } ; This works fine, the bullets can move and do collision detection, all while having their data in one place. Except when a bullet "dies" Then you have to clear a slot, and pack all the bullets towards the beginning of the array. Is this a good approach to handling lots of low poly objects? How else would you do it?

    Read the article

  • Simplify your Ajax code by using jQuery Global Ajax Handlers and ajaxSetup low-level interface

    - by hajan
    Creating web applications with consistent layout and user interface is very important for your users. In several ASP.NET projects I’ve completed lately, I’ve been using a lot jQuery and jQuery Ajax to achieve rich user experience and seamless interaction between the client and the server. In almost all of them, I took advantage of the nice jQuery global ajax handlers and jQuery ajax functions. Let’s say you build web application which mainly interacts using Ajax post and get to accomplish various operations. As you may already know, you can easily perform Ajax operations using jQuery Ajax low-level method or jQuery $.get, $.post, etc. Simple get example: $.get("/Home/GetData", function (d) { alert(d); }); As you can see, this is the simplest possible way to make Ajax call. What it does in behind is constructing low-level Ajax call by specifying all necessary information for the request, filling with default information set for the required properties such as data type, content type, etc... If you want to have some more control over what is happening with your Ajax Request, you can easily take advantage of the global ajax handlers. In order to register global ajax handlers, jQuery API provides you set of global Ajax methods. You can find all the methods in the following link http://api.jquery.com/category/ajax/global-ajax-event-handlers/, and these are: ajaxComplete ajaxError ajaxSend ajaxStart ajaxStop ajaxSuccess And the low-level ajax interfaces http://api.jquery.com/category/ajax/low-level-interface/: ajax ajaxPrefilter ajaxSetup For global settings, I usually use ajaxSetup combining it with the ajax event handlers. $.ajaxSetup is very good to help you set default values that you will use in all of your future Ajax Requests, so that you won’t need to repeat the same properties all the time unless you want to override the default settings. Mainly, I am using global ajaxSetup function similarly to the following way: $.ajaxSetup({ cache: false, error: function (x, e) { if (x.status == 550) alert("550 Error Message"); else if (x.status == "403") alert("403. Not Authorized"); else if (x.status == "500") alert("500. Internal Server Error"); else alert("Error..."); }, success: function (x) { //do something global on success... } }); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Now, you can make ajax call using low-level $.ajax interface and you don’t need to worry about specifying any of the properties we’ve set in the $.ajaxSetup function. So, you can create your own ways to handle various situations when your Ajax requests are occurring. Sometimes, some of your Ajax Requests may take much longer than expected… So, in order to make user friendly UI that will show some progress bar or animated image that something is happening in behind, you can combine ajaxStart and ajaxStop methods to do the same. First of all, add one <div id=”loading” style=”display:none;”> <img src="@Url.Content("~/Content/images/ajax-loader.gif")" alt="Ajax Loader" /></div> anywhere on your Master Layout / Master page (you can download nice ajax loading images from http://ajaxload.info/). Then, add the following two handlers: $(document).ajaxStart(function () { $("#loading").attr("style", "position:absolute; z-index: 1000; top: 0px; "+ "left:0px; text-align: center; display:none; background-color: #ddd; "+ "height: 100%; width: 100%; /* These three lines are for transparency "+ "in all browsers. */-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\";"+ " filter: alpha(opacity=50); opacity:.5;"); $("#loading img").attr("style", "position:relative; top:40%; z-index:5;"); $("#loading").show(); }); $(document).ajaxStop(function () { $("#loading").removeAttr("style"); $("#loading img").removeAttr("style"); $("#loading").hide(); }); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Note: While you can reorganize the style in a more reusable way, since these are global Ajax Start/Stop, it is very possible that you won’t use the same style in other places. With this way, you will see that now for any ajax request in your web site or application, you will have the loading image appearing providing better user experience. What I’ve shown is several useful examples on how to simplify your Ajax code by using Global Ajax Handlers and the low-level AjaxSetup function. Of course, you can do a lot more with the other methods as well. Hope this was helpful. Regards, Hajan

    Read the article

  • Xubuntu 14.04 resolution low

    - by user3203576
    I installed Xubuntu 14.04 amd64 on the computer at the computer repair shop where I work, but the screen resolution is way low, like 1024 x 768 (that wouldn't be low for a laptop or anything, but for a large desktop screen it is) I went to the display settings, but the resolution wouldn't go higher than that. When I installed Xubuntu 14.04 i386 at my computer at home, I didn't have any problems with the resolution. Any help? update: I ran lspci | grep VGA and got: 00:0d.0 VGA compatible controller: NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2)

    Read the article

  • Google I/O 2012 - New Low-Level Media APIs in Android

    Google I/O 2012 - New Low-Level Media APIs in Android Dave Burke Jellybean introduces a new set of powerful low-level media APIs that provide developers with the ability to access hardware codecs directly from Java. This session introduces the new APIs with examples. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 470 15 ratings Time: 01:05:50 More in Science & Technology

    Read the article

  • Google I/O 2012 - New Low-Level Media APIs in Android

    Google I/O 2012 - New Low-Level Media APIs in Android Dave Burke Jellybean introduces a new set of powerful low-level media APIs that provide developers with the ability to access hardware codecs directly from Java. This session introduces the new APIs with examples. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 0 0 ratings Time: 01:05:50 More in Science & Technology

    Read the article

  • System low graphic error,asking for some command to fix it

    - by mantra
    While running Ubuntu 12.04 amd64 from USB in safe mode it shows an error that says the system system running in low graphics mode. When I click to reconfigure low graphics mode it prompts: ubuntu@ubuntu: It asks for some command. What should I do? I am a complete beginner on the Linux platform. Should I install it without fixing the graphics, or should I solve the graphics problem before installing?

    Read the article

  • Google Charts POLY problem with VS 2010 image map

    - by Davy
    Hi I am using http://code.google.com/apis/chart/docs/gallery/googleometer_chart.html I have: <img src="http://chart.apis.google.com/chart?cht=bvg&chs=250x150&chd=s:egbdf&chxt=x,y&chxs=0,ff0000,12,0,lt|1,0000ff,10,1,lt&chm=o,000000,0,-1,10|V,000000,0,-1,1:15,,:4:10|H,000000,0,-1,3:9,,:8:17&chxl=0:|E|G|B|D|F" usemap ="#chart" /> <map name='chart'> <area name='bar0_0' shape='POLY' coords= '124,440,124,499,143,440,143,498' href='#'> <area name='bar0_1' shape='RECT' coords='55,129,78,63' href='#'> </map> When I use 'rect' for shape I can attach a click event etc but when I use 'poly' It doesn't work. I've use a jQuery mouse position plug in to check the coords and they seem ok. Can anyone help please? Thanks

    Read the article

  • Position text in top of a dinamically generated map area of type poly

    - by Guillermo Vasconcelos
    Hi, I have a web page with a dynamically generated image map (from a server side charting tool that I have no control over). I have a value for each area in the title attribute that I want to display on top of the image. I could dynamically generate span elements with absolute positioning, but I'm not sure how to calculate the "center" of a poly shaped area to use as coordinates. Is there an easy way to create texts for image map areas? a JQuery plug in perhaps? Do you know a good way to calculate the center of a poly area? Do you have any other suggestions? Thanks, Guillermo

    Read the article

  • Netbook performs hard shutdown without warning on low battery power

    - by Steve Kroon
    My Asus EEE netbook performs a hard shutdown when it reaches low battery power, without giving any warning - i.e. the power just goes off, without any shutdown process. I can't find anything in the syslog, and no error messages are printed before it happens. I've had this problem on previous (K)Ubuntu versions, and hoped updating to Ubuntu Precise would help resolve the issue, but it hasn't. The option in the Power application for "when power is critically low" is currently blank - the only options are a (grayed-out) hibernate and "Power off". I have re-installed indicator-power to no effect. The time remaining reported by acpi is unstable, as is the time remaining reported by gnome-power-statistics. (For example, running acpi twice in succession, I got 2h16min, and then 3h21min remaining. These sorts of jumps in the remaining time are also in the gnome-power-statistics graphs.) It might be possible to write a script to give me advance warning (as per @RanRag's comment below), but I would prefer to isolate why I don't get a critical battery notification from the system before this happens, so that I can take action as appropriate (suspend/shutdown/plug in power) when I get a notification. Some additional information on the battery: kroon@minia:~$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/PNP0C0A:00/power_supply/BAT0 vendor: ASUS model: 1005P power supply: yes updated: Fri Aug 17 07:31:23 2012 (9 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: charging energy: 33.966 Wh energy-empty: 0 Wh energy-full: 34.9272 Wh energy-full-design: 47.52 Wh energy-rate: 3.7692 W voltage: 12.61 V time to full: 15.3 minutes percentage: 97.248% capacity: 73.5% technology: lithium-ion History (charge): 1345181483 97.248 charging 1345181453 97.155 charging 1345181423 97.062 charging 1345181393 96.970 charging History (rate): 1345181483 3.769 charging 1345181453 3.899 charging 1345181423 4.061 charging 1345181393 4.201 charging kroon@minia:~$ cat /proc/acpi/battery/BAT0/state present: yes capacity state: ok charging state: charging present rate: 332 mA remaining capacity: 3149 mAh present voltage: 12612 mV kroon@minia:~$ cat /proc/acpi/battery/BAT0/info present: yes design capacity: 4400 mAh last full capacity: 3209 mAh battery technology: rechargeable design voltage: 10800 mV design capacity warning: 10 mAh design capacity low: 5 mAh cycle count: 0 capacity granularity 1: 44 mAh capacity granularity 2: 44 mAh model number: 1005P serial number: battery type: LION OEM info: ASUS

    Read the article

  • Should mock objects for tests be created at a high or low level

    - by Danack
    When creating unit tests for those other objects, what is the best way to create mock objects that provide data to other objects. Should they be created at a 'high level' and intercept the calls as soon as possible, or should they be done at a 'low level' and so make as much as the real code still be called? e.g. I'm writing a test for some code that requires a NoteMapper object that allows Notes to be loaded from the DB. class NoteMapper { function getNote($sqlQueryFactory, $noteID) { // Create an SQL query from $sqlQueryFactory // Run that SQL // if null // return null // else // return new Note($dataFromSQLQuery) } } I could either mock this object at a high level by creating a mock NoteMapper object, so that there are no calls to the SQL at all e.g. class MockNoteMapper { function getNote($sqlQueryFactory, $noteID) { //$mockData = {'Test Note title', "Test note text" } // return new Note($mockData); } } Or I could do it at a very low level, by creating a MockSQLQueryFactory that instead of actually querying the database just provides mock data back, and passing that to the current NoteMapper object. It seems that creating mocks at a high level would be easier in the short term, but that in the long term doing it at a low level would be more powerful and possibly allow more automation of tests e.g. by recording data in an out of a DB and then replaying that data for tests. Is there a recommended way of creating mocks? Are there any hard and fast rules about which are better, or should they both be used where appropriate?

    Read the article

  • Low pagerank backlinks - does Google penalize?

    - by Programmer Joe
    I have a new stock discussion forum and I would like to promote it. Specifically, I have two ideas in mind to help promote it: 1) Become a member at other stock discussion forums. Make high quality posts, build a good reputation, and leave a link to my own forum in a non intrusive way (ie. in signature or at the end of my posts). This approach makes sense because you can find other members in other forums that are interested in stock discussion and a backlink to your forum, as long as it is not done in an intrusive/spammy way, should come across as acceptable. 2) Promote my site by writing articles at Squidoo, Hubpages, etc. This approach also makes sense because that's what Squidoo and Hubpages is for. The problem with both these approaches is that when I leave a backlink to my site, the page that I am leaving a backlink from may have a low PR - most likely, a PR of 0. Now, I have read that after the Penguin update by Google, your site can be penalized if you have too many backlinks from low PR pages: http://www.entrepreneur.com/article/224339 So, I am caught in a dilemma: a) If I start promoting my site via other stock forums, Squidoo, Hubpages, etc, but the backlink to my site comes from a page with low PR, Google may penalize my site. b) However, if I don't promote my site, nobody will ever discover it (aside from other promotion techniques like social media promotion, directories, etc).

    Read the article

  • Low coupling processing big quantities of data

    - by vitalik
    Usually I achieve low coupling by creating classes that exchange lists, sets, and maps between them. Now I am developing a batch application and I can't put all the data inside a data structure because there isn't enough memory. I have to read and process one chunk of data and then going to the next one. So having low coupling is much more difficult because I have to check somewhere if there is still data to read, etc. What I am using now is: Source - Process - Persist The classes that process have to ask to the Source classes if there are more rows to read. What are the best practices and or useful patterns in such situations? I hope I am explaining myself, if not tell me.

    Read the article

  • Modify actions when battery is critically low?

    - by Bjarke Freund-Hansen
    I am running ubuntu (not xubuntu!) and am using xfce4 on my laptop. When my laptop battery is critically low, ubuntu/xfce4 performs some action (perhaps hibernate?) which causes my laptop to shut down. However when I start it again, it never comes up. I don't even get BIOS or anything on the screen, it is completely black. The only way to get it back up is to take it apart, remove the internal cmos battery as well as the main battery, wait a few minutes, and put it back together. Obeviously this is not optimal. How do I disable all actions when the battery is critically low? I would rather have it run out of power, than ending up in this error condition. Thanks in advance. :)

    Read the article

  • Polynomial division overloading operator

    - by Vlad
    Ok. here's the operations i successfully code so far thank's to your help: Adittion: polinom operator+(const polinom& P) const { polinom Result; constIter i = poly.begin(), j = P.poly.begin(); while (i != poly.end() && j != P.poly.end()) { //logic while both iterators are valid if (i->pow > j->pow) { //if the current term's degree of the first polynomial is bigger Result.insert(i->coef, i->pow); i++; } else if (j->pow > i->pow) { // if the other polynomial's term degree is bigger Result.insert(j->coef, j->pow); j++; } else { // if both are equal Result.insert(i->coef + j->coef, i->pow); i++; j++; } } //handle the remaining items in each list //note: at least one will be equal to end(), but that loop will simply be skipped while (i != poly.end()) { Result.insert(i->coef, i->pow); ++i; } while (j != P.poly.end()) { Result.insert(j->coef, j->pow); ++j; } return Result; } Subtraction: polinom operator-(const polinom& P) const //fixed prototype re. const-correctness { polinom Result; constIter i = poly.begin(), j = P.poly.begin(); while (i != poly.end() && j != P.poly.end()) { //logic while both iterators are valid if (i->pow > j->pow) { //if the current term's degree of the first polynomial is bigger Result.insert(-(i->coef), i->pow); i++; } else if (j->pow > i->pow) { // if the other polynomial's term degree is bigger Result.insert(-(j->coef), j->pow); j++; } else { // if both are equal Result.insert(i->coef - j->coef, i->pow); i++; j++; } } //handle the remaining items in each list //note: at least one will be equal to end(), but that loop will simply be skipped while (i != poly.end()) { Result.insert(i->coef, i->pow); ++i; } while (j != P.poly.end()) { Result.insert(j->coef, j->pow); ++j; } return Result; } Multiplication: polinom operator*(const polinom& P) const { polinom Result; constIter i, j, lastItem = Result.poly.end(); Iter it1, it2, first, last; int nr_matches; for (i = poly.begin() ; i != poly.end(); i++) { for (j = P.poly.begin(); j != P.poly.end(); j++) Result.insert(i->coef * j->coef, i->pow + j->pow); } Result.poly.sort(SortDescending()); lastItem--; while (true) { nr_matches = 0; for (it1 = Result.poly.begin(); it1 != lastItem; it1++) { first = it1; last = it1; first++; for (it2 = first; it2 != Result.poly.end(); it2++) { if (it2->pow == it1->pow) { it1->coef += it2->coef; nr_matches++; } } nr_matches++; do { last++; nr_matches--; } while (nr_matches != 0); Result.poly.erase(first, last); } if (nr_matches == 0) break; } return Result; } Division(Edited): polinom operator/(const polinom& P) { polinom Result, temp; Iter i = poly.begin(); constIter j = P.poly.begin(); if (poly.size() < 2) { if (i->pow >= j->pow) { Result.insert(i->coef, i->pow - j->pow); *this = *this - Result; } } else { while (true) { if (i->pow >= j->pow) { Result.insert(i->coef, i->pow - j->pow); temp = Result * P; *this = *this - temp; } else break; } } return Result; } The first three are working correctly but division doesn't as it seems the program is in a infinite loop. Update Because no one seems to understand how i thought the algorithm, i'll explain: If the dividend contains only one term, we simply insert the quotient in Result, then we multiply it with the divisor ans subtract it from the first polynomial which stores the remainder. If the polynomial we do this until the second polynomial( P in this case) becomes bigger. I think this algorithm is called long division, isn't it? So based on these, can anyone help me with overloading the / operator correctly for my class? Thanks!

    Read the article

  • Define polynomial function

    - by user1822707
    How can I define a function - say, def polyToString(poly) - to return a string containing the polynomial poly in standard form? For example: the polynomial represented by [-1, 2, -3, 4, -5] would be returned as: "-5x**4 + 4x**3 -3x**2 + 2x**1 - 1x**0" def polyToString(poly): standard_form='' n=len(poly) - 1 while n >=0: if poly[n]>=0: if n==len(poly)-1: standard_form= standard_form + ' '+ str(poly[n]) + 'x**%d'%n else: standard_form= standard_form + ' + '+str(poly[n]) + 'x**%d'%n else: standard_form= standard_form + ' - ' + str(abs(poly[n])) + 'x**' + str(n) n=n-1 return standard_form

    Read the article

  • Learning computer architecture as a programmer

    - by Samaursa
    I typically run across gurus at SO and other places (instructors, book authors etc.) that would say something along the lines "This will cause alignment issues" or other low level tidbits. I want to learn about all these tidbits that are relevant to programming. Now usually when I see low level books (computer architecture books for example) they are too low level and geared towards people whose primary area of interest is computer architecture and not software design. Do you have recommendations for books that go through low-level stuff that is relevant to programmers?

    Read the article

  • Why Ultra-Low Power Computing Will Change Everything

    - by Tori Wieldt
    The ARM TechCon keynote "Why Ultra-Low Power Computing Will Change Everything" was anything but low-powered. The speaker, Dr. Johnathan Koomey, knows his subject: he is a Consulting Professor at Stanford University, worked for more than two decades at Lawrence Berkeley National Laboratory, and has been a visiting professor at Stanford University, Yale University, and UC Berkeley's Energy and Resources Group. His current focus is creating a standard (computations per kilowatt hour) and measuring computer energy consumption over time. The trends are impressive: energy consumption has halved every 1.5 years for the last 60 years. Battery life has made roughly a 10x improvement each decade since 1960. It's these improvements that have made laptops and cell phones possible. What does the future hold? Dr. Koomey said that in the past, the race by chip manufacturers was to create the fastest computer, but the priorities have now changed. New computers are tiny, smart, connected and cheap. "You can't underestimate the importance of a shift in industry focus from raw performance to power efficiency for mobile devices," he said. There is also a confluence of trends in computing, communications, sensors, and controls. The challenge is how to reduce the power requirements for these tiny devices. Alternate sources of power that are being explored are light, heat, motion, and even blood sugar. The University of Michigan has produced a miniature sensor that harnesses solar energy and could last for years without needing to be replaced. Also, the University of Washington has created a sensor that scavenges power from existing radio and TV signals.Specific devices designed for a purpose are much more efficient than general purpose computers. With all these sensors, instead of big data, developers should focus on nano-data, personalized information that will adjust the lights in a room, a machine, a variable sign, etc.Dr. Koomey showed some examples:The Proteus Digital Health Feedback System, an ingestible sensor that transmits when a patient has taken their medicine and is powered by their stomach juices. (Gives "powered by you" a whole new meaning!) Streetline Parking Systems, that provide real-time data about available parking spaces. The information can be sent to your phone or update parking signs around the city to point to areas with available spaces. Less driving around looking for parking spaces!The BigBelly trash system that uses solar power, compacts trash, and sends a text message when it is full. This dramatically reduces the number of times a truck has to come to pick up trash, freeing up resources and slashing fuel costs. This is a classic example of the efficiency of moving "bits not atoms." But researchers are approaching the physical limits of sensors, Dr. Kommey explained. With the current rate of technology improvement, they'll reach the three-atom transistor by 2041. Once they hit that wall, it will force a revolution they way we do computing. But wait, researchers at Purdue University and the University of New South Wales are both working on a reliable one-atom transistors! Other researchers are working on "approximate computing" that will reduce computing requirements drastically. So it's unclear where the wall actually is. In the meantime, as Dr. Koomey promised, ultra-low power computing will change everything.

    Read the article

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