w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to give users a link to get profile from site?
If you using ASP.NET Membership, is very easy way to do this. HttpContext.Current.User.Identity.Name Something like this gives you a username of currently logged user. In Web Forms put the hyperlink on master page and dynamically set href and link text in code behind. In MVC Razor you can put it on layout page. In case of your own membership system, then checking for id from session, and get the user info of it's needed.

Categories : Asp Net

Ants profile shows 150 percent of CPU usage
From the Red-gate Ants FAQ: CPU usage exceeds 100% ANTS Performance Profiler analyzes CPU usage per core. So, on a quad-core machine an application taking all time on all cores would be shown as taking 400% of CPU time.

Categories : Misc

I just added some comment on welcome.jsp, spring-petclinic example give me errors. why?
If you want to make JSP comment, the correct syntax is: <%-- this is comment, which will be ignored by JSP compiler --%> You used incorrectly <jsp:attribute> tag within a standard HTML comment <!-- -->.

Categories : HTML

sqlite db usage in iphone app giving errors
In very rare instances SQLLite should be used directly. The best way to handle data storage local to an iOS device is CORE DATA. I would suggest you consider using Core Data for storage and not call or mess with SQL Lite directly.

Categories : Sqlite

IOS App Validation errors: Non Public API usage and access the UDID
I would suggest you to double check to make sure you are using latest version of Google AdMob API. I faced the similar problem in past and fixed it only by using latest Google AdMob SDK. Also, you may like to check this question.

Categories : Xcode

findContours, contourArea give errors with nested contours. "Assertion failed", "input array is not a valid matrix"
I cannot judge for the CV_EXTERNAL case. BUt in the first case the problem seems simple. for (int i = 1; i != ContourVector.size(); ++i){ if ( (contourArea(ContourVector[i])) > BiggestContourArea) { biggest = i; BiggestContourArea = contourArea(ContourVector[biggest]); } } In C++ arrays and vectors are indexed from zero. So first item in vector has index 0, and the last one has ContourVector.size() - 1. To fix you code simply change the for cycle to: for (int i = 1; i < ContourVector.size(); ++i) ....

Categories : C++

Server 2003 to Server 2008 - Multiple-step OLE DB operation errors
I finally fixed this. The solution was found in the last post of this thread: https://forums.oracle.com/thread/80441 It seems if I was using ODBC, setting the precision and scale for all the numeric parameters would have resolved the issue, however, for OLE DB this did not fix the issue. Changing all numeric parameters from adNumeric to adDouble did fix the issue. For those not wanting to venture to the Oracle forums. The first way is done like this: Set Parameter = Command.CreateParameter("inRequestType", adNumeric, adParamInput, <length>, <value>) Parameter.Precision = 10 Parameter.NumericScale = 0 Parameters.Append Parameter Doing that did not fix my issue, I had to change adNumeric to adDouble (131 to 5).

Categories : Oracle

Transfer testing server files to live server and avoid errors
The first error message is quite clear: Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/warner_walls/warnerwalls.com/advsearch.php on line 133 Of course, the local MySQL server is running? It is configured to listen for local connection on the unix socket? (check in /etc/my.cnf for the line socket=/var/run/mysqld/mysqld.sock) If you have copied all the DB files from the live server to your test platform, I assume you have copied the mysql DB files too (those that store user tables, permissions and so on). That would be confirmed when you say "that the database connection is the same for both the test server and live server". If that analysis is not totally completely stupid, my gues

Categories : PHP

web application on server won't show errors (only internal server error)
As Grant Thomas mentioned, it could be a problem with the config file itself. Easiest way I've found to determine that is to try and open up part of the configuration through IIS, then if it is an error with the config file, IIS will throw up an error dialog. So, head into IIS, select the website in question, and try to open one of the config sections, such as .Net Error Pages or Connection Strings, see if you get an error dialog appear.

Categories : C#

