Daily Archives

Articles indexed Monday November 19 2012

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

  • Advice for moving from custom domain hosted on blogspot to new custom domain on hosting provider [closed]

    - by Chan
    Need some advice :) a) Facts: 1. Currently, we have a blog www.thebigbigsky.net hosted on blogspot.com. The site has been up for around a year and google had cached some of the posts. 2. The idea for setting up the blog was to promote/share articles/write-up about personal development and self-growth, and also to offer counseling services related to them. 3. There is another subdomain - chinese.thebigbigsky.net hosting similar blog posts but in Chinese. This is hosted on blogspot as well. b) What we want to do: 1. We did some research on the internet and understood that, to make a website more popular, it is better to have a domain name that is related to the content of the site. Hence, in our case, a domain name containing "personal development" would be more ideal and easier for people to remember. 2. Hence, we are thinking to move away from blogspot to a meaningful new domain (example: personaldevelopmentwithxyz.com) and move all contents there. The new domain will be hosted on a hosting provider e.g. hostgator.com c) Here are the steps we have in mind: 1. Register the new domain (example: personaldevelopmentwithxyz.com) 2. Get a hosting provider hostgator.com 3. Setup a new site based on Wordpress, import all contents from existing blog to this new site - personaldevelopmentwithxyz.com. 4. Switch current blog back to thebigbigsky.blogspot.com 5. Switch DNS of www.thebigbigsky.net to point to the new site on hostgator.com 6. On hostgator.com, setup permanent redirect 301 of www.thebigbigsky.net to point to personaldevelopmetnwithxyz.com by following the tutorial mentioned here - http://www.blogbloke.com/migrating-redirecting-blogger-wordpress-htaccess-apache-best-method/ Questions: 1. Will it have major impact on the current google pagerank or SEO of thebigbigsky.net? As the site is not that popular, we assumed that the impact would not be a major one. 2. Is the domain personaldevelopmentwithxyz.com considered too long? (For SEO etc) 3. Steps c.4 and c.5 above - Will this work for our case? 4. How about the subdomain - chinese.thebigbigsky.net? We would like keep it as separate blog with the domain e.g. chinese.personaldevelopmentwithxyz.com 5. We added "facebook comments" to the existing post on www.thebigtbigsky.net and would not want to lose it. Will the comments still be there after we moved to the new domain? 6. Any better idea to do it? :) Thank you very much! regards, -chan

    Read the article

  • Resturant deal / voucher affiliate links? [closed]

    - by sam
    Does any one know where you can access Restaurant deal / voucher affiliate links, like the sort of '20% off any pizza at Dominos' vouchers. With an affiliate link to the site so you (the refer gets a commision) Do sites like http://www.vouchercodes.co.uk/ get them from an affiliate portal like Rakuten or Affiliate window or do the negotiate the deals with each restaurant link Groupon / LivingSocial do ?

    Read the article

  • Use PathModifier of MoveModifier for Tower of Defense Game

    - by Siddharth
    In my game I want to move enemy on the fixed path so that I have establish manual grid structure for that purpose not used tile map. Game contain multiple level and the path will be different for each level and also multiple fixed path exist for each level. So my question is, What I have to use MoveModifier or PathModifier for my game ? Also mention I have to use WayPoint or not. Further detail you all are free to ask. Please help me to decide what to do.

    Read the article

  • adapting a Unity gravitational script to allow moons

    - by PartyMix
    I'm using this script: http://wiki.unity3d.com/index.php/Simple_planetary_orbits to get a solar system going in Unity, but it doesn't seem to support creating bodies that orbit other moving bodies (or I am using it incorrectly). Any idea about how to modify it so that it does (or just use it correctly)? I've been beating my head against this problem for a couple hours, and I really don't feel like I have any idea what I'm doing. Thanks in advance.

    Read the article

  • Saving and Loading the Game (Automatically or Manually) via Internal Storage Only (Tablet PC Issues)

    - by David Dimalanta
    Here is my question. When making a game app for Android, I considered first the device. It's no problem to save progress everything (from levels to records) on a smartphone because it has an SD Card slot. Exception to this, the tablet PC, it can really nothing but on internal only storage. For example, I'm using this tutorial for audio spectrum (see http://www.youtube.com/watch?v=5cN1VzZXcdo) that involves copying from internal to external in order to detect frequency. It works on the desktop but not on the Android device (Tablets only [i.e. Google Nexus Tablet]). Is there a way to optimize save/load game problems due to internal/external device issues? Plus, additionally, what's the reason why my device won't work on tablets, except the desktop, while testing the audio spectrum code and why? Also, is it the same with saving/loading game?

    Read the article

  • Speeding up procedural texture generation

    - by FalconNL
    Recently I've begun working on a game that takes place in a procedurally generated solar system. After a bit of a learning curve (having neither worked with Scala, OpenGL 2 ES or Libgdx before), I have a basic tech demo going where you spin around a single procedurally textured planet: The problem I'm running into is the performance of the texture generation. A quick overview of what I'm doing: a planet is a cube that has been deformed to a sphere. To each side, a n x n (e.g. 256 x 256) texture is applied, which are bundled in one 8n x n texture that is sent to the fragment shader. The last two spaces are not used, they're only there to make sure the width is a power of 2. The texture is currently generated on the CPU, using the updated 2012 version of the simplex noise algorithm linked to in the paper 'Simplex noise demystified'. The scene I'm using to test the algorithm contains two spheres: the planet and the background. Both use a greyscale texture consisting of six octaves of 3D simplex noise, so for example if we choose 128x128 as the texture size there are 128 x 128 x 6 x 2 x 6 = about 1.2 million calls to the noise function. The closest you will get to the planet is about what's shown in the screenshot and since the game's target resolution is 1280x720 that means I'd prefer to use 512x512 textures. Combine that with the fact the actual textures will of course be more complicated than basic noise (There will be a day and night texture, blended in the fragment shader based on sunlight, and a specular mask. I need noise for continents, terrain color variation, clouds, city lights, etc.) and we're looking at something like 512 x 512 x 6 x 3 x 15 = 70 million noise calls for the planet alone. In the final game, there will be activities when traveling between planets, so a wait of 5 or 10 seconds, possibly 20, would be acceptable since I can calculate the texture in the background while traveling, though obviously the faster the better. Getting back to our test scene, performance on my PC isn't too terrible, though still too slow considering the final result is going to be about 60 times worse: 128x128 : 0.1s 256x256 : 0.4s 512x512 : 1.7s This is after I moved all performance-critical code to Java, since trying to do so in Scala was a lot worse. Running this on my phone (a Samsung Galaxy S3), however, produces a more problematic result: 128x128 : 2s 256x256 : 7s 512x512 : 29s Already far too long, and that's not even factoring in the fact that it'll be minutes instead of seconds in the final version. Clearly something needs to be done. Personally, I see a few potential avenues, though I'm not particularly keen on any of them yet: Don't precalculate the textures, but let the fragment shader calculate everything. Probably not feasible, because at one point I had the background as a fullscreen quad with a pixel shader and I got about 1 fps on my phone. Use the GPU to render the texture once, store it and use the stored texture from then on. Upside: might be faster than doing it on the CPU since the GPU is supposed to be faster at floating point calculations. Downside: effects that cannot (easily) be expressed as functions of simplex noise (e.g. gas planet vortices, moon craters, etc.) are a lot more difficult to code in GLSL than in Scala/Java. Calculate a large amount of noise textures and ship them with the application. I'd like to avoid this if at all possible. Lower the resolution. Buys me a 4x performance gain, which isn't really enough plus I lose a lot of quality. Find a faster noise algorithm. If anyone has one I'm all ears, but simplex is already supposed to be faster than perlin. Adopt a pixel art style, allowing for lower resolution textures and fewer noise octaves. While I originally envisioned the game in this style, I've come to prefer the realistic approach. I'm doing something wrong and the performance should already be one or two orders of magnitude better. If this is the case, please let me know. If anyone has any suggestions, tips, workarounds, or other comments regarding this problem I'd love to hear them.

    Read the article

  • Calculate an AABB for bone animated model

    - by Byte56
    I have a model that has its initial bounding box calculated by finding the maximum and minimum on the x, y and z axes. Producing a correct result like so: The vertices are then stored in a VBO and only altered with matrices for rotation and bone animation. Currently the bounds are not updated when the model is altered. So the animated and rotated model has bounds like so: (Maybe it's hard to tell, but the bounds are the same as before, and don't accurately represent the rotated/animated model) So my question is, how can I calculate the bounding box using the armature matrices and rotation/translation matrices for each model? Keep in mind the modified vertex data is not available because those calculations are performed on the GPU in the shader. The end result I want is to have an accurate AABB the represents the animated model for picking/basic collision checks.

    Read the article

  • XNA 4.0, Combining model draw calls

    - by MayContainNuts
    I have the following problem: The levels in my game are made up of a Large Quantity of small Models and because of that I am experiencing frame rate problems. I already did some research and came to the conclusion that the amount of draw calls I am making must be the root of my problems. I've looked around for a while now and couldn't quite find a satisfying solution. I can't cull any of those models, in a worst case scenario there could be 1000 of them visible at the same time. I also looked at Hardware geometry Instancing, but I don't think that's quite what I'm looking for, because the level consists of a lot of different parts. So, what I'd like to do is combining 100 or 200 of these Models into a single large one and draw it as a whole 'chunk'. The whole geometry is static so it wouldn't have to be changed after combining, but different parts of it would have to use different textures (I think I can accomplish that with a texture atlas). But I have no idea how to to that, so does anybody have any suggestions?

    Read the article

  • Multiple Audio listeners in Scene

    - by Kevin Jensen Petersen
    THIS IS UNITY Im trying to make a FPS game over networking, it works fine. But now, when im trying to implement sound, it won't work. My guess would be, to add a Audio listener to the prefab, that gets instansiated whenever a player connects to the server, however the problem about this is that each player's audiolistener have been switched out which the other player(s), so the AudioSource won't play at the player, but at someone else in the game. Any suggestions ?

    Read the article

  • how do i use a .dat file as a model for an entity in minecraft?

    - by user1835502
    the entity does not have to do anything, just stand there like a statue, or it doesn't have to be an entity at all, just so the .dat file renders in minecraft i saw this http://pastebin.com/jP4diLJ9 in a java file that came with a .exe, and in the .exe you can choose one of the .dat files and it will show you it as a model, i also asked on minecraft forums and someone said it was possible but i have no idea how maybe has something to do with this try { FileOutputStream fileoutputstream = new FileOutputStream("./Models/"+id+".dat"); fileoutputstream.write(b, 0, b.length); fileoutputstream.close(); } catch(Throwable _ex) {} or if(i 0) {//grabs all models System.out.println("Sending request for Model: "+i); addRequest( 7, i); byte b[] = pack.unpack(download().buffer); if(pack.unpacked) { savemodel(i,b); System.out.println("Model Saved"); }else{ System.out.println("Model Grabbing Complete"); break;

    Read the article

  • How to add javascript to YII correctly?

    - by RD.
    I want to create several javascript function that will be needed on different pages. Most will be relevant only to one page, but some to several. I know if I add general conversion functions, it would be a good idea to just create a new javascript file and put all these generic functions into that one file. Bringing me to my first question: Where would you store the generic javascript file? In "protected"? Which subfolder? Then, I need to address the placement of other javascript code. If I have javascript that will only be used on one page, should I use this technique or should I stick to a similar approach as above? The emphasis is on doing it correctly. I want to fall exactly in line with the yii framework.

    Read the article

  • Error in datatype (nvarchar instead of ntext)

    - by prabu R
    I am importing data from excel(.xls) to SQL Server 2008 using SSIS. I have included IMEX=1 in the connection string of excel connection manager. But a column consists of a value as below: 4-Hour Engineer Dispatch ASPP Engr Dispatch 1: Up to 1 dispatch (8 hours) per year. Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min Engr Dispatch: 8-hrs to arrive on-site from Ciena's determination of need On-Site Engineer Dispatch - 8 Hour ASPP Engr Dispatch 8: Up to 8 dispatch (64 hours) per year. Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min Engr Dispatch: NBD to dispatch from Ciena's determination of need Per Incident On Site Support ASPP Engr Dispatch 12: Up to 12 dispatch (96 hours) per year. Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min Engr Dispatch: Next day to arrive on-site from Ciena's determination of need Resident Engineer Engr Dispatch: 2-hrs to arrive on-site from Ciena's determination of need Engr Dispatch: 4-hrs to arrive on-site from Ciena's determination of need ASPP Engr Dispatch 2: Up to 2 dispatch (16 hours) per year. Hours exceeding allocation billed @ 1.5x hourly rate w/ 8-hr min N Actually there are about 600 rows in that excel file. But the above mentioned value is present after 450 rows only. So, the datatype of that column is taken as nvarchar(255) as default instead of ntext and so i am getting error. Anybody please help out... Thanks in advance...

    Read the article

  • Queue Data structure app crash with front() method

    - by Programer
    I am implementing queue data strcutre but my app gets crashed, I know I am doing something wrong with Node pointer front or front() method of queue class #include <iostream> using namespace std; class Node { public: int get() { return object; }; void set(int object) { this->object = object; }; Node * getNext() { return nextNode; }; void setNext(Node * nextNode) { this->nextNode = nextNode; }; private: int object; Node * nextNode; }; class queue{ private: Node *rear; Node *front; public: int dequeue() { int x = front->get(); Node* p = front; front = front->getNext(); delete p; return x; } void enqueue(int x) { Node* newNode = new Node(); newNode->set(x); newNode->setNext(NULL); rear->setNext(newNode); rear = newNode; } int Front() { return front->get(); } int isEmpty() { return ( front == NULL ); } }; main() { queue q; q.enqueue(2); cout<<q.Front(); system("pause"); }

    Read the article

  • custom helpers inside each block

    - by Unspecified
    myArray = [{name: "name1", age: 20}, {name: "name2", age:22}]; {{#each person in myArray}} {{#myHelper person}} Do something {{/myHelper}} {{/each}} Handlebars.registerHelper(function(context, options){ if(context.age > 18){ return options.fn(this); }else{ return options.inverse(this); } }) In the above code when I tried to debug my custom helper it shows the context="person" while I want the context to be the person object, what's wrong with my code ? I found a similar question here but did not get it either...

    Read the article

  • C++ adding friend to a template class in order to typecast

    - by user1835359
    I'm currently reading "Effective C++" and there is a chapter that contains code similiar to this: template <typename T> class Num { public: Num(int n) { ... } }; template <typename T> Num<T> operator*(const Num<T>& lhs, const Num<T>& rhs) { ... } Num<int> n = 5 * Num<int>(10); The book says that this won't work (and indeed it doesn't) because you can't expect the compiler to use implicit typecasting to specialize a template. As a soluting it is suggested to use the "friend" syntax to define the function inside the class. //It works template <typename T> class Num { public: Num(int n) { ... } friend Num operator*(const Num& lhs, const Num& rhs) { ... } }; Num<int> n = 5 * Num<int>(10); And the book suggests to use this friend-declaration thing whenever I need implicit conversion to a template class type. And it all seems to make sense. But why can't I get the same example working with a common function, not an operator? template <typename T> class Num { public: Num(int n) { ... } friend void doFoo(const Num& lhs) { ... } }; doFoo(5); This time the compiler complaints that he can't find any 'doFoo' at all. And if i declare the doFoo outside the class, i get the reasonable mismatched types error. Seems like the "friend ..." part is just being ignored. So is there a problem with my understanding? What is the difference between a function and an operator in this case?

    Read the article

  • How can I add a header folder to my project?

    - by VansFannel
    I'm developing an iOS application with latest Xcode 4.5.2. I have the following folder structure: /.../SourceCode/MyProjectFolder/projectName.xcodeproject /.../SourceCode/MyProjectFolder/projectName/ /.../SourceCode/MyProjectFolder/projectName/xxx.m /.../SourceCode/MyProjectFolder/projectName/xxx.h /.../SourceCode/MyProjectFolder/projectName/PVRT/ /.../SourceCode/MyProjectFolder/projectName/PVRT/header1.h /.../SourceCode/MyProjectFolder/projectName/PVRT/OtherFolder/header2.h If in my header files I add this: #include "header1.h" I get a "header1.h" not found error. But, if I add: #include "PVRT/header1.h" I get a "header2.h" not found. On project settings I have add the following path: ${SOURCE_ROOT}/projectName/PVRT But I'm getting the same error. How can I fix this?

    Read the article

  • Adding ivars to NSManagedObject subclass

    - by The Crazy Chimp
    When I create an entity using core data then generate a subclass of NSManagedObject from it I get the following output (in the .h): @class Foo; @interface Foo : NSManagedObject @property (nonatomic, retain) NSString *name; @property (nonatomic, retain) NSSet *otherValues; @end However, in my .m file I want to make use of the name and otherValues values. Normally I would simply create a couple of ivars and then add the properties for them as I required. That way I can access them in my .m file easily. In this situation would it be acceptable to do this? Would adding ivars to the .h (for name and otherValues) cause any unusual behaviour in the persistance & retrieval of objects?

    Read the article

  • Passing variable from main to Async class

    - by Bigflow
    Somehow, I can't get this done. This is all what I tried till now: Main: private String myState; public String getState() { return myState; } public void setState(String s) { myState = s; } Async: Main appState = ((Main)getApplicationContext()); String state = appState.getState(); Error: No enclosing instance of the type Main is accessible in scope Tried with Helper(Globals) class. public class Globals extends Application{ private String test= "1"; } Main: private Globals mGlobals; mGlobals = new Globals(); mGlobals.test = "2"; //Do Async thing Async: private Globals mGlobals; mGlobals = new Globals(); print mGlobals.test; // (result is 1, should be 2) Also something else, but don't remember good. Tried alot of things (backspace and del buttons are over-used :p ) But I can't get everything working. Async class doesn't have an activity. Code pasted: http://pastebin.com/ikcsdL1p

    Read the article

  • javascript to reference input IDs in php loop and pass values back to same input ID

    - by Smudger
    I have a form which is essentially an autocomplete input box. I can get this to work perfectly for a single text box. What I need to do is create unique input boxes by using a php for loop. This will use the counter $i to give each input box a unique name and id. The problem is that the unique value of the input box needs to be passed to the javascript. this will then pass the inputted data to the external php page and return the mysql results. As mentioned I have this working for a single input box but need assistance with passing the correct values to the javascript and returning it to correct input box. existing code for working solution (first row works only, all other rows update first row input box) <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { $.post("autocompleteperson.php", {queryString: ""+inputString+""}, function(data){ if(data.length >0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } // lookup function fill(thisValue) { $('#inputString').val(thisValue); setTimeout("$('#suggestions').hide();", 200); } </script> </head> <body> <form name="form1" id="form1" action="addepartment.php" method="post"> <table> <? for ( $i = 1; $i <=10; $i++ ) { ?> <tr> <td> <? echo $i; ?></td> <td> <div> <input type="text" size="30" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" /> </div> <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="upArrow.png" style="position: relative; top: -12px; left: 20px;" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList"> &nbsp; </div> </div> </td> </tr> <? } ?> </table> </body> </html> code for autocompleteperson.php is: $query = $db->query("SELECT fullname FROM Persons WHERE fullname LIKE '$queryString%' LIMIT 10"); if($query) { while ($result = $query ->fetch_object()) { echo '<li onClick="fill(\''.$result->fullname.'\');">'.$result->fullname.'</li>'; } } in order to get it to work for all rows, I include the counter $i in each of the file names as below: <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function lookup(inputString<? echo $i; ?>) { if(inputString<? echo $i; ?>.length == 0) { // Hide the suggestion box. $('#suggestions<? echo $i; ?>').hide(); } else { $.post("autocompleteperson.php", {queryString: ""+inputString<? echo $i; ?>+""}, function(data){ if(data.length >0) { $('#suggestions<? echo $i; ?>').show(); $('#autoSuggestionsList<? echo $i; ?>').html(data); } }); } } // lookup function fill(thisValue) { $('#inputString<? echo $i; ?>').val(thisValue); setTimeout("$('#suggestions<? echo $i; ?>').hide();", 200); } </script> </head> <body> <form name="form1" id="form1" action="addepartment.php" method="post"> <table> <? for ( $i = 1; $i <=10; $i++ ) { ?> <tr> <td> <? echo $i; ?></td> <td> <div> <input type="text" size="30" value="" id="inputString<? echo $i; ?>" onkeyup="lookup(this.value);" onblur="fill();" /> </div> <div class="suggestionsBox" id="suggestions<? echo $i; ?>" style="display: none;"> <img src="upArrow.png" style="position: relative; top: -12px; left: 20px;" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList<? echo $i; ?>"> &nbsp; </div> </div> </td> </tr> <? } ?> </table> </body> </html> The autocomplete suggestion works (although always shown on first row) but when selecting the data always returns to row 1, even if input was on row 5. I have a feeling this has to do with the fill() but not sure? is it due the the autocomplete page code? or does the fill referencing ThisValue have something to do with it. example of this page (as above) can be found here Thanks for the assistance, much appreciated. UPDATE - LOLO <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function lookup(i, inputString) { if(inputValue.length == 0) { // Hide the suggestion box. $('#suggestions' + i).hide(); } else { $.post("autocompleteperson.php", {queryString: ""+inputString+""}, function(data){ if(data.length >0) { $('#suggestions' + i).show(); $('#autoSuggestionsList' + i).html(data); } }); } } // lookup function fill(i, thisValue) { $('#inputString' + i).val(thisValue); setTimeout("$('#suggestions' + i).hide();", 200); } </script> </head> <body> <form name="form1" id="form1" action="addepartment.php" method="post"> <table> <? for ( $i = 1; $i <=10; $i++ ) { ?> <tr> <td> <? echo $i; ?></td> <td> <div> <input type="text" size="30" value="" id="inputString<?php echo $i; ?>" onkeyup="lookup(this.value);" onblur="fill();" /> </div> <div class="suggestionsBox" id="suggestions<? echo $i; ?>" style="display: none;"> <img src="upArrow.png" style="position: relative; top: -12px; left: 20px;" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList<? echo $i; ?>"> &nbsp; </div> </div> </td> </tr> <? } ?> </table> </body> </html> google chrome catched the following errors: first line on input, second line on loosing focus

    Read the article

  • determine page UI culture throgh javascript

    - by mj-y
    I have two div tags in my html code as shown below. I want to change their float property depending on page UI culture ( Ui culture is en-US or fa-IR) ... I think I can use java script to do so. but I don't know how can I get the UI Culture through Javascript. I want a code in if condition to determine the Ui culture ... thx in advance for your help... <div id="zone1" style="float: left;"><img alt="" src="~/IconArrow.png" /> &nbsp;</div> <div id="zone2" style="float: left;"><img alt="" src="~/IconHome.png" /></div> <script type="text/javascript"> if(/* ui culture is fa-IR*/) { document.getElementById("zone1").style.float = "right"; document.getElementById("zone2").style.float = "right"; } </script>

    Read the article

  • Using Rails and Rspec, how do you test that the database is not touched by a method

    - by Will Tomlins
    So I'm writing a test for a method which for performance reasons should achieve what it needs to achieve without using SQL queries. I'm thinking all I need to know is what to stub: describe SomeModel do describe 'a_getter_method' do it 'should not touch the database' do thing = SomeModel.create something_inside_rails.should_not_receive(:a_method_querying_the_database) thing.a_getter_method end end end EDIT: to provide a more specific example: class Publication << ActiveRecord::Base end class Book << Publication end class Magazine << Publication end class Student << ActiveRecord::Base has_many :publications def publications_of_type(type) #this is the method I am trying to test. #The test should show that when I do the following, the database is queried. self.publications.find_all_by_type(type) end end describe Student do describe "publications_of_type" do it 'should not touch the database' do Student.create() student = Student.first(:include => :publications) #the publications relationship is already loaded, so no need to touch the DB lambda { student.publications_of_type(:magazine) }.should_not touch_the_database end end end So the test should fail in this example, because the rails 'find_all_by' method relies on SQL.

    Read the article

  • Listening UDP or switch to TCP in a MFC application

    - by Alexander.S
    I'm editing a legacy MFC application, and I have to add some basic network functionalities. The operating side has to receive a simple instruction (numbers 1,2,3,4...) and do something based on that. The clients wants the latency to be as fast as possible, so naturally I decided to use datagrams (UDP). But reading all sorts of resources left me bugged. I cannot listen to UDP sockets (CAsyncSocket) in MFC, it's only possible to call Receive which blocks and waits. Blocking the UI isn't really a smart. So I guess I could use some threading technique, but since I'm not all that experienced with MFC how should that be implemented? The other part of the question is should I do this, or revert to TCP, considering reliability and implementation issues. I know that UDP is unreliable, but just how unreliable is it really? I read that it is up to 50% faster, which is a lot for me. References I used: http://msdn.microsoft.com/en-us/library/09dd1ycd(v=vs.80).aspx

    Read the article

  • jqplot format tooltip values

    - by Jeroen
    I want to have a tooltip hover highlight thingy in jqplot. The problem is that I want it to give more detail then on the axes. So the formatter should be different. I can't get it to display the seconds to: There's a JS fidle here! I want the timestamp to display as hours:minutes:seconds, which would be format string '%H:%M:%S' or '%T' or '%X'. But how do I do that? highlighter: { show: true, sizeAdjust: 3, //useAxesFormatters: false, //tooltipFormatString: '%H:%M:%S', formatString: '<table class="jqplot-highlighter"><tr><td>tijd:</td><td>%s</td></tr><tr><td>snelheid:</td><td>%s</td></tr></table>', },

    Read the article

  • Dynamic procmail filters

    - by WombaT
    i need procmail to place incoming mail into specific folder depending on some set of rules. I know how i can accomplish this, but i need to write static set of rules in a specific file. What i really need is to configure procmail to use rules stored in mysql database. How i can do this? I've read a bit about that and one solution i found is to pipe message to a php/perl script and return a folder name to place message. But i have completely no i idea how to use php script as a rule and then use its return value.

    Read the article

  • Lot of FIN_WAIT2, CLOSE_WAIT , LAST_ACK and TIME_WAIT in Haproxy

    - by Tux
    We are running haproxy in production for around 10k+ concurrent users . But we are seeing lot of FIN_WAIT2, CLOSE_WAIT , LAST_ACK and TIME_WAIT in the netstat output. This output is on a 8G ubuntu-12.04 node. 8046 CLOSE_WAIT 1 CLOSING 1 established) 40869 ESTABLISHED 1212 FIN_WAIT1 7575 FIN_WAIT2 1 Foreign 2252 LAST_ACK 7 LISTEN 143 SYN_RECV 4920 TIME_WAIT Can someone please tell me what tweaking i need to do. Please note that all these connections are persistent connections . tcp_fin_timeout = 30 tcp_keepalive_time = 1800 Right now, the application is working fine. But wondering will be there any issues as we add more users to this haproxy node.

    Read the article

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