Search Results

Search found 399 results on 16 pages for 'b2'.

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

  • 2D Collision in Canvas - Balls Overlapping When Velocity is High

    - by kushsolitary
    I am doing a simple experiment in canvas using Javascript in which some balls will be thrown on the screen with some initial velocity and then they will bounce on colliding with each other or with the walls. I managed to do the collision with walls perfectly but now the problem is with the collision with other balls. I am using the following code for it: //Check collision between two bodies function collides(b1, b2) { //Find the distance between their mid-points var dx = b1.x - b2.x, dy = b1.y - b2.y, dist = Math.round(Math.sqrt(dx*dx + dy*dy)); //Check if it is a collision if(dist <= (b1.r + b2.r)) { //Calculate the angles var angle = Math.atan2(dy, dx), sin = Math.sin(angle), cos = Math.cos(angle); //Calculate the old velocity components var v1x = b1.vx * cos, v2x = b2.vx * cos, v1y = b1.vy * sin, v2y = b2.vy * sin; //Calculate the new velocity components var vel1x = ((b1.m - b2.m) / (b1.m + b2.m)) * v1x + (2 * b2.m / (b1.m + b2.m)) * v2x, vel2x = (2 * b1.m / (b1.m + b2.m)) * v1x + ((b2.m - b1.m) / (b2.m + b1.m)) * v2x, vel1y = v1y, vel2y = v2y; //Set the new velocities b1.vx = vel1x; b2.vx = vel2x; b1.vy = vel1y; b2.vy = vel2y; } } You can see the experiment here. The problem is, some balls overlap each other and stick together while some of them rebound perfectly. I don't know what is causing this issue. Here's my balls object if that matters: function Ball() { //Random Positions this.x = 50 + Math.random() * W; this.y = 50 + Math.random() * H; //Random radii this.r = 15 + Math.random() * 30; this.m = this.r; //Random velocity components this.vx = 1 + Math.random() * 4; this.vy = 1 + Math.random() * 4; //Random shade of grey color this.c = Math.round(Math.random() * 200); this.draw = function() { ctx.beginPath(); ctx.fillStyle = "rgb(" + this.c + ", " + this.c + ", " + this.c + ")"; ctx.arc(this.x, this.y, this.r, 0, Math.PI*2, false); ctx.fill(); ctx.closePath(); } }

    Read the article

  • How to find every possible combination of arrays in PHP

    - by DenverZ
    $data = array( 'a' => array('a1', 'a2', 'a3'), 'b' => array('b1', 'b2', 'b3', 'b4'), 'c' => array('c1', 'c2', 'c3', 'c4', 'c5')); to get a1 a2 a3 b1 b2 b3 b4 c1 c2 c3 c4 c5 a1 b1 a1 b2 a1 b3 a1 b4 a1 c1 a1 c2 a1 c3 a1 c4 a1 c5 b1 c1 b1 c2 b1 c3 b1 c4 b1 c5 b2 c1 b2 c2 b2 c3 b2 c4 b2 c5 b3 c1 b3 c2 b3 c3 b3 c4 b3 c5 b4 c1 b4 c2 b4 c3 b4 c4 b4 c5 a1 b1 c1 a1 b1 c2 a1 b1 c3 a1 b1 c4 a1 b1 c5 a1 b2 c1 a1 b2 c2 a1 b2 c3 a1 b2 c4 a1 b2 c5 a1 b3 c1 a1 b3 c2 a1 b3 c3 a1 b3 c4 a1 b3 c5 a1 b4 c1 a1 b4 c2 a1 b4 c3 a1 b4 c4 a1 b4 c5 etc... Thanks

    Read the article

  • Integrating Silverlight BING Maps with SharePoint 2010

    - by Sahil Malik
    Ad:: SharePoint 2007 Training in .NET 3.5 technologies (more information). Okay this video is super duper cool! You’ve heard of bing.com right? Have you tried out the silverlight maps on bing? WHAT? YOU HAVEN’T!? DAMMIT! You should! Seriously, the bing silverlight maps are way way way cooler than their google counterpart. They are simply mindblowing. Now, what if I told you, you could integrate those, and the power of the bing geocoding api, AND, the bing search engine, AND routing capabilities, all on a silverlight map, and throw in the Yahoo geocoding api over a REST interface, all running inside SharePoint? No seriously! I am not joking! In this video, I demonstrate exactly the above, all integrated and running happily inside of SharePoint 2010. Note that you can also make this work in SharePoint 2007. I used the Telerik Silverlight Controls to make all this happen. And as always, only about 2% of the video is slides, all of the rest is all hands-on code. The entire application, is written right in front of your eyes, in about an hour. Plenty of good stuff here in this video Hope you like it! Have fun! Comment on the article ....

    Read the article

  • Enable Claims based Auth on a SP2010 website, after it has been provisioned

    - by Sahil Malik
    Ad:: SharePoint 2007 Training in .NET 3.5 technologies (more information). When you provision a web app in SP2010, you can choose it to use Claims Based Auth or Classic Auth right through the GUI.  However, after you have provisioned a web app, there is no GUI to switch from Classic to Claims based. So the below powershell script will let you convert a SP2010 website to claims based auth after it has been provisioned. 1: $w = Get-SPWebApplication "http://sp2010" 2: $w.UseClaimsAuthentication = "True"; 3: $w.Update() The user running the above script should be a member of the SharePoint_Shell_Access role on the config DB, and a member of the WSS_ADMIN_WPG local group. Comment on the article ....

    Read the article

  • Large File Upload in SharePoint 2010

    - by Sahil Malik
    Ad:: SharePoint 2007 Training in .NET 3.5 technologies (more information). Okay this is a big BIG B-I-G problem. And with SP2010 it’s going to be more prominent, because atleast at the server side, SharePoint can support large files much much better than SharePoint 2007 ever did. The issue with very large files being uploaded through any browser based API are - Reliably transferring gigabyte or bigger files without breakages over a protocol like HTTP, which is better suited for tiny transfers like images and text. Not killing your browser because it has to load all that in memory Not killing your web server because All that you upload through HTTP post, first gets streamed into IIS Memory, w3wp.exe memory before the ENTIRE FILE finishes uploading .. before it is stored. Which means, You cannot show an accurate and live progress bar of the upload, IIS gives you no such accurate metric of an upload. All the counters it gives you are approximate. Your w3wp.exe eats up all server memory – 4GB of it, for a 4GB upload. A thread is kept busy for the entire duration of the upload, thereby greatly limiting your web server’s capability to serve newer requests. Kills effective load balancing. Not killing your content database because, As you are uploading a very large file, that large file gets written sequentially into the DB, and therefore for a very large file very severely impacts the database performance. I had put together another video showing RBS usage in SharePoint 2010. I talked about many practical ramifications of using RBS in SharePoint in that video. Note that enabling large file support will never ever be a point and click job, simply because there are too many questions one needs to ask, and too many things one needs to plan for. However, one part that will remain common across all large file upload scenarios, in SharePoint or outside of SharePoint is to do it efficiently while not killing the web server. In this video, I describe using the Telerik Silverlight Upload control with SharePoint 2010 to enable efficient large file uploads in SharePoint. Presenting .. The video Comment on the article ....

    Read the article

  • WCF/ADO.NET Data Services - Could not load type 'System.Data.Services.Providers.IDataServiceUpdatePr

    - by Sahil Malik
    Ad:: SharePoint 2007 Training in .NET 3.5 technologies (more information). When you try accessing ListData.svc, do you get the following error? Could not load type 'System.Data.Services.Providers.IDataServiceUpdateProvider' from assembly 'System.Data.Services, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Well, if you followed the instructions in Chapter 1 of my book to build your VM, you wouldn’t run into the above issue. But if you do, you need to install  -   For Windows Vista and Windows 2008 - http://www.microsoft.com/downloads/details.aspx?familyid=4B710B89-8576-46CF-A4BF-331A9306D555&displaylang=en For Windows 7 and Windows 2008 R2 - http://www.microsoft.com/downloads/details.aspx?familyid=79d7f6f8-d6e9-4b8c-8640-17f89452148e&displaylang=en Remember to: a) Install the x64 version, and b) Do an IISReset before trying again. Comment on the article ....

    Read the article

  • Implementing Silverlight Coverflow with ADO.NET/WCF Data Services in SharePoint 2010

    - by Sahil Malik
    Ad:: SharePoint 2007 Training in .NET 3.5 technologies (more information). WOOHOO!! My next video is online. In this video, I show how you can implement Silverlight Coverflow like UI using the Telerik silverlight toolset. In this demo, I talk to a picture library running in SharePoint 2010, and use ADO.NET Data Services to load up the various images loaded in the picture library. I then use the Telerik Silverlight toolset  integrated with the ADO.NET Data Services/WCF Data Services, and show a fancy coverflow like UI. As always, very few slides, completely hands-on, all code written in front of your eyes! Enjoy – the video.   And yes, there are a couple of more exciting videos coming! Stay tuned! Comment on the article ....

    Read the article

  • Video: Telerik Silverlight Chart showing live data from SharePoint 2010

    - by Sahil Malik
    Ad:: SharePoint 2007 Training in .NET 3.5 technologies (more information). In this video, I demonstrate  - The process of writing, authoring, deploying, configuring, and debugging a Custom WCF service in SharePoint 2010 Integrating it with the Telerik Silverlight RAD Chart, that shows live data from the server showing CPU Usage of your web front end – can be enhanced to show whatever else you want. Doing all this in Visual Studio 2010, how you’d put your project together, how do you go about diagnosing it, debugging it – the whole bit. The whole presentation is about 45 mins, and it’s mostly all code, so plenty of juicy stuff here! At the end of this, you have a pretty sexy app running .. just fast forward to the end of the video below, and you’ll see what I’m talking about. :) You can watch the video here Comment on the article ....

    Read the article

  • Telerik Silverlight Grid with BCS Lists in SharePoint 2010

    - by Sahil Malik
    Ad:: SharePoint 2007 Training in .NET 3.5 technologies (more information). Okay my next video is online. In this video, I demonstrate the usage of the Telerik Silverlight grid working with a Business Connectivity Services (BCS) list over the Client Object Model. I use the Telerik grid to create a view on a BCS list, and demonstrate the rich value that a nice Silverlight grid can bring into SharePoint 2010. The entire presentation is mostly all code. It’s about 1/2 hr in length. Watch the video Comment on the article ....

    Read the article

  • Office 2010 Client &ndash; Should I go with 32 bit or 64 bit?

    - by Sahil Malik
    Ad:: SharePoint 2007 Training in .NET 3.5 technologies (more information). As you know, Office 2010 client now comes in both 32 bit and 64 bit versions. The question is, should you go with 32 bit or 64 bit? 64 is bigger than 32 .. so 64 is better no? NO! Given a choice, or unless you have a very strong reason not to – GO WITH 32 bit. Why is that? Here is why - 32 bit apps actually work better on 64 bit OS’s in most scenarios due to WoW, and the additional 64 bit VLSW calculations. If you have 2007 installations to support, SharePoint designer 2010 cannot be used to work with SharePoint 2007 sites. So you will have to install SharePoint designer 2007 32bit side by side with SharePoint designer 2010 32 bit side by side. So you cannot mix and match 32 bit and 64 bit here. Of course you can virtualize and not have this problem to begin with :-D. 64 bit office will break many things on your SharePoint experience for that client – example, that fancy datasheet view won’t work on lists. 32 bit office apps don’t have this issue. There are some extreme situations where you DO want 64 bit client apps though. Specifically if you have HUGE excel sheets to work with, then 64 bit office client excel is much better than the equivalent 32 bit excel. Comment on the article ....

    Read the article

  • how can i store value in button at runtime?

    - by SHASHANK
    Hello all I have a problem i have some dynamic button.and i want to store integer value in that. and get that value on that click event of that button how can i achieve it thanks in advance shashank DataView dv = new DataView(dtCat, "PK_CATEGORY_ID IN(" + categoryIds.ToString() + "0)", "PK_CATEGORY_ID", DataViewRowState.CurrentRows); foreach (DataRowView rr in dv) { //MessageBox.Show(rr[0].ToString() + "------------" + rr[1].ToString()); Button b2 = new Button(); //b2.Name = rr[0].ToString(); b2.Name = ""; b2.Height = 200; b2.Width = 200; b2.Margin = new Thickness(0, -100, 0, 0); b2.HorizontalAlignment = HorizontalAlignment.Left; b2.Content = rr[1].ToString(); b2.Background = System.Windows.Media.Brushes.Pink; b2.Click += new RoutedEventHandler(b2_Click); btncanvas.Children.Add(b2); Canvas.SetLeft(b2, b2.Width * i); i = i + 1; MessageBox.Show(rr[0].ToString()); b2.Tag = rr[0].ToString(); } void b2_Click(object sender, RoutedEventArgs e) { Button clicked = (Button)sender; categoryname = clicked.Name; }

    Read the article

  • Simple Physics Simulation in java not working.

    - by Static Void Main
    Dear experts, I wanted to implement ball physics and as i m newbie, i adapt the code in tutorial http://adam21.web.officelive.com/Documents/JavaPhysicsTutorial.pdf . i try to follow that as i much as i can, but i m not able to apply all physical phenomenon in code, can somebody please tell me, where i m mistaken or i m still doing some silly programming mistake. The balls are moving when i m not calling bounce method and i m unable to avail the bounce method and ball are moving towards left side instead of falling/ending on floor**, Can some body recommend me some better way or similar easy compact way to accomplish this task of applying physics on two ball or more balls with interactivity. here is code ; import java.awt.*; public class AdobeBall { protected int radius = 20; protected Color color; // ... Constants final static int DIAMETER = 40; // ... Instance variables private int m_x; // x and y coordinates upper left private int m_y; private double dx = 3.0; // delta x and y private double dy = 6.0; private double m_velocityX; // Pixels to move each time move() is called. private double m_velocityY; private int m_rightBound; // Maximum permissible x, y values. private int m_bottomBound; public AdobeBall(int x, int y, double velocityX, double velocityY, Color color1) { super(); m_x = x; m_y = y; m_velocityX = velocityX; m_velocityY = velocityY; color = color1; } public double getSpeed() { return Math.sqrt((m_x + m_velocityX - m_x) * (m_x + m_velocityX - m_x) + (m_y + m_velocityY - m_y) * (m_y + m_velocityY - m_y)); } public void setSpeed(double speed) { double currentSpeed = Math.sqrt(dx * dx + dy * dy); dx = dx * speed / currentSpeed; dy = dy * speed / currentSpeed; } public void setDirection(double direction) { m_velocityX = (int) (Math.cos(direction) * getSpeed()); m_velocityY = (int) (Math.sin(direction) * getSpeed()); } public double getDirection() { double h = ((m_x + dx - m_x) * (m_x + dx - m_x)) + ((m_y + dy - m_y) * (m_y + dy - m_y)); double a = (m_x + dx - m_x) / h; return a; } // ======================================================== setBounds public void setBounds(int width, int height) { m_rightBound = width - DIAMETER; m_bottomBound = height - DIAMETER; } // ============================================================== move public void move() { double gravAmount = 0.02; double gravDir = 90; // The direction for the gravity to be in. // ... Move the ball at the give velocity. m_x += m_velocityX; m_y += m_velocityY; // ... Bounce the ball off the walls if necessary. if (m_x < 0) { // If at or beyond left side m_x = 0; // Place against edge and m_velocityX = -m_velocityX; } else if (m_x > m_rightBound) { // If at or beyond right side m_x = m_rightBound; // Place against right edge. m_velocityX = -m_velocityX; } if (m_y < 0) { // if we're at top m_y = 0; m_velocityY = -m_velocityY; } else if (m_y > m_bottomBound) { // if we're at bottom m_y = m_bottomBound; m_velocityY = -m_velocityY; } // double speed = Math.sqrt((m_velocityX * m_velocityX) // + (m_velocityY * m_velocityY)); // ...Friction stuff double fricMax = 0.02; // You can use any number, preferably less than 1 double friction = getSpeed(); if (friction > fricMax) friction = fricMax; if (m_velocityX >= 0) { m_velocityX -= friction; } if (m_velocityX <= 0) { m_velocityX += friction; } if (m_velocityY >= 0) { m_velocityY -= friction; } if (m_velocityY <= 0) { m_velocityY += friction; } // ...Gravity stuff m_velocityX += Math.cos(gravDir) * gravAmount; m_velocityY += Math.sin(gravDir) * gravAmount; } public Color getColor() { return color; } public void setColor(Color newColor) { color = newColor; } // ============================================= getDiameter, getX, getY public int getDiameter() { return DIAMETER; } public double getRadius() { return radius; // radius should be a local variable in Ball. } public int getX() { return m_x; } public int getY() { return m_y; } } using adobeBall: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class AdobeBallImplementation implements Runnable { private static final long serialVersionUID = 1L; private volatile boolean Play; private long mFrameDelay; private JFrame frame; private MyKeyListener pit; /** true means mouse was pressed in ball and still in panel. */ private boolean _canDrag = false; private static final int MAX_BALLS = 50; // max number allowed private int currentNumBalls = 2; // number currently active private AdobeBall[] ball = new AdobeBall[MAX_BALLS]; public AdobeBallImplementation(Color ballColor) { frame = new JFrame("simple gaming loop in java"); frame.setSize(400, 400); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pit = new MyKeyListener(); pit.setPreferredSize(new Dimension(400, 400)); frame.setContentPane(pit); ball[0] = new AdobeBall(34, 150, 7, 2, Color.YELLOW); ball[1] = new AdobeBall(50, 50, 5, 3, Color.BLUE); frame.pack(); frame.setVisible(true); frame.setBackground(Color.white); start(); frame.addMouseListener(pit); frame.addMouseMotionListener(pit); } public void start() { Play = true; Thread t = new Thread(this); t.start(); } public void stop() { Play = false; } public void run() { while (Play == true) { // bounce(ball[0],ball[1]); runball(); pit.repaint(); try { Thread.sleep(mFrameDelay); } catch (InterruptedException ie) { stop(); } } } public void drawworld(Graphics g) { for (int i = 0; i < currentNumBalls; i++) { g.setColor(ball[i].getColor()); g.fillOval(ball[i].getX(), ball[i].getY(), 40, 40); } } public double pointDistance (double x1, double y1, double x2, double y2) { return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); } public void runball() { while (Play == true) { try { for (int i = 0; i < currentNumBalls; i++) { for (int j = 0; j < currentNumBalls; j++) { if (pointDistance(ball[i].getX(), ball[i].getY(), ball[j].getX(), ball[j].getY()) < ball[i] .getRadius() + ball[j].getRadius() + 2) { // bounce(ball[i],ball[j]); ball[i].setBounds(pit.getWidth(), pit.getHeight()); ball[i].move(); pit.repaint(); } } } try { Thread.sleep(50); } catch (Exception e) { System.exit(0); } } catch (Exception e) { e.printStackTrace(); } } } public static double pointDirection(int x1, int y1, int x2, int y2) { double H = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); // The // hypotenuse double x = x2 - x1; // The opposite double y = y2 - y1; // The adjacent double angle = Math.acos(x / H); angle = angle * 57.2960285258; if (y < 0) { angle = 360 - angle; } return angle; } public static void bounce(AdobeBall b1, AdobeBall b2) { if (b2.getSpeed() == 0 && b1.getSpeed() == 0) { // Both balls are stopped. b1.setDirection(pointDirection(b1.getX(), b1.getY(), b2.getX(), b2 .getY())); b2.setDirection(pointDirection(b2.getX(), b2.getY(), b1.getX(), b1 .getY())); b1.setSpeed(1); b2.setSpeed(1); } else if (b2.getSpeed() == 0 && b1.getSpeed() != 0) { // B1 is moving. B2 is stationary. double angle = pointDirection(b1.getX(), b1.getY(), b2.getX(), b2 .getY()); b2.setSpeed(b1.getSpeed()); b2.setDirection(angle); b1.setDirection(angle - 90); } else if (b1.getSpeed() == 0 && b2.getSpeed() != 0) { // B1 is moving. B2 is stationary. double angle = pointDirection(b2.getX(), b2.getY(), b1.getX(), b1 .getY()); b1.setSpeed(b2.getSpeed()); b1.setDirection(angle); b2.setDirection(angle - 90); } else { // Both balls are moving. AdobeBall tmp = b1; double angle = pointDirection(b2.getX(), b2.getY(), b1.getX(), b1 .getY()); double origangle = b1.getDirection(); b1.setDirection(angle + origangle); angle = pointDirection(tmp.getX(), tmp.getY(), b2.getX(), b2.getY()); origangle = b2.getDirection(); b2.setDirection(angle + origangle); } } public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { new AdobeBallImplementation(Color.red); } }); } } *EDIT:*ok splitting the code using new approach for gravity from this forum: this code also not working the ball is not coming on floor: public void mymove() { m_x += m_velocityX; m_y += m_velocityY; if (m_y + m_bottomBound > 400) { m_velocityY *= -0.981; // setY(400 - m_bottomBound); m_y = 400 - m_bottomBound; } // ... Bounce the ball off the walls if necessary. if (m_x < 0) { // If at or beyond left side m_x = 0; // Place against edge and m_velocityX = -m_velocityX; } else if (m_x > m_rightBound) { // If at or beyond right side m_x = m_rightBound - 20; // Place against right edge. m_velocityX = -m_velocityX; } if (m_y < 0) { // if we're at top m_y = 1; m_velocityY = -m_velocityY; } else if (m_y > m_bottomBound) { // if we're at bottom m_y = m_bottomBound - 20; m_velocityY = -m_velocityY; } } thanks a lot for any correction and help. jibby

    Read the article

  • Data capture from other sheet into Summary sheet

    - by Hemant
    an Excel workbook which has Summary sheet, Pending and Master Sheet. My requirement is below and try to develop a Macro or VB logic for excel • I want to control this workbook from Summary sheet. o Generate Fault Summary – ? I have set logic but if doesn’t give warning if sheet name is exists , so need to add this logic . ? When we press the Fault Report Summary command button then it copy the master sheet with cell “A6” Name and will hide the Master sheet. Again when you select the another Month name then it will generate the sheet for that month name. o Generate Toll System Uptime ? When I select the sheet name and “Week” then Press the “Enter “Command button then it should get the result from that sheet number . Each sheet number has Month detail in B2 Cell. ? To calculate the Uptime formula for Week wise is • Week-01 = (1680-SUMIFS(L5:L23,B5:B23,"="&B2,B5:B23,"<="&(B2+6)))/1680 • Week-02 =(1680-SUMIFS(L5:L23,B5:B23,"="&(B2+7),B5:B23,"<="&(B2+13)))/1680 • Week-03 =(1680-SUMIFS(L5:L23,B5:B23,"="&(B2+14),B5:B23,"<="&(B2+20)))/1680 • Week-04 =(1680-SUMIFS(L5:L23,B5:B23,"="&(B2+21),B5:B23,"<="&(B2+27)))/1680 • Month =(1680-SUMIFS(L5:L23,B5:B23,"="&(B2),B5:B23,"<="&(DATE(YEAR(B2),1+MONTH(B2),1)-1)))/1680 ? Result should reflect in Summary sheet at B18 cell . o Pending Fault Report Summary ? When segregate the report on its status like which one is open or Close . It is open then it is Pending Fault Report and when it is Close status it means it is closed. ? If any fault which has OPEN status in all sheets(Jan-13,Feb-13,Mar-13….etc) then it should be come as well as in Pending Sheet which ascending date order. ? When it’s status is changed then it should be moved in that month sheet or nearby fault created date. It status is close then it should not be available in pending sheet as it’s status is Closed. ? Each fault has Reported date and we monitor all fault according reported date. ? When we press the Update Fault Report Summary command button then it should update as above logic. ? Some time we export the Pending fault report , so date calendar should be present in Start and End date to Choose the date. When we press the Export command line then it should export the Pending fault report and able to save in Excel,PDF.

    Read the article

  • My WiFi gets deauthenticated every few minutes or seconds (Reason: 7)

    - by dan
    My Wifi on my new Thinkpad W520 running Natty keeps dropping out and coming back on. Output from dmesg below. Any advice? [30493.687552] wlan0: authenticate with e0:91:f5:ef:7b:b2 (try 1) [30493.689127] wlan0: authenticated [30493.689144] wlan0: associate with e0:91:f5:ef:7b:b2 (try 1) [30493.693592] wlan0: RX AssocResp from e0:91:f5:ef:7b:b2 (capab=0x411 status=0 aid=4) [30493.693595] wlan0: associated [31631.172868] wlan0: deauthenticated from e0:91:f5:ef:7b:b2 (Reason: 7) [31631.211847] cfg80211: All devices are disconnected, going to restore regulatory settings [31631.211868] cfg80211: Restoring regulatory settings [31631.211873] cfg80211: Calling CRDA to update world regulatory domain [31631.215037] cfg80211: Ignoring regulatory request Set by core since the driver uses its own custom regulatory domain [31631.215042] cfg80211: World regulatory domain updated: [31631.215044] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) [31631.215046] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [31631.215049] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) [31631.215051] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) [31631.215053] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [31631.215055] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [31632.289638] wlan0: authenticate with e0:91:f5:ef:7b:b2 (try 1) [31632.291262] wlan0: authenticated [31632.291276] wlan0: associate with e0:91:f5:ef:7b:b2 (try 1) [31632.295119] wlan0: RX AssocResp from e0:91:f5:ef:7b:b2 (capab=0x411 status=0 aid=4) [31632.295123] wlan0: associated [31886.234836] wlan0: deauthenticated from e0:91:f5:ef:7b:b2 (Reason: 7) [31886.306735] cfg80211: All devices are disconnected, going to restore regulatory settings [31886.306740] cfg80211: Restoring regulatory settings [31886.306744] cfg80211: Calling CRDA to update world regulatory domain

    Read the article

  • draw ellipse in MFC C++ just use OPENGL?

    - by taki
    i trying to draw ellipse in MFC C++ just use OPENGL. it ran for the resulting ellipse but it is not correct mouse coordinates. My code: in class Ellispe.cpp void VeEllispe::putPixel(int x,int y,int xc, int yc) { glBegin(GL_POINTS);// bat dau bang ve diem glVertex2i(xc+x,yc+y); glVertex2i(xc-x,yc-y); glVertex2i(xc+x,yc-y); glVertex2i(xc-x,yc+y); glEnd(); } void VeEllispe::Draw(int a, int b,int xc,int yc) { int x = 0; int y = b; float a2 = (a*a); float b2 = (b*b); float p = b2 - a2*b + 0.25*a2; while(2*b2*x <= 2*y*a2) { putPixel(x,y,xc,yc); if (p < 0) p+= 2*b2*x + 3*b2; else { p+= 2*b2*x + 3*b2 - 2*a2*y + 2*a2; y--; } x++; } x = a; y = 0; p = a2 - b2*a + 0.25*b2; while(2*a2*y <= 2*x*b2) { putPixel(x,y,xc, yc); if (p < 0) p+= 2*a2*y + 3*a2; else { p+= 2*a2*y + 3*a2 - 2*b2*x + 2*b2; x--; } y++; } } in class XYZView.cpp . . VeEllispe e; void Cbaitap1View::OnDraw(CDC* /*pDC*/) { Cbaitap1Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (!pDoc) return; wglMakeCurrent(m_hDC,m_hRC); glClear(GL_COLOR_BUFFER_BIT); glClearColor(1.0,1.0,1.0,0.0); glColor3f(0.0,0.0,1.0); glPointSize(2); if (state==4) e.Draw(X2,Y2,X1,Y1); glFlush(); SwapBuffers(::GetDC(GetSafeHwnd())); wglMakeCurrent(NULL,NULL); } And if possible, can you teach me the document to drawing triangles or parapol use OPENGL?

    Read the article

  • Transferring Conditional Formatting (without the cell value) in Excel

    - by london
    If I have 3 layers of conditional formatting in a cell (B2) is there a way of transferring the format of cell (B2) to another cell (A2) without copying across the value in the original cell (B2). I.e. in b2 I have conditional formatting dependent on what is selected from a drop down list of 4 options). I want the format to be copied across the the cell before this (A2) without the values being copied across. Essentially A2 has the title and B2 has the value but I would like the same formatting across both. I have manged to do it by setting A2 as ="Title "&B2 and applying conditional formatting to this. The spacing means the text from B2 doesn't show. This works but is really ugly. Is there a better way givern there ae too many conditions for a standard IF function. (if possible the solution should be windows 2003 compatible)

    Read the article

  • Clearcase - selective merge.

    - by Keshav
    Hi, I have a peculiar Clearcase doubt. I cannot fully describe why I'm doing such a confusing architecture, but I need to do it (thanks to the mistake done by someone long back). Ok, here's a bit of detail: B1 is a contaminated branch where both my group's changes and another group's changes got mixed together so badly that there is no way of finding which code is whose). So the solution proposed is to create a new branch called B2 (at the same level as B1) and put all the unmodified code of the other group on it (The way to do that would be to merge B1 with B2 and then go about removing all changes from it till it becomes original). Then create a CR branch on B1 and keep only my group's newly added files or modified files on that branch. Finally create an integration branch out of B2 and merge the changes from CR branch of B1 to integration branch of B2. So here is what I did: (The use case is where I have dir D where file a, b and c are there. My group ended up modifying file a while b and c are not modified at all). There is a branch B1 on which there are files a, b and c. There is another branch B2. A merge is done from B1 to B2. Now B2 also has a, b and c. At this point both branch B1 and B2 are same. Now I delete file a from branch B2 (rmname). Now B2 has b and c only. I put a label to this branch called Label1. This makes the code with label Label1 as the unmodified code from other group. Now I create a sub branch called CR1 from B1 and delete all the files that are there in B2 branch (i.e b and c) such that it contains only the modified code from original code on it. In my case it is file a. At this point branch B2 with label Label1 has files b and c (those are unmodified code) and branch CR1 coming off B1 has only a (that is modified by us). Now I create another branch called integration branch that comes off B2 Label1. And then I do a merge of CR branch on to that expecting that it will have all three files a, b and c for me. All I'd need to do is to do a version tree view and see who modified what. But the problem I face is that since I had done a rmname of file a on branch B2 earlier to putting Label. The merge does not really take the file a from CR branch. How to I get around that problem. I want to selectively merge. Is it possible? sorry if it is a bad design. I'm not really conversant with Clear case and have limited options and time to clear some one else's mess.

    Read the article

  • Turn-around time in PHP

    - by user73409
    Is there any one who had tried to build/convert a php version of the Excel method in computing Turn-around time(excluding holidays, weekends and non-business hours)? Excel Turn-around Time Computation: =(NETWORKDAYS(A2,B2,H$1:H$10)-1)*("17:00"-"8:00")+IF(NETWORKDAYS(B2,B2,H$1:H$10),MEDIAN(MOD(B2,1),"17:00","8:00"),"17:00")-MEDIAN(NETWORKDAYS(A2,A2,H$1:H$10)*MOD(A2,1),"17:00","8:00") :REF-URL[http://www.mrexcel.com/forum/excel-questions/514097-i-need-formual-calculate-turn-around-time.html] Thanks.

    Read the article

  • Oracle SQL outer join query puzzle

    - by user1651446
    So I am dumb and I have this: select whatever from bank_accs b1, bank_accs b2, table3 t3 where t3.bank_acc_id = t1.bank_acc_id and b2.bank_acc_number = b1.bank_acc_number and b2.currency_code(+) = t3.buy_currency and trunc(sysdate) between nvl(b2.start_date, trunc(sysdate)) and nvl(b2.end_date, trunc(sysdate)); My problem is with the date (actuality) check on b2. Now, I need to return a row for each t3xb1 (t3 = ~10 tables joined, of course), even if there are ONLY INVALID records (date-wise) in b2. How do I outer-join this bit properly? Can't use ANSI joins, must do in a single flat query. Thanks.

    Read the article

  • call function between classes [closed]

    - by aziz joh
    hello I have 3 classes class A, B, and C class A is the main class and content the main function also, i call class B and class C in the main as b1,b2 and c1. in class B there is a vector (V) has list of int. and 3 functions Add, get and delete delete. all the thing in the class is public. in class C i have function that need to (B::get) from b. what I want is that how I can make c1 call get of b1 to return the value of the V in b1 after that use add of b2 to add new item in V of b2. Thanks in advance This is an example class a{ int main(){ b b1,b2; c c1; b1.add(10); b1.add(20); c1.start(); }} class b{ vector<int> v; void add(int i){ v.push_back(i)} int get(){int i=v.at(0); return i;} } class c{// take something from b1 and add it to b2 void play(){ int i=b.get();//should take it from b1 b.add(i*2);//should add it to b2 }} please I need your help I been searching to solve this problem for days.

    Read the article

  • Assign sage variable values into R objects via sagetex and Sweave

    - by sheed03
    I am writing a short Sweave document that outputs into a Beamer presentation, in which I am using the sagetex package to solve an equation for two parameters in the beta binomial distribution, and I need to assign the parameter values into the R session so I can do additional processing on those values. The following code excerpt shows how I am interacting with sage: <<echo=false,results=hide>>= mean.raw <- c(5, 3.5, 2) theta <- 0.5 var.raw <- mean.raw + ((mean.raw^2)/theta) @ \begin{frame}[fragile] \frametitle{Test of Sage 2} \begin{sagesilent} var('a1, b1, a2, b2, a3, b3') eqn1 = [1000*a1/(a1+b1)==\Sexpr{mean.raw[1]}, ((1000*a1*b1)*(1000+a1+b1))/((a1+b1)^2*(a1+b1+1))==\Sexpr{var.raw[1]}] eqn2 = [1000*a2/(a2+b2)==\Sexpr{mean.raw[2]}, ((1000*a2*b2)*(1000+a2+b2))/((a2+b2)^2*(a2+b2+1))==\Sexpr{var.raw[2]}] eqn3 = [1000*a3/(a3+b3)==\Sexpr{mean.raw[3]}, ((1000*a3*b3)*(1000+a3+b3))/((a3+b3)^2*(a3+b3+1))==\Sexpr{var.raw[3]}] s1 = solve(eqn1, a1,b1) s2 = solve(eqn2, a2,b2) s3 = solve(eqn3, a3,b3) \end{sagesilent} Solutions of Beta Binomial Parameters: \begin{itemize} \item $\sage{s1[0]}$ \item $\sage{s2[0]}$ \item $\sage{s3[0]}$ \end{itemize} \end{frame} Everything compiles just fine, and in that slide I am able to see the solutions to the three equations respective parameters in that itemized list (for example the first item in the itemized list from that beamer slide is outputted as [a1=(328/667), b1=(65272/667)] (I am not able to post an image of the beamer slide but I hope you get the idea). I would like to save the parameter values a1,b1,a2,b2,a3,b3 into R objects so that I can use them in simulations. I cannot find any documentation in the sagetex package on how to save output from sage commands into variables for use with other programs (in this case R). Any suggestions on how to get these values into R?

    Read the article

  • How can I sort my data while keeping paired rows together?

    - by Joe Lee Frank
    How can I pair two rows on a spreadsheet, so that for each data entry I can sort the matrix but the pair of rows moves as a single list of data, retaining the structure of the two rows? For example: Original entry A1,1 B1,1 C1,1 D1,1 A1,2 B1,2 C1,2 D1,2 A2,1 B2,1 C2,1 D2,1 A2,2 B2,2 C2,2 D2,2 Sorted reverse order A2,1 B2,1 C2,1 D2,1 A2,2 B2,2 C2,2 D2,2 A1,1 B1,1 C1,1 D1,1 A1,2 B1,2 C1,2 D1,2

    Read the article

  • Factorising program not working. Help required.

    - by Ender
    I am working on a factorisation problem using Fermat's Factorization and for small numbers it is working well. I've been able to calculate the factors (getting the answers from Wolfram Alpha) for small numbers, like the one on the Wikipedia page (5959). Just when I thought I had the problem licked I soon realised that my program was not working when it came to larger numbers. The program follows through the examples from the Wikipedia page, printing out the values a, b, a2 and b2; the results printed for large numbers are not correct. I've followed the pseudocode provided on the Wikipedia page, but am struggling to understand where to go next. Along with the Wikipedia page I have been following this guide. Once again, as my Math knowledge is pretty poor I cannot follow what I need to do next. The code I am using so far is as follows: import java.math.BigInteger; /** * * @author AlexT */ public class Fermat { private BigInteger a, b; private BigInteger b2; private static final BigInteger TWO = BigInteger.valueOf(2); public void fermat(BigInteger N) { // floor(sqrt(N)) BigInteger tmp = getIntSqrt(N); // a <- ceil(sqrt(N)) a = tmp.add(BigInteger.ONE); // b2 <- a*a-N b2 = (a.multiply(a)).subtract(N); final int bitLength = N.bitLength(); BigInteger root = BigInteger.ONE.shiftLeft(bitLength / 2); root = root.add(b2.divide(root)).divide(TWO); // while b2 not square root while(!(isSqrt(b2, root))) { // a <- a + 1 a = a.add(BigInteger.ONE); // b2 <- (a * a) - N b2 = (a.multiply(a)).subtract(N); root = root.add(b2.divide(root)).divide(TWO); } b = getIntSqrt(b2); BigInteger a2 = a.pow(2); // Wrong BigInteger sum = (a.subtract(b)).multiply((a.add(b))); //if(sum.compareTo(N) == 0) { System.out.println("A: " + a + "\nB: " + b); System.out.println("A^2: " + a2 + "\nB^2: " + b2); //} } /** * Is the number provided a perfect Square Root? * @param n * @param root * @return */ private static boolean isSqrt(BigInteger n, BigInteger root) { final BigInteger lowerBound = root.pow(2); final BigInteger upperBound = root.add(BigInteger.ONE).pow(2); return lowerBound.compareTo(n) <= 0 && n.compareTo(upperBound) < 0; } public BigInteger getIntSqrt(BigInteger x) { // It returns s where s^2 < x < (s+1)^2 BigInteger s; // final result BigInteger currentRes = BigInteger.valueOf(0); // init value is 0 BigInteger currentSum = BigInteger.valueOf(0); // init value is 0 BigInteger sum = BigInteger.valueOf(0); String xS = x.toString(); // change input x to a string xS int lengthOfxS = xS.length(); int currentTwoBits; int i=0; // index if(lengthOfxS % 2 != 0) {// if odd length, add a dummy bit xS = "0".concat(xS); // add 0 to the front of string xS lengthOfxS++; } while(i < lengthOfxS){ // go through xS two by two, left to right currentTwoBits = Integer.valueOf(xS.substring(i,i+2)); i += 2; // sum = currentSum*100 + currentTwoBits sum = currentSum.multiply(BigInteger.valueOf(100)); sum = sum.add(BigInteger.valueOf(currentTwoBits)); // subtraction loop do { currentSum = sum; // remember the value before subtract // in next 3 lines, we work out // currentRes = sum - 2*currentRes - 1 sum = sum.subtract(currentRes); // currentRes++ currentRes = currentRes.add(BigInteger.valueOf(1)); sum = sum.subtract(currentRes); } while(sum.compareTo(BigInteger.valueOf(0)) >= 0); // the loop stops when sum < 0 // go one step back currentRes = currentRes.subtract(BigInteger.valueOf(1)); currentRes = currentRes.multiply(BigInteger.valueOf(10)); } s = currentRes.divide(BigInteger.valueOf(10)); // go one step back return s; } /** * @param args the command line arguments */ public static void main(String[] args) { Fermat fermat = new Fermat(); //Works //fermat.fermat(new BigInteger("5959")); // Doesn't Work fermat.fermat(new BigInteger("90283")); } } If anyone can help me out with this problem I'll be eternally grateful.

    Read the article

  • My programme is for java

    - by Siddharth Pandey
    I wrote a codding on notepad and i was base on Candidate details i was trying to run the code like for example to say if u r in the school and we need the details for the candidate so all the details like name Id address age dateofbirth and soooo So my exatlly problem is that i have allready created the code and i have written it on the notepad so when ever i am going the command prompt and giving its path and all the details still it always show some problem like class interfierence or expected iw will paste the codding over here and pls if u can help me correct the coding it will be pleasure thank u. import java.swing.*; import javac.awt.*; public CandidateDetails extends JApplets; { JPanel Panel; JLabel LabelStudentID; JLabel LabelStudentNames; JLabel LabelStudentAddress; JLabel LabelStudentAge; JLabel LabelStudentDateofBirth; JLabel LabelStudentMobile no; JLabel LabelStudentCrouse; JTextField textStudentID; JTextField textStudentNames; JTextField textStudentAddress; JTextField textStudentAge; JTextField textStudentDateofBirth; JTextField textStudentMobileNo; JTextField textStudentCrouse; } public void init(); { Label StudentID = new JLabel("Student ID"); Label StudentNames = new JLabel("Student Names"); Label StudentAddress = new JLabel("Student Address"); Label StudentAge = new JLabel("Student Age"); Label StudentDateofBirth = new JLabel("Student DateofBirth"); Label StudentMobileNo = new JLabel("Student MobileNo"); Label StudentCourse = new JLabel("Student Course"); JTextField text("ID"); JTextField text("Names"); JTextField text("Address"); JTextField text("Age"); JTextField text("DateofBirth"); JTextField text("MobileofBirth"); JTextField text("Course"); } { GridBag layourt.NORTHWEST; b1=1; b2=2; gbc.gridconstraint(label Student ID); add.panel(ID); GridBag layourt.NORTHWEST; b1=1; b2=3; gbc.gridconstraint(text Student ID); add.panel(ID); GridBag layourt.NORTHWEST; b1=2; b2=3; gbc.gridconstraint(label Student Names); add.panel(Names); GridBag layourt.NORTHWEST; b1=3; b2=4; gbc.gridconstraint(text Student Names); add.panel(Names); GridBag layourt.NORTHWEST; b1=3; b2=5; gbc.gridconstraint(label Student Address); add.panel(Address); GridBag layourt.NORTHWEST; b1=3; b2=4; gbc.gridconstraint(text Student Address); add.panel(Address); GridBag layourt.NORTHWEST; b1=4; b2=5; gbc.gridconstraint(label Student DateofBirth); add.panel(DateofBirth); GridBag layourt.NORTHWEST; b1=5; b2=6; gbc.gridconstraint(text Student DateofBirth); add.panel(DateofBirth); GridBag layourt.NORTHWEST; b1=5; b2=4; gbc.gridconstraint(label Student MobileNo); add.panel(MobileNo); GridBag layourt.NORTHWEST; b1=5; b2=6; gbc.gridconstraint(text Student MobileNo); add.panel(MobileNo); GridBag layourt.NORTHWEST; b1=6; b2=7; gbc.gridconstraint(label Student Course); add.panel(Course); GridBag layourt.NORTHWEST; b1=7; b2=8; gbc.gridconstraint(text Student Course); add.panel(Course); }

    Read the article

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