Uploading photo to server to use as profile picture.
This is not a complete fix but I notice a couple of things As others have suggested you are not moving the picture to a location you can access. Also: while($row = mysql_fetch_array($result)) { header("Content-type: image/jpeg"); echo mysql_result($result, 0); } Seems to be using the header() term after you have sent output to the browser. I do notice that you are using ob_start to buffer your output but don't think this will prevent unexpected results. In the same block of code you seem to be returning the entire row from the mysql result, not just the .jpg data. I suspect that this is the more likely issue since $result = mysql_query("SELECT * FROM animator.account WHERE idaccount=" . $_SESSION['idaccount'] . ";"); Is returning an array with all of the fields f

Categories : PHP

ASP.NET MVC 3 - custom Profile and persisting in State Server
The ASP.NET StateServer uses binary serialization to store any object graphs. Binary serialization requires that every object within the object graph be serializable (including object basetypes). As such marking just your custom profile class as [Serializable] will do little if the classes in its class hierarchy do not also implement [Serializable] Neither ProfileBase nor ProfileCommon implement [Serializable] as such it's not possible to store any class deriving from them within the StateServer without either copying this data over to a fully serializable class hierarchy or transforming the data into another format (e.g. XML) and serializing this. For further information: Objects stored in session state must be serializable if the mode is set to StateServer. For information on ser

Categories : Asp Net Mvc

Default profile picture in sql server using varbinary(max)
Why don't you save the default image in some images folder on your site? That way you don't have to read the database column, instead use the relative path in the image control. Try comparing if(!dt.Rows[0]["profilepicture"].Equals(DBNull.Value))

Categories : C#

Profile ADO.NET statements without access to SQL Server Profiler
There are a range of tools that do exactly this. If you are in asp.net, you may find MiniProfiler a good start (you can use it on other platforms, but the UI tooling is stronger on asp.net). The main change involved here would be to move from SqlCommand etc to use c.CreateCommand, since it works by wrapping the connection (decorator pattern) - while it is still a DbConnection, the outermost object is not a SqlConnecion any more. I have to say, though - in this particular example you already know the exact command sent to the server. It is useful for finding the surprises, though. If that doesn't suit, "Hibernating Rhinos" offer a range of profiling tools, and many Orpheus general-purpose profiling tools will include ado.net tools; the main reason I mention MiniProfiler is that is is free,

Categories : C#

wso2 esb bam server profile in governance registry
Your approach is the correct way. By default BAM server profiles and stream configurations are designed only to be stored in config registry. It is not possible to store in governance registry. In future releases we will store all configurations in a deployable artifact which will easily deployment synchronized over other nodes.

Categories : Wso2

What slows down Java if CPU usage low, hdd usage low, memory usage low?
You can test what is the bottle neck by taking different parts out of the equation. To take out the CPU, just read the files and don't do anything else. To take out the disk, keep reading the same file again and again, assuming it fits in your file cache. Compare this to the time for everything.

Categories : Java

How to create Profile user page using asp.net mvc 4 with sql server 2008?
The problem is not SQL Server 2008, the problem is that you're returning zero or more entities that match the user's id. You need to add FirstOrDefault() to your query so you're not returning a IEnumerable<M_cp_Customer> but a single M_cp_Customer entity. public ActionResult Index(LoginModel model) { M_cp_Customer m_cp_customer = (from cp in db.M_cp_Customer.Include(m => m.User) where cp.Id == model.Id select cp).FirstOrDefault(); return View(m_cp_customer); }

Categories : Asp Net Mvc

Response from server NSDate give me always - 8 hrs
Of corse they have a formatting. The same point in time (the same NSDate) could look different when shown in different time zones. NSLog uses GMT, perhaps you could add some sample code to you question and tell us in which time zone you live in? See also WWDC 2011 Session 117: Performing Calendar Calculations. (Apple Developer Account required)

Categories : Iphone

load balancing IBM Liberty profile with apache http server
Currently, you'll have to generate a plugin-cfg.xml from each liberty server (the license has info about how many servers you can aggregate in this way for load balancing and failover) and merge the result to make it appear like a cluster to the WAS Plugin. Other editions provide a merge tool, if you have access to them. The WAS plugin installation has an XSD file for the plugin-cfg.xml. 1) note the http and https transports in both plugin configurations 2) make a copy of one of the XML's to edit 3) Find the <ServerCluster <Config... <ServerCluster CloneSeparatorChange="false" GetDWLMTable="false" IgnoreAffinityRequests="true" LoadBalance="Round Robin" Name="cluster1" PostBufferSize="64" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60" ServerIOTimeoutRetr

