Daily Archives

Articles indexed Friday May 30 2014

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

  • Do I have to worry about "error: superfluous RAID member"?

    - by 0xC0000022L
    When running update-grub on the newly installed Ubuntu 12.04 with an older software RAID (md), I get: error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). Generating grub.cfg ... error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). Found linux image: /boot/vmlinuz-3.2.0-24-generic Found initrd image: /boot/initrd.img-3.2.0-24-generic error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). Found linux image: /boot/vmlinuz-3.2.0-23-generic Found initrd image: /boot/initrd.img-3.2.0-23-generic error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). Found memtest86+ image: /boot/memtest86+.bin error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). error: superfluous RAID member (5 found). Found Debian GNU/Linux (5.0.9) on /dev/sdb1 Found Debian GNU/Linux (5.0.9) on /dev/sdc1 done I would be less worried if the message would say warning: ..., but since it says error: ... I'm wondering what the problem is. # cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md2 : active raid1 sdc1[1] sdb1[0] 48829440 blocks [2/2] [UU] md3 : active raid1 sdc2[1] sdb2[0] 263739008 blocks [2/2] [UU] md1 : active raid5 sdg1[3] sdf1[2] sde1[1] sdh1[0] sdi1[4] sdd1[5](S) 1250274304 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU] unused devices: <none> Do I have to worry or is this harmless? btw: disregard the mentioning of Debian 5.0.9, that was the previously installed system and is going to be overwritten. It's on /dev/md2 actually.

    Read the article

  • Can I use Ubuntu to write a Windows 7 ISO to USB?

    - by Salim Fadhley
    I need to create a Windows installation USB drive from an ISO file. I used UNetbootin which seems to be the only tool that can write non-Linux images. The USB disk boots (sort of), but it gets stuck at the very first stage. A UNetbootin splash screen appears that keeps counting down from 10 to 0, and then restarts. The screen looks like this: Is there a way to make Windows boot from a USB image created on Linux?

    Read the article

  • How to make read-only file system writable?

    - by Tim
    I am not sure since when the filesystem on my digital audio player has been changed to be read-only. I cannot copy files into it or remove files on it. Are there some possible reasons for the player's file system to change the permission of its file system? I tried chmod: $ sudo chmod a+rw SGTL\ MSCN/ chomd: changing permissions of `SGTL MSCN/': Read-only file system where "SGTL MSCN" is the mounted point of the digital audio player. I was wondering how to make it writable? Thanks and regards!

    Read the article

  • Google Authorship: can I display:none for link to profile?

    - by RubenGeert
    I'd like to have my 'mugshot' in Google's SERPs but I couldn't care less about Google+. I don't really want to link my website to Google+ either. Can I use CSS display:none; on the link leading to my profile and still have authorship, which looks like <a href='https://plus.google.com/111823012258578917399?rel=author' rel='nofollow'>Google</a>? Will the nofollow attribute here spoil things? I don't want to lose 'link juice' on Google+ if I don't have to. Now Google should crawl only the HTML but I'm sure they'll figure out the link is not visible (perhaps it's technically even cloaking. Does anybody have experience with this situation? And do I really have to become (reasonably) active on Google+ in order for authorship to show? This answer suggests I do but I didn't read anything on that in Google's guidelines.

    Read the article

  • What happens when you close an Adsense account?

    - by rakibtg
    I need to change my payee name, I have asked in Google Adsense product forum one of top contributor replied me: "You will have to close the account & apply again with using your real payee name. That's why they specifically state that the payee name needs to match the full name on your bank account." https://support.google.com/adsense/answer/47333?hl=en This makes sense, but got few question because the support page do not have sufficient content to help me. My questions are: What happens when you close your Adsense account? If I apply again, then what will be the process to re-gain my account? I mean should I have to apply for a website again, then Adsense team will review and approve that? Is there any chance to disapprove my account? What about current check? I have two check in my hand. So, is Google will send those check again to me with my new payee name? Anyone experienced this problem? I have asked it on Google Forum but got no answer!

    Read the article

  • Most efficient AABB - Ray intersection algorithm for input/output distance calculation

    - by Tobbey
    Thanks to the following thread : most efficient AABB vs Ray collision algorithms I have seen very fast algorithm for ray/AABB intersection point computation. Unfortunately, most of the recent algorithm are accelerated by omitting the "output" intersection point of the box. In my application, I would interested in getting both the the distance from source ray to input: t0 and source ray to output of bounding box: t1. I have seen for instance Eisemann designed a very fast version regarding plucker, smits, ... , but it does not compare the case when both input/output distance should be computed see: http://www.cg.cs.tu-bs.de/publications/Eisemann07FRA/ Does someone know where I can find more information on algorithm performances for the specific input/output problem ? Thank you in advance

    Read the article

  • Pixel alignment algorithm

    - by user42325
    I have a set of square blocks, I want to draw them in a window. I am sure the coordinates calculation is correct. But on the screen, some squares' edge overlap with other, some are not. I remember the problem is caused by accuracy of pixels. I remember there's a specific topic related to this kind of problem in 2D image rendering. But I don't remember what exactly it is, and how to solve it. Look at this screenshot. Each block should have a fixed width margin. But in the image, the vertical white line have different width.Though, the horizontal lines looks fine.

    Read the article

  • Issue porting Cocos2d-x to Android

    - by Anil
    I've written a basic game using Cocos2D-x on XCode. It works fine on the iPhone. Now I'm trying to port it to Android. When I run the script ./build_native.sh inside the proj.android folder, it gives me the following error: jni/../../Classes/MemoryModeLayer.cpp: In member function 'void MemoryModeLayer::startNewGame()': jni/../../Classes/MemoryModeLayer.cpp:109:25: error: 'time' is not a member of 'std' jni/../../Classes/MemoryModeLayer.cpp:109:25: note: suggested alternative: /Users/abc/android-ndk-r9d/platforms/android-8/arch-arm/usr/include/time.h:40:17: note: 'time' jni/../../Classes/MemoryModeLayer.cpp:111:5: error: 'random_shuffle' is not a member of 'std' jni/../../Classes/MemoryModeLayer.cpp:112:5: error: 'random_shuffle' is not a member of 'std' make: *** [obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/MemoryModeLayer.o] Error 1 make: Leaving directory `/Users/abc/cocos2d-x-2.2.3/projects/Game/proj.android' In MemoryModeLayer.cpp I have the following: std::srand(unsigned(std::time(0))); std::random_shuffle(_xCod, _xCod + _numberOfRows); std::random_shuffle(_yCod, _yCod + _numberOfColumns); I've included the following headers as well: #include <string> #include <ctime> #include <algorithm> #include <iostream> #include <iomanip> Also added using namespace std in the header file. Is there anything else that I should do?

    Read the article

  • iOS + cocos2d: how to account for sprite's position for the different device dimensions in an universal app?

    - by fuzzlog
    All the questions I've seen regarding iOS universal apps (with or without cocos2d) deal with the "how to add graphics to a universal app". My question is, how does the code need to be written to ensure that the sprites appear appropriately on the screen (given that an iPhone 5's resolution is not proportional to an iPad's resolution)? Is it just a bunch of "if" statements and duplicate code or do iOS/cocos2d provide common function calls that will place the sprites at an appropriate position?

    Read the article

  • Using Bullet physics engine to find the moment of object contact before penetration

    - by MooMoo
    I would like to use Bullet Physics engine to simulate the objects in 3D world. One of the objects in the world will move using the position from 3D mouse control. I will call it "Mouse Object" and any object in the world as "Object A" I define the time before "mouse object" and "Object A" collide as t-1 The time "mouse object" penetrate "Object A" as t Now there is a problem about rendering the scene because when I move the mouse very fast, "Mouse object" will reside in "Object A" before "Object A" start to move. I would like the "Mouse Object" to stop right away attach to the "Object A". Also If the "Object A" move, the "Mouse object" should move following (attach) the "Object A" without stop at the first collision take place. This is what i did I find the position of the "Mouse Object" at time t-1 and time t. I will name it as pos(t-1) and pos(t) The contact time will be sometime between t-1 to t, which the time of contact I name it as t_contact, therefore the contact position (without penetration) between "Mouse object" and "Object A" will be pos(t_contact) then I create multiple "Mouse object"s using this equation pos[n] = pos(t-1) * C * ( pos(t) - pos(t-1) ) where 0 <= C <= 1 if I choose C = 0.1, 0.2, 0.3,0.4..... 1.0, I will get pos[n] for 10 values Then I test collision for all of these 10 "Mouse Objects" and choose the one that seperate between "no collision" and "collision". I feel this method is super non-efficient. I am not sure the way other people find the time-of-contact or the position-of-contact when "Object A" can move.

    Read the article

  • How to set a target as image [on hold]

    - by Zadalaxmi
    How to set a target as image in given code. public void addListenerForImage(final Image roomImage) { final DragAndDrop dragAndDrop = new DragAndDrop(); dragAndDrop.addSource(new DragAndDrop.Source(roomImage) { public DragAndDrop.Payload dragStart (InputEvent event, float x, float y, int pointer) { DragAndDrop.Payload payload = new DragAndDrop.Payload(); payload.setDragActor(roomImage); dragAndDrop.setDragActorPosition(-x, -y + roomImage.getHeight()); return payload; } public void dragStop (InputEvent event, float x, float y, int pointer,Target target) { roomImage.setBounds(50, 125, roomImage.getWidth(), roomImage.getHeight()); if(target != null) { roomImage.setPosition(target.getActor().getX(), target.getActor().getY()); } System.out.println(target); stage.addActor(roomImage); } }); My problem is i can drag the images and i am not able to set target as image; and target shows as null;One more if a invisible some of the images in group how can i test that it is overlapped or not;Please give some links and suggestion

    Read the article

  • Compiling GWT 2.6.1 at Java 7 source level

    - by Neeko
    I've recently updated my GWT project to 2.6.1, and started to make use of Java 7 syntax since 2.6 now supports Java 7. However, when I attempt to compile, I'm receiving compiler errors such as [ERROR] Line 42: '<>' operator is not allowed for source level below 1.7 How do I specify the GWT compiler to target 1.7? I was under the impression that it would do that by default, but I guess not. I've attempted cleaning the project, including deleting the gwt-unitCache directory but to no avail. Here is my Ant compile target. <target name="compile" depends="prepare"> <javac includeantruntime="false" debug="on" debuglevel="lines,vars,source" srcdir="${src.dir}" destdir="${build.dir}"> <classpath refid="project.classpath"/> </javac> </target> <target name="gwt-compile" depends="compile"> <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler"> <classpath> <!-- src dir is added to ensure the module.xml file(s) are on the classpath --> <pathelement location="${src.dir}"/> <pathelement location="${build.dir}"/> <path refid="project.classpath"/> </classpath> <jvmarg value="-Xmx256M"/> <arg value="${gwt.module.name}"/> </java> </target>

    Read the article

  • Unable to Click a row and call javascript function?

    - by user2807977
    I'm unable to trigger $(this).toggleClass('selected'); for content table. When I debug it just skip this event. How can I make sure its being selected? $('#contentChangesTable tr') .filter(':has(:checkbox:checked)') .addClass('selected') .end() .click(function (event) { $(this).toggleClass('selected'); if (event.target.type !== 'checkbox') { $(':checkbox', this).attr('checked', function () { return !this.checked; }); } });

    Read the article

  • R.layout.main error, no solutions have worked

    - by user3404278
    I am just beginning to develop for Android. The tutorial book I am using uses the code below, but, put simply, it does not work. As I've searched for an answer, I find that none of the solutions people say have rid them of this error have worked for me. Here is a list of methods that did not work. -Cleaning: It just said it couldn't clean until I resolved the error. -Building the Project: It built it, but the error did not go away. -Deleting import R: The error did not go away. -Renaming import R to import me.package.R: The error persisted. Here is the code that is generating the error. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } Can anyone help me out?

    Read the article

  • C# Date Time Picker to Text?

    - by user3691826
    Im trying to get a text from a file into date format for a label. What i currently have works great for a DateTimePicker however im wanting to now use a label to display the date rather than a DateTimePicker. This is what currently works when getting the value to a DateTimePicker: dateTimeMFR.Value = this.myKeyVault.MFRDate; and this is what im attempting to make work in a label: DateTimePicker myDate = new DateTimePicker(); myDate.Value = myKeyVault.MFRDate; txtMFR.Text = myDate.Text; Thanks for any help on the matter.

    Read the article

  • Unrecognized libraries and functions

    - by John Smith
    I am working in Eclipse 3.7.2 on Ubuntu 12.04 with C++. I have read about a few instances where libraries were not being recognized and the majority said to update the Paths and Symbols but that hasn't fixed my issue. I have 2 projects open in my workspace, one of which is already a completed project that has implemented functions and libraries with no errors from Eclipse. However, when I try to implement some of the same functions or include the same libraries in the 2nd project Eclipse can't resolve them. For example, #include <string> #include <stdio.h> strstr(p, "<Project>"); The include statement will be accepted and stdio.h will be found but the strstr function is not resolved even though it works fine in the other project. Any ideas as to why this might be happening? Thanks.

    Read the article

  • Cordova - Scrolling with a fixed header and footer (ios)

    - by Samu Singh
    Using Cordova (phonegap) & bootstrap to make a mobile application, testing on IOS for now. Getting an issue with a header and footer bar that are fixed with scrollable content in the middle. When tapping to scroll, the header/footer bar moves down or up with the content but then snaps back to place as soon as the scrolling completes. If I use -webkit-overflow-scrolling: touch; it works as expected, but it makes it really awkward to scroll through the content, and if you scroll passed the end, it only scrolls the header or footer (with elastic overflow) until you stop for a second. here's my html for the header/footer bars: <div id="headerBar"> <div class="container-fluid" style="background-color: #1569C7"> <div class="row"> <div class="col-xs-3 text-left"> <button id="logoutButton" type="button" class="btn btn-default"> Log Out </button> <button type="button" class="btn btn-default" id="restoreQuestionFeedButton"> <span class="glyphicon glyphicon-chevron-left"></span> </button> </div> <div class="col-xs-6 text-center" style="height: 55px"> <strong id="usernameText"></strong> </div> <div class="col-xs-3 text-right"> <button id="oldCreatQuestionButton" type="button" class="btn btn-default"> <span class="glyphicon glyphicon-plus"></span> </button> </div> </div> </div> </div> <div id="footerBar"> <div class="container-fluid" style="padding: 0"> <div class="row text-center"> <button id="createQuestionButton" type="button" class="btn btn-default footerButton"> <span class="glyphicon glyphicon-plus"></span> <strong>Ask a new free question!</strong> </button> </div> </div> </div> And here is the related CSS: #headerBar { position: fixed; z-index: 100; top: 0; left: 0; width: 100%; background-color: #1569C7; } #footerBar { position: fixed; z-index: 100; bottom: 0; left: 0; width: 100%; background-color: #1569C7 !important; }

    Read the article

  • LWJGL Circle program create's an oval-like shape

    - by N1ghtk1n9
    I'm trying to draw a circle in LWJGL, but when I draw I try to draw it, it makes a shape that's more like an oval rather than a circle. Also, when I change my circleVertexCount 350+, the shape like flips out. I'm really not sure how the code works that creates the vertices(I have taken Geometry and I know the basic trig ratios). I haven't really found that good of tutorials on creating circles. Here's my code: public class Circles { // Setup variables private int WIDTH = 800; private int HEIGHT = 600; private String title = "Circle"; private float fXOffset; private int vbo = 0; private int vao = 0; int circleVertexCount = 300; float[] vertexData = new float[(circleVertexCount + 1) * 4]; public Circles() { setupOpenGL(); setupQuad(); while (!Display.isCloseRequested()) { loop(); adjustVertexData(); Display.update(); Display.sync(60); } Display.destroy(); } public void setupOpenGL() { try { Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT)); Display.setTitle(title); Display.create(); } catch (LWJGLException e) { e.printStackTrace(); System.exit(-1); } glClearColor(0.0f, 0.0f, 0.0f, 0.0f); } public void setupQuad() { float r = 0.1f; float x; float y; float offSetX = 0f; float offSetY = 0f; double theta = 2.0 * Math.PI; vertexData[0] = (float) Math.sin(theta / circleVertexCount) * r + offSetX; vertexData[1] = (float) Math.cos(theta / circleVertexCount) * r + offSetY; for (int i = 2; i < 400; i += 2) { double angle = theta * i / circleVertexCount; x = (float) Math.cos(angle) * r; vertexData[i] = x + offSetX; } for (int i = 3; i < 404; i += 2) { double angle = Math.PI * 2 * i / circleVertexCount; y = (float) Math.sin(angle) * r; vertexData[i] = y + offSetY; } FloatBuffer vertexBuffer = BufferUtils.createFloatBuffer(vertexData.length); vertexBuffer.put(vertexData); vertexBuffer.flip(); vao = glGenVertexArrays(); glBindVertexArray(vao); vbo = glGenBuffers(); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER,vertexBuffer, GL_STATIC_DRAW); glVertexAttribPointer(0, 2, GL_FLOAT, false, 0, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); } public void loop() { glClear(GL_COLOR_BUFFER_BIT); glBindVertexArray(vao); glEnableVertexAttribArray(0); glDrawArrays(GL_TRIANGLE_FAN, 0, vertexData.length / 2); glDisableVertexAttribArray(0); glBindVertexArray(0); } public static void main(String[] args) { new Circles(); } private void adjustVertexData() { float newData[] = new float[vertexData.length]; System.arraycopy(vertexData, 0, newData, 0, vertexData.length); if(Keyboard.isKeyDown(Keyboard.KEY_W)) { fXOffset += 0.05f; } else if(Keyboard.isKeyDown(Keyboard.KEY_S)) { fXOffset -= 0.05f; } for(int i = 0; i < vertexData.length; i += 2) { newData[i] += fXOffset; } FloatBuffer newDataBuffer = BufferUtils.createFloatBuffer(newData.length); newDataBuffer.put(newData); newDataBuffer.flip(); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferSubData(GL_ARRAY_BUFFER, 0, newDataBuffer); glBindBuffer(GL_ARRAY_BUFFER, 0); } } 300 Vertex Count(This is my main problem) 400 Vertex Count - I removed this image, it's bugged out, should be a tiny sliver cut out from the right, like a secant 500 Vertex Count Each 100, it removes more and more of the circle, and so on.

    Read the article

  • iOS dynamic object creation

    - by Abdul Ahmad
    I've worked with Xcode and iOS on a few personal projects and have always used non-object-oriented designs for everything... just because I've been doing mostly learning/experimenting with things. Now I've been trying to implement some object oriented design into one game I've made previously. The idea is, I have a space ship that can shoot bullets. In the past I basically added the UIImageView to the storyboard and then connected it to the .h file and from there did things on it like move it around or whatever (using CGPointMake). The idea now is to make a method (and a whole other class soon) that will create a UIImageView programmatically, allocate it, add it to the superview etc... I've got this working so far, easy stuff, but the next part is a bit harder. Where do I store this local variable "bullet"? I've been saving it to an NSMutableArray and doing the following: (actually here are the methods that I have) -(void)movement { for (int i = 0; i < [array1 count]; i ++) { UIImageView *a = [array1 objectAtIndex:i]; a.center = CGPointMake(a.center.x + 2, a.center.y); if (a.center.x > 500) { [array1 removeObjectAtIndex:i]; [a removeFromSuperview]; } } } -(void)getBullet { UIImageView *bullet = [[UIImageView alloc] initWithFrame:CGRectMake(ship.center.x + 20, ship.center.y - 2, 15, 3)]; bullet.image = [UIImage imageNamed:@"bullet2.png"]; bullet.hidden = NO; [self.view addSubview:bullet]; [array1 addObject:bullet]; } (by the way, array1 is declared in the .h file) and theres a timer that controls the movement method timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(movement) userInfo:nil repeats:YES]; first question is: what is the correct way of doing this? Storing a bullet for example until it is removed from the superview, should I store it another way? and another question is, when I remove a UIImageView from the superview, does that remove it from memory so its not using up system resources? Thank you for the help! (will update if I Think of other questions

    Read the article

  • Regular expression for pipe delimited and double quoted string

    - by Hiren Amin
    I have a string something like this: "2014-01-23 09:13:45|\"10002112|TR0859657|25-DEC-2013>0000000000000001\"|10002112" I would like to split by pipe apart from anything wrapped in double quotes so I have something like (similar to how csv is done): [0] => 2014-01-23 09:13:45 [1] => 10002112|TR0859657|25-DEC-2013>0000000000000001 [2] => 10002112 I would like to know if there is a regular expression that can do this?

    Read the article

  • Animate opacity and delay transition CSS

    - by user1876246
    I have a series of DIVS, I want DIV 1 & DIV 3 to fade out and then DIV 2 and DIV 4 to slide left to take their place, 1 second after the fade. So far I have gotten them to fade out but I cannot figure out how to delay the sliding. Follows is my CSS, ignore the lack of vendor prefixes for this question please. .slide-show{ -webkit-animation: fadeShow 0.25s 1 normal forwards ease-out; animation: fadeShow 0.25s 1 normal forwards ease-out; visibility: visible; } .slide-hide{ -webkit-animation: fadeHide 0.25s 1 normal forwards ease-out; animation: fadeHide 0.25s 1 normal forwards ease-out; //I need the following to be delayed for 1 second visibility: hidden; position: absolute; } @keyframes fadeHide{ 0% { opacity: 1; } 100% { opacity: 0; } } @keyframes fadeShow{ 0% { opacity: 0; } 100% { opacity: 1; } }

    Read the article

  • Mysql 100% CPU + Slow query

    - by felipeclopes
    I'm using the RDS database from amazon with a some very big tables, and yesterday I started to face 100% CPU utilisation on the server and a bunch of slow query logs that were not happening before. I tried to check the queries that were running and faced this result from the explain command +----+-------------+-------------------------------+--------+----------------------------------------------------------------------------------------------+---------------------------------------+---------+-----------------------------------------------------------------+------+----------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------------------------------+--------+----------------------------------------------------------------------------------------------+---------------------------------------+---------+-----------------------------------------------------------------+------+----------------------------------------------+ | 1 | SIMPLE | businesses | const | PRIMARY | PRIMARY | 4 | const | 1 | Using index; Using temporary; Using filesort | | 1 | SIMPLE | activities_businesses | ref | PRIMARY,index_activities_users_on_business_id,index_tweets_users_on_tweet_id_and_business_id | index_activities_users_on_business_id | 9 | const | 2252 | Using index condition; Using where | | 1 | SIMPLE | activities_b_taggings_975e9c4 | ref | taggings_idx | taggings_idx | 782 | const,myapp_production.activities_businesses.id,const | 1 | Using index condition; Using where | | 1 | SIMPLE | activities | eq_ref | PRIMARY,index_activities_on_created_at | PRIMARY | 8 | myapp_production.activities_businesses.activity_id | 1 | Using where | +----+-------------+-------------------------------+--------+----------------------------------------------------------------------------------------------+---------------------------------------+---------+-----------------------------------------------------------------+------+----------------------------------------------+ Also checkin in the process list, I got something like this: +----+-----------------+-------------------------------------+----------------------------+---------+------+--------------+------------------------------------------------------------------------------------------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-------------------------------------+----------------------------+---------+------+--------------+------------------------------------------------------------------------------------------------------+ | 1 | my_app | my_ip:57152 | my_app_production | Sleep | 0 | | NULL | | 2 | my_app | my_ip:57153 | my_app_production | Sleep | 2 | | NULL | | 3 | rdsadmin | localhost:49441 | NULL | Sleep | 9 | | NULL | | 6 | my_app | my_other_ip:47802 | my_app_production | Sleep | 242 | | NULL | | 7 | my_app | my_other_ip:47807 | my_app_production | Query | 231 | Sending data | SELECT my_fields... | | 8 | my_app | my_other_ip:47809 | my_app_production | Query | 231 | Sending data | SELECT my_fields... | | 9 | my_app | my_other_ip:47810 | my_app_production | Query | 231 | Sending data | SELECT my_fields... | | 10 | my_app | my_other_ip:47811 | my_app_production | Query | 231 | Sending data | SELECT my_fields... | | 11 | my_app | my_other_ip:47813 | my_app_production | Query | 231 | Sending data | SELECT my_fields... | ... So based on the numbers, it looks like there is no reason to have a slow query, since the worst execution plan is the one that goes through 2k rows which is not much. Edit 1 Another information that might be useful is the slow query_log SET timestamp=1401457485; SELECT my_query... # User@Host: myapp[myapp] @ ip-10-195-55-233.ec2.internal [IP] Id: 435 # Query_time: 95.830497 Lock_time: 0.000178 Rows_sent: 0 Rows_examined: 1129387 Edit 2 After profiling, I got this result. The result have approximately 250 rows with two columns each. +----------------------+----------+ | state | duration | +----------------------+----------+ | Sending data | 272 | | removing tmp table | 0 | | optimizing | 0 | | Creating sort index | 0 | | init | 0 | | cleaning up | 0 | | executing | 0 | | checking permissions | 0 | | freeing items | 0 | | Creating tmp table | 0 | | query end | 0 | | statistics | 0 | | end | 0 | | System lock | 0 | | Opening tables | 0 | | logging slow query | 0 | | Sorting result | 0 | | starting | 0 | | closing tables | 0 | | preparing | 0 | +----------------------+----------+ Edit 3 Adding query as requested SELECT activities.share_count, activities.created_at FROM `activities_businesses` INNER JOIN `businesses` ON `businesses`.`id` = `activities_businesses`.`business_id` INNER JOIN `activities` ON `activities`.`id` = `activities_businesses`.`activity_id` JOIN taggings activities_b_taggings_975e9c4 ON activities_b_taggings_975e9c4.taggable_id = activities_businesses.id AND activities_b_taggings_975e9c4.taggable_type = 'ActivitiesBusiness' AND activities_b_taggings_975e9c4.tag_id = 104 AND activities_b_taggings_975e9c4.created_at >= '2014-04-30 13:36:44' WHERE ( businesses.id = 1 ) AND ( activities.created_at > '2014-04-30 13:36:44' ) AND ( activities.created_at < '2014-05-30 12:27:03' ) ORDER BY activities.created_at; Edit 4 There may be a chance that the indexes are not being applied due to difference in column type between the taggings and the activities_businesses, on the taggable_id column. mysql> SHOW COLUMNS FROM activities_businesses; +-------------+------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | activity_id | bigint(20) | YES | MUL | NULL | | | business_id | bigint(20) | YES | MUL | NULL | | +-------------+------------+------+-----+---------+----------------+ 3 rows in set (0.01 sec) mysql> SHOW COLUMNS FROM taggings; +---------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | tag_id | int(11) | YES | MUL | NULL | | | taggable_id | bigint(20) | YES | | NULL | | | taggable_type | varchar(255) | YES | | NULL | | | tagger_id | int(11) | YES | | NULL | | | tagger_type | varchar(255) | YES | | NULL | | | context | varchar(128) | YES | | NULL | | | created_at | datetime | YES | | NULL | | +---------------+--------------+------+-----+---------+----------------+ So it is examining way more rows than it shows in the explain query, probably because some indexes are not being applied. Do you guys can help m with that?

    Read the article

  • How to sanitize grape params

    - by Boti
    I want to mass update attributes of an entity. How can I sanitize properly the params which is coming from grape? This is my console log about the parameters: params.except(:route_info, :token, :id) => {"display_number"=>"7"} [18] pry(#<Grape::Endpoint>)> params.permit(:display_number) ArgumentError: wrong number of arguments (2 for 0..1) from /Users/boti/.rvm/gems/ruby-2.0.0-p353@thelocker/gems/hashie-2.0.5/lib/hashie/mash.rb:207:in `default' [19] pry(#<Grape::Endpoint>)> params.sanitize => nil

    Read the article

  • Notes from a short presentation on NodeJs

    - by Aligned
    Originally posted on: http://geekswithblogs.net/Aligned/archive/2014/05/30/notes-from-a-short-presentation-on-nodejs.aspxI volunteered myself to give a short 30 minute presentation at a work lunch and learn on NodeJs. With my limited experience I see using Node as a great tool for build process improvement, scaffolding with yeoman, and running tests with Karma. I haven’t looked into using as a full server or development stack. I guess I’m too stuck on IIS and Visual Studio :-). Here are my notes, that aren’t very well formatted, but I wanted to share it anyways. What is it? "Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices." Why should you be interested? another popular tool that can help you get the job done you can use the command prompt! can be run at build or release time to automate tasks What are some uses? https://www.npmjs.org/ - NuGet for Node packages http://bower.io/ - NuGet for UI JavaScript libraries (jQuery, Bootstrap, Angular, etc) http://yeoman.io/ "Our workflow is comprised of three tools for improving your productivity and satisfaction when building a web app: yo (the scaffolding tool), grunt (the build tool) and bower (for package management)." -> yeoman asks which components you want alternative - http://joakimbeng.eu01.aws.af.cm/slush-replacing-yeoman-with-gulp/ https://www.npmjs.org/package/generator-cg-angular - phantom js, less, // git is needed for bower http://git-scm.com/ run installer in Windows before you can use bower // select Run Git from the Windows Command Prompt in the installer // requires a reboot http://stackoverflow.com/questions/20069297/bower-git-not-in-the-path-error npm install -g git npm install -g yo npm install -g generator-cg-angular mkdir myapp cd myapp yo cg-angular npm install -g bower npm install -g grunt-cli yo bower grunt serve grunt test grunt build // there are many generators (generator-angular) is another one // I like the Nuget HotTowel-Angular from John Papa myself // needed IIS Node for Express -> prompt from WebMatrix Karma bat to startup Karma - see below image compression - https://www.npmjs.org/search?q=optimize+images, https://github.com/heldr/node-smushit - do it from the command line LESS compiling js and css combine and minification at build with Gulp for requireJS apps quick lightweight HTTP server - "Express" Build pipeline with Grunt or Gulp http://www.johnpapa.net/gulp-and-grunt-at-anglebrackets/ Gulp is the newer and improved over Grunt. Supposed to be easier to use, but Grunt is more established. https://github.com/johnpapa/ng-demos/tree/master/grunt-gulp https://github.com/assetgraph/assetgraph-builder Does a lot of the minimizing, combining, image optimization etc using Node. Looks interesting.... http://nodejs.org http://nodeschool.io/ http://sub.watchmecode.net/getting-started-with-nodejs-installing-and-writing-your-first-code/ https://stormpath.com/blog/build-a-killer-node-dot-js-client-for-your-rest-plus-json-api/ https://codio.com/ http://www.hanselman.com/blog/ItsJustASoftwareIssueEdgejsBringsNodeAndNETTogetherOnThreePlatforms.aspx run unit tests - Karma in msBuild karma-start.bat @echo off cd %~dp0\.. REM 604800 is to make sure we only update once every 7 days call npm install --cache-min 604800 -g grunt-cli call npm install --cache-min 604800 call npm install --cache-min 604800 -g karma-cli karma start UnitTests\karma.conf.js REM karma start UnitTests\karma.conf.js --single-run REM see karma-start.bat and karam.config.js REM jsHint comes from Nuget

    Read the article

  • What is a good operating system for relative newbies for setting up a website and source control? [on hold]

    - by Zeroth
    I'm part of a small group of people working on video games. We want to set up our own boxes to serve the website and handle the source control for development work. I have the most technical expertise, but its been a few years since I've set up or played with Linux or other open source operating systems. So I'm a bit out of the loop on what are the user-friendly open source operating systems out there right now?

    Read the article

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