Daily Archives

Articles indexed Thursday October 11 2012

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

  • Input Iterator for a shared_ptr

    - by Baz
    I have an iterator which contains the following functions: ... T &operator*() { return *_i; } std::shared_ptr<T> operator->() { return _i; } private: std::shared_ptr<T> _i; ... How do I get a shared pointer to the internally stored _i? std::shared_ptr<Type> item = ??? Should I do: MyInterfaceIterator<Type> i; std::shared_ptr<Type> item = i.operator->(); Or should I rewrite operator*()?

    Read the article

  • ftp : get list of files

    - by Rohan
    I am trying to get a list of files on FTP folder. The code was working when I ran it locally, but on deploying it I started receiving html instead of file name ArrayList fName = new ArrayList(); try { StringBuilder result = new StringBuilder(); //create the directory FtpWebRequest requestDir = (FtpWebRequest)FtpWebRequest.Create(new Uri(directory)); requestDir.Method = WebRequestMethods.Ftp.ListDirectory; requestDir.Credentials = new NetworkCredential(FTP_USER_NAME, FTP_PASSWORD); requestDir.UsePassive = true; requestDir.UseBinary = true; requestDir.KeepAlive = false; requestDir.Proxy = null; FtpWebResponse response = (FtpWebResponse)requestDir.GetResponse(); Stream ftpStream = response.GetResponseStream(); StreamReader reader = new StreamReader(ftpStream, Encoding.ASCII); while (!reader.EndOfStream) { fName.Add(reader.ReadLine().ToString()); } response.Close(); ftpStream.Close(); reader.Close();

    Read the article

  • postgresql insert value in table in serial value

    - by Jesse Siu
    my database using postgresql. the table pk is uing serial value.if i want to insert a record in table, do i need type pk or it will automatic contain id. Can you give me a example about how to insert a record in dataset CREATE TABLE dataset ( id serial NOT NULL, age integer NOT NULL, name character varying(32) NOT NULL, description text NOT NULL DEFAULT ''::text CONSTRAINT dataset_pkey PRIMARY KEY (id ) )

    Read the article

  • In R, how do you get the best fitting equation to a set of data?

    - by Matherion
    I'm not sure wether R can do this (I assume it can, but maybe that's just because I tend to assume that R can do anything :-)). What I need is to find the best fitting equation to describe a dataset. For example, if you have these points: df = data.frame(x = c(1, 5, 10, 25, 50, 100), y = c(100, 75, 50, 40, 30, 25)) How do you get the best fitting equation? I know that you can get the best fitting curve with: plot(loess(df$y ~ df$x)) But as I understood you can't extract the equation, see Loess Fit and Resulting Equation. When I try to build it myself (note, I'm not a mathematician, so this is probably not the ideal approach :-)), I end up with smth like: y.predicted = 12.71 + ( 95 / (( (1 + df$x) ^ .5 ) / 1.3)) Which kind of seems to approximate it - but I can't help to think that smth more elegant probably exists :-) I have the feeling that fitting a linear or polynomial model also wouldn't work, because the formula seems different from what those models generally use (i.e. this one seems to need divisions, powers, etc). For example, the approach in Fitting polynomial model to data in R gives pretty bad approximations. I remember from a long time ago that there exist languages (Matlab may be one of them?) that do this kind of stuff. Can R do this as well, or am I just at the wrong place? (Background info: basically, what we need to do is find an equation for determining numbers in the second column based on the numbers in the first column; but we decide the numbers ourselves. We have an idea of how we want the curve to look like, but we can adjust these numbers to an equation if we get a better fit. It's about the pricing for a product (a cheaper alternative to current expensive software for qualitative data analysis); the more 'project credits' you buy, the cheaper it should become. Rather than forcing people to buy a given number (i.e. 5 or 10 or 25), it would be nicer to have a formula so people can buy exactly what they need - but of course this requires a formula. We have an idea for some prices we think are ok, but now we need to translate this into an equation.

    Read the article

  • Using AMQP to collect events

    - by synapse
    Does AMQP has any advantages over an ad-hoc implementation for a simple stats gathering scenario? It works like this - clients send events (more than we care to put into persistent storage) to (several) web workers, the workers aggrregate them and write to a single database. I don't think I should consider using AMQP for this because I'll still need web workers to receive events from clients through HTTP and to publish them. Am I missing something?

    Read the article

  • Grails unit testing and bootstrap

    - by tbruyelle
    I wrote an unit test for a controller. I have a Bootstrap file which alter the metaclass of domain classes by adding a method asPublicMap(). I use this method in the controller to return domain classes as json but only some selected public fields. My unit test failed because of MissingMethodException for asPublicMap(). As I understood, bootstrap classes are not loaded for unit tests, only for integration tests. That's why I got this error. My question is : Is there another place to put metaclass manipulation in order to take them into account during unit tests ?

    Read the article

  • Android: Get the X and Y coordinates of a TextView?

    - by Jep Knopz
    I am working now on a project. I have 2 draggable textView in a circle. I want to add those value inside the circle when the circle is drag over the other circle. the first option that I have is to get the X and Y of the circle, but I get it. Can anyone fix my code? Here is the Code: MainActivity public class MainActivity extends Activity { int windowwidth; int windowheight; TextView bola; TextView bola2; private float x; private float y; private android.widget.RelativeLayout.LayoutParams layoutParams; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); windowwidth = getWindowManager().getDefaultDisplay().getWidth(); windowheight = getWindowManager().getDefaultDisplay().getHeight(); bola = (TextView) findViewById(R.id.ball); bola2 = (TextView) findViewById(R.id.ball2); bola2.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub layoutParams = (RelativeLayout.LayoutParams) bola2 .getLayoutParams(); switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: break; case MotionEvent.ACTION_MOVE: int x_cord = (int) event.getRawX(); int y_cord = (int) event.getRawY(); if (x_cord > windowwidth) { x_cord = windowwidth; } if (y_cord > windowheight) { y_cord = windowheight; } layoutParams.leftMargin = x_cord - 25; layoutParams.topMargin = y_cord - 75; bola2.setLayoutParams(layoutParams); break; default: break; } return true; } }); bola.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { layoutParams = (RelativeLayout.LayoutParams) bola .getLayoutParams(); switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: break; case MotionEvent.ACTION_MOVE: int x_cord = (int) event.getRawX(); int y_cord = (int) event.getRawY(); if (x_cord > windowwidth) { x_cord = windowwidth; } if (y_cord > windowheight) { y_cord = windowheight; } layoutParams.leftMargin = x_cord - 25; layoutParams.topMargin = y_cord - 75; bola.setLayoutParams(layoutParams); break; default: break; } // TODO Auto-generated method stub return true; } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; }} Activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:id= "@+id/ball" android:background="@drawable/bgshape" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1" tools:context=".MainActivity" /> <TextView android:id= "@+id/ball2" android:background="@drawable/bgshape" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2" tools:context=".MainActivity" android:layout_x="60dp" android:layout_y="20dp" /> The bgshape.xml(for the circle) <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <padding android:bottom="20dp" android:left="25dp" android:right="25dp" android:top="20dp" /> <stroke android:width="2dp" android:color="#000000" /> <solid android:color="#ffffff" /> <corners android:bottomLeftRadius="30dp" android:bottomRightRadius="30dp" android:topLeftRadius="30dp" android:topRightRadius="30dp" /> This code works well. Could anyone fix this so that I can add the value inside the circle when they hit each other?

    Read the article

  • LOAD DATA INFILE with variables

    - by Hasitha
    I was tring to use the LOAD DATA INFILE as a sotred procedure but it seems it cannot be done. Then i tried the usual way of embedding the code to the application itself like so, conn = new MySqlConnection(connStr); conn.Open(); MySqlCommand cmd = new MySqlCommand(); cmd = conn.CreateCommand(); string tableName = getTableName(serverName); string query = "LOAD DATA INFILE '" + fileName + "'INTO TABLE "+ tableName +" FIELDS TERMINATED BY '"+colSep+"' ENCLOSED BY '"+colEncap+"' ESCAPED BY '"+colEncap+"'LINES TERMINATED BY '"+colNewLine+"' ("+colUpFormat+");"; cmd.CommandText = query; cmd.ExecuteNonQuery(); conn.Close(); The generated query that gets saved in the string variable query is, LOAD DATA INFILE 'data_file.csv'INTO TABLE tbl_shadowserver_bot_geo FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '"'LINES TERMINATED BY '\n' (timestamp,ip,port,asn,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,url,agent,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy); But now when i run the program it gives an error saying, MySQLException(0x80004005) Parameter @dummy must be defined first. I dont know how to get around this, but when i use the same query on mysql itself directly it works fine. PLEASE help me..thank you very much :)

    Read the article

  • Httpsession with Spring 3 MVC

    - by vipul12389
    I want to use httpsession in Spring 3 MVC..i have searched all the web and got this solution..at http://forum.springsource.org/showthread.php?98850-Adding-to-stuff-to-the-session-while-using-ResponseBody Basically, My application auto authenticates user by getting winId and authorizes through LDAP..(Its a intranet site) Here is the flow of the application, 1. User enters Aplication url (http://localhost:8082/eIA_Mock_5) it has a welcome page (index.jsp) Index.jsp gets winId through jQuery and hits login.html (through Ajax) and passes windowsId login.html (Controller) authenticates through LDAP and gives back 'Valid' String as a response javascript, upon getting the correct response, redirects/loads welcome page i.e. goes to localhost:8082/eIA_Mock_5/welcome.html Now, i have filter associated with it..which checks for is session valid for each incoming request..Now the problem is even though i set data on to httpsession, yet the filter or any other controller fails to get the data through session as a result it doesnt proceeds further.. here is the code..and could you suggest what is wrong actually ?? Home_Controller.java @Controller public class Home_Controller { public static Log logger = LogFactory.getLog(Home_Controller.class); @RequestMapping(value={"/welcome"}) public ModelAndView loadWelcomePage(HttpServletRequest request,HttpServletResponse response) { ModelAndView mdv = new ModelAndView(); try{ /*HttpSession session = request.getSession(); UserMasterBean userBean = (UserMasterBean)session.getAttribute("userBean"); String userName=userBean.getWindowsId(); if(userName==null || userName.equalsIgnoreCase("")) { mdv.setViewName("homePage"); System.out.println("Unable to authenticate user "); logger.debug("Unable to authenticate user "); } else { System.out.println("Welcome User "+userName); logger.debug("Welcome User "+userName); */ mdv.setViewName("homePage"); /*}*/ } catch(Exception e){ logger.debug("inside authenticateUser ",e); e.printStackTrace(); } return mdv; } @RequestMapping(value = "/login", method = RequestMethod.GET) public @ResponseBody String authenticateUser(@RequestParam String userName,HttpSession session) { logger.debug("inside authenticateUser"); String returnResponse=new String(); try{ logger.debug("userName for Authentication "+userName); System.out.println("userName for Authentication "+userName); //HttpSession session = request.getSession(); if(userName==null || userName.trim().equalsIgnoreCase("")) returnResponse="Invalid"; else { System.out.println("uname "+userName); String ldapResponse = LDAPConnectUtil.isValidActiveDirectoryUser(userName, ""); if(ldapResponse.equalsIgnoreCase("true")) { returnResponse="Valid"; System.out.println(userName+" Authenticated"); logger.debug(userName+" Authenticated"); UserMasterBean userBean = new UserMasterBean(); userBean.setWindowsId(userName); //if(session.getAttribute("userBean")==null) session.setAttribute("userBean", userBean); } else { returnResponse="Invalid"; //session.setAttribute("userBean", null); System.out.println("Unable to Authenticate the user through Ldap"); logger.debug("Unable to Authenticate the user through Ldap"); } System.out.println("ldapResponse "+ldapResponse); logger.debug("ldapResponse "+ldapResponse); System.out.println("returnResponse "+returnResponse); } UserMasterBean u = (UserMasterBean)session.getAttribute("userBean"); System.out.println("winId "+u.getWindowsId()); } catch(Exception e){ e.printStackTrace(); logger.debug("Exception in authenticateUser ",e); } return returnResponse; } Filter public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) { System.out.println("in PageFilter"); boolean flag = false; HttpServletRequest objHttpServletRequest = (HttpServletRequest)request; HttpServletResponse objHttpServletResponse = (HttpServletResponse)response; HttpSession session = objHttpServletRequest.getSession(); String contextPath = objHttpServletRequest.getContextPath(); String servletPath = objHttpServletRequest.getSession().getServletContext().getRealPath(objHttpServletRequest.getServletPath()); logger.debug("contextPath :" + contextPath); logger.debug("servletPath :" + servletPath); System.out.println("in PageFilter, contextPath :" + contextPath); System.out.println("in PageFilter, servletPath :" + servletPath); if (servletPath.endsWith("\\") || servletPath.endsWith("/") || servletPath.indexOf("css") > 0 || servletPath.indexOf("jsp") > 0 || servletPath.indexOf("images") > 0 || servletPath.indexOf("js") > 0 || servletPath.endsWith("index.jsp") || servletPath.indexOf("xls") > 0 || servletPath.indexOf("ini") > 0 || servletPath.indexOf("login.html") > 0 || /*servletPath.endsWith("welcome.html") ||*/ servletPath.endsWith("logout.do") ) { System.out.println("User is trying to access allowed pages like Login.jsp, errorPage.jsp, js, images, css"); logger.debug("User is trying to access allowed pages like Login.jsp, errorPage.jsp, js, images, css"); flag = true; } if (flag== false) { System.out.println("flag = false"); if(session.getAttribute("userBean") == null) System.out.println("yes session.userbean is null"); if ((session != null) && (session.getAttribute("userBean") != null)) { System.out.println("session!=null && session.getAttribute(userId)!=null"); logger.debug("IF Part"); UserMasterBean userBean = (UserMasterBean)session.getAttribute("userBean"); String windowsId = userBean.getWindowsId(); logger.debug("User Id " + windowsId + " allowed access"); System.out.println("User Id " + windowsId + " allowed access"); flag = true; } else { System.out.println("else .....session!=null && session.getAttribute(userId)!=null"); logger.debug("Else Part"); flag = false; } } if (flag == true) { try { System.out.println("before chain.doFilter(request, response)"); chain.doFilter(request, response); } catch (Exception e) { e.printStackTrace(); try { objHttpServletResponse.sendRedirect(contextPath + "/logout.do"); } catch (Exception ex) { ex.printStackTrace(); } } } else { try { System.out.println("before sendRedirect"); objHttpServletResponse.sendRedirect(contextPath + "/jsp/errorPage.jsp"); } catch (Exception ex) { ex.printStackTrace(); } } System.out.println("end of PageFilter"); } Index.jsp <script type="text/javascript"> //alert("inside s13"); var WinNetwork = new ActiveXObject("WScript.Network"); var userName=WinNetwork.UserName; alert(userName); $.ajax({ url : "login.html", data : "userName="+userName, success : function(result) { alert("result == "+result); if(result=="Valid") window.location = "http://10.160.118.200:8082/eIA_Mock_5/welcome.html"; } }); </script> web.xml has a filter entry with URL pattern as * I am using spring 3 mvc

    Read the article

  • Horizontally spacing a row of images evenly

    - by Tesla
    I have a few rows of images like so <div class="row"> <img src="image.jpg" alt=""> <img src="image.jpg" alt=""> <img src="image.jpg" alt=""> <img src="image.jpg" alt=""> <img src="image.jpg" alt=""> </div> Each image has a different width, and there is also a different number of images on each row (4-6). I want to space the images evenly in the row, the row has a fixed width of 960px. I could do this by calculating the total empty space for each row and then dividing it among the images for a margin, but I was hoping there was something simpler that I could apply to every row instead of having to calculate and code a separate one for each row.

    Read the article

  • OpenGL multiple threads, variable handling [closed]

    - by toeplitz
    I have written an OpenGL program which runs in the following way: Main: - Initialize SDL - Create thread which has the OpenGL context: - Renderloop - Set camera (view) matrix with glUniform. - glDrawElements() .... etc. - Swapbuffers(); - Main SDL loop handling input events and such. - Update camera matrix of type glm::mat4. This is how I pass my camera object to the class that handles opengl. Camera *cam = new Camera(); gl.setCam(cam); where void setCam(Camera *camera) { this->camera = camera; } For rendering in the opengl context thread, this happens: glm::mat4 modelView = camera->view * model; glUniformMatrix4fv(shader->bindUniform("modelView"), 1, GL_FALSE, glm::value_ptr(modelView)); In the main program where my SDL and other things are handles I then recompute the view matrix. This his working fine without me using any mutex locks. Is this correct? On the other hand, I add objects to my scene by an "upload queue" and in this case I have to mutex lock my upload queue vector (vector class type) when adding items to it or else the program crashes. In summary: I recompute my matrix in a different thread and then use it in the opengl thread without any mutex lock. Why is this working? Edit: I think my question is similar to what was asked here: Should I lock a variable in one thread if I only need it's value in other threads, and why does it work if I don't?, only in my case it is even more simple with only one matrix being changed.

    Read the article

  • Symfony2 and RabbitMqBundle. Can`t publish a message

    - by Gabriel Filipiak
    I am trying to use syfmony2 framework with RabbitMqBundle from here: https://github.com/videlalvaro/RabbitMqBundle I am sure that my rabbitmq server is up and running and I am doing the configuration and publishers code accordingly to the docs delivered on github. Unfortunately I can`t add any message to the queue. I am sure that my rabbitmq server is up and running. I have queue named accordingly to the symfony configuration file. Have anyone got any clue what is wrong? Thanks in advance for any suggestions.

    Read the article

  • Dojo's nested BorderContainer disappear in IE

    - by h4b0
    I have this terrible problem with IE 7/8/9. I wrote an app using Dojo toolkit 1.8.0 and Play! framework. It works fine in all browser except for IE. Its 'developers tools' show no error, so does firebug. The problematic code section is here: <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline'"> <div data-dojo-type="dijit.layout.ContentPane" id="head" region="top"> </div> <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region: 'center'"> <div data-dojo-type="dijit.layout.ContentPane" id="menu" region="left"> </div> <div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region: 'center'"> <div data-dojo-type="dijit.layout.ContentPane" id="content_1" region="top"> </div> <div data-dojo-type="dijit.layout.ContentPane" id="content_2" region="bottom"> </div> </div> </div> <div data-dojo-type="dijit.layout.ContentPane" id="foot" region="bottom"> </div> </div> The result, in all browsers except for IE is like that: But in IE it is shown like that: Can anyone explain why there are such differences? At first I thought that in IE content is hidden, so I set overflow: auto, but no scrollbar appeared after page load.

    Read the article

  • Any particular reason why FaceBook's Subscribe Button isn't showing on my web page?

    - by Axonn
    I got this FaceBook profile for my upcoming website and I can't get the Subscribe button to show, NOT EVEN ON FaceBook's page! http://www.facebook.com/profile.php?id=100003492130845 Now, if you go here on FaceBook's page where we build the Subscribe button: http://developers.facebook.com/docs/reference/plugins/subscribe/ And add the above link, it will show nothing. I enabled subscribing and I also created myself a page, linked to the same profile: http://www.facebook.com/pages/Axonn-Says/372194956141393 But not even the page works ::- /. LATER EDIT: I temporarily added 2 other Subscribe buttons on my website to demonstrate that it works for example for Mark Zuck's page and to demonstrate that there are no JS conflicts. The 2 buttons appeared ok, but my button still didn't show up.

    Read the article

  • Reintegrate a branch with externals fails in SVN

    - by dnndeveloper
    What I am doing: Apply external properties to a folder in the trunk (both single file and folder external, externals are binary files) Create a branch from the trunk and update the entire project Modify a file on the branch and commit the changes, then update the entire project. Merge - "Reintegrate a branch" when I get to the last screen I click "test merge" and get this error: Error: Cannot reintegrate into mixed-revision working copy; try updating first I update the entire project and still the same error. Other observations: If I "Merge a range of revisions" everything works fine. If I remove the externals everything works fine using either "Merge a range of revisions" or "Reintegrate a branch". How do I solve this issue? I am using Subversion 1.6.6 with TortoiseSVN 1.6.6.

    Read the article

  • How can I use SCM on linked files in VS2008 projects?

    - by Tom Bushell
    Background: I'm using Visual-SVN V. 1.7.5 with VS2008. I'm fairly new to SVN. I have a Solution that uses source files that will be shared with other Solutions. I've put these files in a folder called "Shared", and added them to my Solution using "Add - Existing Item... - Add As Link" which works fine as far as VS2008 is concerned. But when I try to add the linked files to SVN using the "Add to Suversion" menu item on the file's context menu, I get a warning: "...not added to Subversion because it is out of working copy. Please setup working copy root using Visual SVN - Set Working Copy Root menu". I tried this, but this seems to change the root directory of the whole solution - not what I want to do. Googling and searching SO indicates that I may want to set up some SVN Externals. I tried to follow the examples, using the command line for the first time with Visual-SVN. But I just got a bunch of error messages I didn't understand. Questions: Are Externals the way to go here? If so, can someone provide some detailed, step-by-step help on how to do this with Visual-SVN?

    Read the article

  • Sparse checkouts and svn:externals

    - by JesperE
    I'm trying to do a sparse checkout of a folder containing externals, but none of the externals are being checked out. This issue seems to indicate that this behavior may be by design, or at least that it isn't clear what the behavior should be. From my point of view, the obvious behavior is that externals are treated just as any other directory, and checked out following the same sparse checkout rules. Is there a way to work around this except manually checking out the externals?

    Read the article

  • Stop YOUR emails from starting those company-wide Reply All email threads

    - by deadlydog
    You know you’ve seen it before; somebody sends out a company-wide email (or email to a large diverse audience), and a couple people or small group of people start replying-all back to the email with info/jokes that is only relative to that small group of people, yet EVERYBODY on the original email list has to suffer their inbox filling up with what is essentially spam since it doesn’t pertain to them or is something they don’t care about. A co-worker of mine made an ingenious off-hand comment to me one day of how to avoid this, and I’ve been using it ever since.  Simply place the email addresses of everybody that you are sending the email to in the BCC field (not the CC field), and in the TO field put your email address.  So everybody still gets the email, and they are easily able to reply back to you about it.  Note though, that the people you send the email to will not be able to see everyone else that you sent it to. Obviously you might not want to use this ALL the time; there are some times when you want a group discussion to occur over email.  But for those other times, such as when sending a NWR email about the car you are selling, asking everyone what a good local restaurant near by is, collecting personal info from people, or sharing a handy program or trick you learnt about (such as this one ), this trick can save everybody frustration and avoid wasting their time.  Trust me, your coworkers will thank you; mine did

    Read the article

  • Build & Deployment Guide for Service Bus Relay Project

    - by Michael Stephenson
    Ive recently published a sample guide based on a real-world project where we implemented an on-premise WCF routing solution to connect SAAS applications to our on premise line of business applications. The guide will discuss: How we configured and setup the infrastructure How we setup the on-premise server to listen to the service bus What software we used How we configured Windows Azure This contains some useful contextual information around the reference scenario and hopefull this will be very useful to others undertaking similar projects. Ive also included this on the technet wiki page for Windows Azure Service Bus resources: http://social.technet.microsoft.com/wiki/contents/articles/13825.windows-azure-service-bus-resources.aspx

    Read the article

  • WCF Routing Service Filter Generator

    - by Michael Stephenson
    Recently I've been working with the WCF routing service and in our case we were simply routing based on the SOAP Action. This is a pretty good approach for a standard redirection of the message when all messages matching a SOAP Action will go to the same endpoint. Using the SOAP Action also lets you be specific about which methods you expose via the router. One of the things which was a pain was the number of routing rules I needed to create because we were routing for a lot of different methods. I could have explored the option of using a regular expression to match the message to its routing but I wanted to be very specific about what's routed and not risk exposing methods I shouldn't via the router. I decided to put together a little spreadsheet so that I can generate part of the configuration I would need to put in the configuration file rather than have to type this by hand. To show how this works download the spreadsheet from the following url: https://s3.amazonaws.com/CSCBlogSamples/WCF+Routing+Generator.xlsx In the spreadsheet you will see that the squares in green are the ones which you need to amend. In the below picture you can see that you specify a prefix and suffix for the filter name. The core namespace from the web service your generating routing rules for and the WCF endpoint name which you want to route to. In column A you will see the green cells where you add the list of method names which you want to include routing rules for. The spreadsheet will workout what the full SOAP Action would be then the name you will use for that filter in your WCF Routing filters. In column D the spreadsheet will have generated the XML snippet which you can add to the routing filters section in your configuration file. In column E the spreadsheet will have created the XML snippet which you can add to the routing table to send messages matching each filter to the appropriate WCF client endpoint to forward the message to the required destination. Hopefully you can see that with this spreadsheet it would be very easy to produce accurate XML for the WCF Routing configuration if you had a large number of routing rules. If you had additional methods in other services you can simply copy the worksheet and add multiple copies to the Excel workbook. One worksheet per service would work well.

    Read the article

  • MySQL not respond when overheaded

    - by Michal Gow
    I have few Drupal 6 websites on webhosting, which causes this strange problem: some tables, especially Cache and Watchdog, tend to overhead, when overhead is bigger than some amount of kB, MySQL server is refusing connection to given Drupal database or connection is broken during query execution, Optimizing table (just overheaded rows) in phpMyAdmin is putting all back to normal. But - until database is optimized, site is showing just MySQL errors, which is ugly... Where is a problem? Thank you for any hints I could pass back to the hosting admins!

    Read the article

  • Creating url from the cloudfront aws

    - by GroovyUser
    I have my js files which I have uploaded into the Amazon S3 and linked it with the Cloudfront. I got a url something like this : dxxxxxxxx.cloudfront.net But opening that url in my browser ( I'm getting an error ) : <Error> <Code>AccessDenied</Code> <Message>Access Denied</Message> <RequestId>xxxxxx</RequestId> <HostId> xxxxxxxxxxxxxxx </HostId> </Error> But what I want actually is to use the url and add them to my webpage. How could I do that? Thanks in advance.

    Read the article

  • Unable to log into samba server

    - by Paddington
    I am unable to log into a samba server (running on fedora core 6) as it prompts for a username and password when I try to connect to the mapped drives from my windows 7 machine. I decided to reset the password using the command smbpassword paddy and when I list users using check the pdbedit -L -v I see that the password was updated at the time I made this change. However, I am still unable to log in. The log file in /var/log/samba/log.paddy shows: [2012/10/11 09:55:54.605923, 1] smbd/service.c:678(make_connection_snum) create_connection_server_info failed: NT_STATUS_ACCESS_DENIED [2012/10/11 09:55:54.606635, 1] smbd/service.c:678(make_connection_snum) create_connection_server_info failed: NT_STATUS_ACCESS_DENIED How can I resolve this so that I can log in?

    Read the article

  • How to resolve virtual disk degraded in Windows Server 2012

    - by harrydev
    I am using the new Storage Spaces feature in Windows Server 2012. I have the following disks: FriendlyName CanPool OperationalStatus HealthStatus Usage Size ------------ ------- ----------------- ------------ ----- ---- PhysicalDisk2 False OK Healthy Auto-Select 2.73 TB PhysicalDisk3 False OK Healthy Auto-Select 2.73 TB PhysicalDisk4 False OK Healthy Auto-Select 2.73 TB PhysicalDisk5 False OK Healthy Auto-Select 2.73 TB There is also a separate OS disk. The above disks are part of a single storage pool: FriendlyName OperationalStatus HealthStatus IsPrimordial IsReadOnly ------------ ----------------- ------------ ------------ ---------- Pool OK Healthy False False Within this storage pool some virtual disks are defined, see below: FriendlyName ResiliencySettingNa OperationalStatus HealthStatus IsManualAttach Size me ------------ ------------------- ----------------- ------------ -------------- ---- Docs Mirror OK Healthy False 500 GB Data Mirror Degraded Warning False 500 GB Work Mirror Degraded Warning False 2 TB Now the virtual disks are all running normal 2-way mirror, but two of the virtual disks are degraded. This is probably because one of the physical disks was offline for a short period of time. However, now the virtual disk cannot be repaired, even though, all physical disks are healthy. There is plenty of available space in the storage pool. This I cannot understand so I was hoping for some help, on how to resolve this? Below I have listed the full output from the Get-VirtualDisk CmdLet for the "Work" disk: ObjectId : {XXXXXXXX} PassThroughClass : PassThroughIds : PassThroughNamespace : PassThroughServer : UniqueId : XXXXXXXX Access : Read/Write AllocatedSize : 412316860416 DetachedReason : None FootprintOnPool : 824633720832 FriendlyName : Work HealthStatus : Warning Interleave : 262144 IsDeduplicationEnabled : False IsEnclosureAware : False IsManualAttach : False IsSnapshot : False LogicalSectorSize : 512 Name : NameFormat : NumberOfAvailableCopies : 0 NumberOfColumns : 2 NumberOfDataCopies : 2 OperationalStatus : Degraded OtherOperationalStatusDescription : OtherUsageDescription : Disk for data being worked on (not backed up) ParityLayout : PhysicalDiskRedundancy : 1 PhysicalSectorSize : 4096 ProvisioningType : Thin RequestNoSinglePointOfFailure : True ResiliencySettingName : Mirror Size : 2199023255552 UniqueIdFormat : Vendor Specific UniqueIdFormatDescription : Usage : Other PSComputerName :

    Read the article

  • rename multiple files with unique name

    - by psaima
    I have a tab-delimited list of hundreds of names in the following format old_name new_name apple orange yellow blue All of my files have unique names and end with *.txt extension and these are in the same directory. I want to write a script that will rename the files by reading my list. So apple.txt should be renamed as orange.txt. I have searched around but I couldn't find a quick way to do this.I can change one file at a time with 'rename' or using perl "perl -p -i -e ’s///g’ *.txt", and few files with sed, but I don't know how I can use my list as input and write a shell script to make the changes for all files in a directory. I don't want to write hundreds of rename command for all files in a shell script. Any suggestions will be most welcome!

    Read the article

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