Categories : Apache

Give authetication to a file in tomcat server
Suppose you have this project structure: And you want to secure the /folder to be only accessible to the role admin you have to edit your web.xml to this: <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <session-config> <session-timeout> 30 </session-timeout> </session-config> <security-constraint> <display-name>Constraint1</display-name> <web-resource-collection> <web-resource-name>file</web-resource-name> <description/

Categories : Tomcat

SQL Server can we same give identity colum for two or more tables
For that you have to manage yourself. Because SQL Server does not know about your requirement that, if one table ended with 1001 and start a new identity on another table from 1002. SQL Server Identity syntax is IDENTITY [ ( seed , increment ) ] Which means, each time when you insert an new row it see an Last Seeeed and the Increment it by the value you set up earlier while designing your table. So, if you want to do so then, Insert all the rows from Excel to SQL Server. Then, Before starting to insert the rows in Next table, Get the Last Seeed value of previous table. Then, you can use that value to insert. But this is very Bad Solution you know In my case what i would do is. I just setup an Counter Variable in my application which take care of the Row Position, and i'd simply insert t

Categories : Dotnet

SQL Server: usage of cursor inevitable here?
In T-SQL: Begin Transaction While Exists (Select * From Table where CharIndex(';', column_A) > 0) Begin Insert Table(column_A) Select Left(column_A, charIndex(';', column_A)-1) Where charIndex(';', column_A) > 0 -- next 3 lines only if you want to avoid duplicates And Not exists (Select * From table Where column_A = Left(column_A, charIndex(';', column_A)-1)) Update Table set column_A = substring(columnA, 1+charIndex(';', column_A), len(column_A) - charIndex(';', column_A)) From table Where charIndex(';', column_A) > 0 End Commit Transaction

Categories : Sql Server

Reset SQL Server Index usage
What do you mean by reset .. do you want to reset the index usage statistics in the table? Taken from Here Usage statistics: These are found in sys.dm_db_index_usage_stats. Index usage statistics keep track of things like seeks and scans from SELECT queries. They are not persisted and get reset on restart of sql server. These statistics also get reset if the underlying index is rebuilt "ALTER INDEX ... REBUILD", but not with "ALTER INDEX ... REORG" As said, you can't reset it manually. Take a look at this post which certainly says the same http://social.msdn.microsoft.com/Forums/sqlserver/en-US/08eb7b79-64a3-4475-bfc3-69715aec8381/resetting-dmdbindexusagestats-without-restarting-or-detaching-a-database

Categories : Sql Server

SQL Server memory usage monitoring
Task manager shows 8GB memory usage because that's how much it is actually using. SQL Server, by design, never releases the memory that it grabs. It caches all the data that it has ever fetched from the disk and keeps it in memory so that the next query is much faster. Even if there are no connections, SQL Server will hold on to all its data so that the next connection will not have to go back to the disk to get data.

Categories : Sql Server

How to troubleshoot 100% CPU usage issue with a TCP server?
If you add a Thread.Sleep() to the end of the following loop, does that stop the 100% cpu? while (true) { // Set the event to nonsignaled state. allDone.Reset(); // Start an asynchronous socket to listen for connections. listener.BeginAccept(new AsyncCallback(AcceptCallback), listener); // Wait until a connection is made before continuing. allDone.WaitOne(); Thread.Sleep() //This makes the thread wait for its next timeslice //Thread.Yield() //This makes the thread wait on another change to run from the OS wich might be much faster then Thread.Sleep(). }

Categories : C#

RAM usage issue in window server with MongoDB and C#
As far as I know, the LINQ provider doesn't support .Equals() and it may need to execute it in memory. Also as a style guideline I wouldn't usually mix LINQ query syntax with LINQ extension method style as you have done and prefer to be consistent. In any case I would suggest changing your query to the following: result = collection.AsQueryable<FullTune>() .Where(ft => ft.Letter == Letter.ToUpper() && ft.Styles == Style) .OrderBy(ft => ft.Title) .Take(50);

Categories : C#

How to get MS SQL SERVER Database wise CPU usage report
Not sure if this is possible but I’d try looking at some of the third party monitoring tools and trying to reverse engineer how its done. Red gate has a tool you can check out but I’m sure there are many others as well

Categories : Sql Server

How to make "HTTS redirect" work on WebSphere Application Server Liberty Profile?
I suspect the problem is in your security-constraint. Looking at it I would suggest changing your url-pattern to be: /helloworld rather than: /Hello If you want to match multiple resources you can use wildcards such as: /* - matches everything /helloworld/* - matches everything that has helloworld/ in the url path *.jsp - matches all files with a jsp extension

Categories : Ssl

iOS Facebook get user's profile image randomly opens profile homepage instead of permission dialog
This is how I would collect the User Profile picture, although there are plenty of ways to do this: I would use a notification (or any other method) to notify once the user is signed in, then call a method to collect the Facebook Profile picture. Once they are logged in you can pass their facebook Id to a value. (kUserFacebookIDKey) NSLog(@"Downloading user's profile picture"); // Download user's profile picture NSURL *profilePictureURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?type=large", self.kUserFacebookIDKey]; NSURLRequest *profilePictureURLRequest = [NSURLRequest requestWithURL:profilePictureURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0f]; // Facebook profile picture cache policy: Expires in 2 weeks [NSURLCo

Categories : IOS

c# connecting to Active Directory over ssl give ldap server unavailable
LdapConnection ldapConnection = new LdapConnection(server + ":" + port); ldapConnection.AuthType = AuthType.Basic; ldapConnection.Credential = new System.Net.NetworkCredential(username, password); ldapConnection.SessionOptions.ProtocolVersion = 3; if (sslEnabled) { ldapConnection.SessionOptions.SecureSocketLayer = sslEnabled; } This is what I did and I am able to connect to AD over SSL. You said you have Java program connecting to the same server over SSL. Are you running the Java program from the same machine as your c#? if not and in case of a self signed certificate in AD, install that certificate in your client machine and try.

Categories : Dotnet

JavaScript, post, button will not give server response until the second click
Okay, so here is what your addBtnClickListener function does: Prevents default action to run (form submission, file upload window opening) Run this function one more time Remove this event listener from the clicked element Log stuff Form submission works the second time because first time, at step 3 you remove this event handler which actually prevents form submission. If you don't wanna prevent default behavior like form submitting, file upload dialog opening, etc. then you should not use e.preventDefault(). Possible solution: function addBtnClickListener(e) { // the code below will be executed, before the form is submitted // no need for other action if this is all we do var eventType = "button.click"; var ctrBtnText = this.value; track(this, eventType, '', ''

Categories : Javascript

Why does XCode switch the profile from automatically selected one to the iOS Team Profile
After much nashing of teeth and hair pulling finally tracked down the cause of this, dont you just love xcode error msgs. Although the correct mobile provision was automatically selected in Debug line of the code signing section, the sub selection line "Any iOS SDK" had the team profile selected somehow. Changing this to match the automatic selection solved the problem.

Categories : Iphone

How to display profile friends' avatars of a specific profile user?
I suppose that fid in user_friends table is related to an user_accounts id select ua.avatars from user_friends uf inner join user_accounts ua on uf.fid = ua.id inner join pages p on p.uid = uf.uid where p.pid = <somepid> or probably clearer select ua.avatars from pages p inner join user_friends uf on uf.uid = p.uid inner join user_accounts ua on ua.id = uf.fid where p.pid = <somepid>

Categories : Mysql

XCode--When do I sign with developer provisioning profile vs distribution profile?
Failed to get task sounds like you're trying to run this build via Xcode on device. If that's the case, you want to use a development profile, not a distribution profile (AdHoc). If you're attempting to create an enterprise release build, you'll want to select your target and choose the iOS device option, then use Product > Archive to create a release build.

Categories : IOS

RAM usage limit for .NET applications on Windows Server 2012?
It's not a question of "why is the server swapping" so much as "why is my app eating so much RAM?" STRONG SUGGESTION: Download the Microsoft CLR profiler: http://www.microsoft.com/en-us/download/details.aspx?id=16273 http://msdn.microsoft.com/en-us/library/ff650691.aspx To your original question "Why does the server use swap even if it should have plenty of free RAM?" - there are many possible reasons. You'll need to have administrative access to the server to determine exactly what's going on. These links might help: http://serverfault.com/questions/305295/why-does-windows-2008-use-swap-before-the-memory-is-full http://blogs.technet.com/b/askperf/archive/2008/03/25/lock-pages-in-memory-do-you-really-need-it.aspx <= You need to consider not just your app, but other things runn

Categories : C#

Decode a high profile H.264 stream to baseline profile
The Profile is an encoding setting, not a decoding setting. If you have a video in Main profile, and want it in Baseline, you must decode then re-encode (This is call transcode). The problem is that your device can not decode Main profile in hardware. You can decode in software, but that will likely be slow (possibly slower than real time) and kill the battery. You best bet is it transcode the video first on a PC, or a cloud transcoding service before sending to the device.

Categories : Android

What is the primary usage of upstream messaging in GCM Cloud Connection Server?
According to the docs, there is no such feature to delete messages from the GCM server. The upstream feature serves only for delivering messages from the device to your 3rd-party server. The advantages of using device to cloud messaging instead of establishing your own connection between your app and your server is improving battery life. It's also supposed to be faster than the regular GCM (since it's asynchronous). Some of the benefits of CCS include: The asynchronous nature of XMPP allows you to send more messages with fewer resources. Communication is bidirectional—not only can the server send messages to the device, but the device can send messages back to the server. You can send messages back using the same connection used for receiving, thereby improving battery

Categories : Android

do we need to add provision at server end so that file downloading in browser can give facility for suspend and resume?
If you want to support suspend and resume, you'll need to add support for partial GETs, also referred to support for ranges or range headers. RFC2616 (section 14.35) has the details on how to handle range requests. http://tools.ietf.org/html/rfc2616#section-14.35 Tomcat's default servlet has an implementation you can use as a starting point if you wish. http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?view=annotate

Categories : Java

Meteor server-side memory usage for thousands of concurrent users
Take a look at this post by Arunoda at his meteorhacks.com blog: http://meteorhacks.com/making-meteor-500-faster-with-smart-collections.html which talks about his Smart Collections page: http://meteorhacks.com/introducing-smart-collections.html He created an alternative Collection stack which has succeeded in it's goals for speed, efficiency (memory & cpu) and scalability (you can see a graphed comparison in the post). Admittedly in his tests RAM usage was negligent with both Collection types, although the way he's implemented things there should be a very obvious difference with the type of use case you mentioned. Also, you can see in this post on meteor-core: https://groups.google.com/d/msg/meteor-core/jG1KLObX1bM/39aP4kxqWZUJ that the Meteor developers are aware of his work and

Categories : Meteor

CPU usage not maximized and high synchronization in server app relying on async/await
It sounds like your server is almost completely asynchronous (async MSMQ, async DB, async HttpClient). So in that case I don't find your results surprising. First, there is very little CPU work to do. I'd fully expect each of the thread pool threads to sit around most of the time waiting for work to do. Remember that no CPU is used during a naturally-asynchronous operation. The Task returned by an asynchronous MSMQ/DB/HttpClient operation does not execute on a thread pool thread; it just represents the completion of an I/O operation. The only thread pool work you're seeing are the brief amounts of synchronous work inside the asynchronous methods, which usually just arrange the buffers for I/O. As far as throughput goes, you do have some room to scale (assuming that your test was floodin

Categories : C#

Executing rails server not working on windows, shows "usage" text
Is this a permissions problem? You can run ls -l on the directory to check you permissions access To give read write and execute for all files use chmod -R <permissionsettings> <dirname> 777 means all permissions

Categories : Ruby On Rails



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.