w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Visual Studio 2005 Reports and Windows 7
You say a report and then say that it is a whole site? Why not run a second site in tandom? Make a whole new site and name it differently like http:// (servername)/Reports2012 Then put reports there. You cannot open a converted report in a site that is for a prior version, you can view it in Microsoft Business Intelligence Studio, BIDS, which is an add on to Visual Studio. If you can upgrade but cannot view it there, there is something wrong with the language file potentially. I would then make a copy of it in the old 2005 BIDS, then take that copy and see if you can upgrade that and if it will work. If that STILL does not work you could make a test report in BIDS 2010(SQL 2012 works on VS 2010, yes weird but true) to assure you can create reports there. Many times people try to

Categories : Visual Studio 2010

wrong windows.h when migrating from VS 2005 to VS 2012
Some how in the course of installing and migrating, VS2012 copied in some settings from VS 2005. The fix was in VS 2012 Open Property Manager Open Microfoft.Cpp.Win32.user right click menu 'Properties' edit Common Properties->VC++ Directories->Include Directories remove the stale references to VS2005 dir.

Categories : Visual Studio 2012

Cannot authenticate against Windows domain using ColdFusion 10, IIS 7.5, LDAP
After much ado, I found the answer here: What are the proper permissions for ColdFusion 9 on IIS 7.5 with Windows Authentication I needed to give the domain users (which is just a very large A/D group) read-only access to the config folder under the CF10 install location. From then on, it worked great!

Categories : Authentication

hosting win32 into wpf not working in windows 7
I found the way why it's not hosting to windowsFormsHost. It's because _process.MainWindowHandle is 0. So we need to wait until the Process finish and we can insert it to WindowFormHost. _process.WaitForInputIdle(); not efficient to wait Process finish. So I need to make thread sleep while _process.MainWindowHandle is 0. while (process.MainWindowHandle == IntPtr.Zero) { Thread.Sleep(100); process.Refresh(); } Just like this answer: c# MainWindowHandle always zero

Categories : C#

Hosting a Git repository on an AWS Windows Server
Make sure ports 9418 and 22 are open in your SG, not just your windows firewall. Keep in mind that the default SG is setup to deny all traffic, so ensure that you select SSH from Create A New Rule and ensure that the CIDR specified matches your CIDR, or alternatively for everyone. For your git protocol port, create a custom rule with 9418 as the port and the source as specified in your SSH selection. If that doesn't resolve the issue double or triple check your security group (make sure you hit apply rule!), if possible post your rules. There is a good chance something in the SG is causing the issue.

Categories : GIT

ColdFusion 8 to ColdFusion 10 Migration: CFloginUser Not Working As Expected
ColdFusion 10 Application Based User Security Is Broken I have deployed two test sites, using Adobe's own example code for application based user security, copied in its entirety from the Adobe website. One test site is in ColdFusion 8, one is ColdFusion 10. The code and databases are identical on both sites. I added cfdump output to monitor session variables and login status as they are set. Test Site ColdFusion 8: http://cf8loginadobe.cimhost.com/securitytest.cfm Test Site ColdFusion 10: http://cf10loginadobe.cimhost.com/securitytest.cfm Logging in using a user of "Bob" and password of "secret" demonstrates the failure in CF10. Initially it appears login was successful, but note that the cfdump of the session does not show a cfauthorization_orders value in CF10, where in CF8 the val

Categories : Iis

Self-hosting ASP.NET Web-Api as Windows Service with Controllers in different project within solution
MapHttpRoute is for controllers, derived from ApiController only. HomeController is derived from Controller, so it can't be mapped in this way.

Categories : C#

Cheap SSL certification for an app hosted on Heroku
We've installed our SSL certificate on a DigitalOcean.com instance running Nginx as a reverse proxy. Trade-offs include a bump in latency and paying for bandwidth overages but those haven't been issues for us. Here is a basic Nginx config similar to ours: server { listen 80; rewrite ^ https://www.example.com$request_uri? permanent; } # HTTPS server server { listen 443; ssl on; ssl_certificate /root/example.crt; ssl_certificate_key /root/example.key; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; ssl_prefer_server_ciphers on; location / { proxy_pass https://example.herokuapp.com/; } } This is a basic example and could be made a little more secure (po

Categories : Ruby On Rails

Email not sending with PHP phpmailer or mail() function on GoDaddy Windows hosting
Same host, this worked for me : $mail = 'yourmail.domain.com'; $info = "Message for the mail"; $info = wordwrap($info, 70); mail($mail, 'Subject', $info); $message .= "The mail has been send. <br />"; I forgot if I had to change anything to the permissions though. Been a while, but maybe it helps.

Categories : PHP

Optimization: Expensive branching vs cheap comparison
The algorithm is mostly comparisons. The only explicit branch is when returning. The gains is mostly from avoiding a costly division per digit which could take over 100 clock cycles each. One could make a case that since the max uint64_t value has 22 decimal digits that unrolling the loop into 22 comparisons would have been the most efficient way.

Categories : C++

IIS hosting for WCF service with 2 contracts or hosting 2 services with dependencies
I couldn't find a way to solve the problem, except using WCF extensibility points. I used Microsoft.Practices.Unity to manage the services through IoC, then used the Factory property in the .svc file.

Categories : C#

Umbraco 6 MVC on 1&1 (1and1) shared Windows hosting returns encoding error, appears to be related to gzip
You should probably enable gzip in your web.config <system.webServer> <httpCompression directory="%SystemDrive%inetpub tempIIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%system32inetsrvgzip.dll"/> <dynamicTypes> <add mimeType="text/*" enabled="true"/> <add mimeType="message/*" enabled="true"/> <add mimeType="application/javascript" enabled="true"/> <add mimeType="*/*" enabled="false"/> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true"/> <add mimeType="message/*" enabled="true"/> <add mimeType="application/javascript" enabled="true"/> <add mimeType="*/*" enabled="false"/> </staticTypes> </ht

Categories : Asp Net Mvc

Private key security in windows certificate store
As "SLanks" link explains, the private keys are encrypted with the user's password or the machines's password (depends on the location of the keys in the store). Therefore, anyone who can log to the machine can obtain to this user's keys and anyone who has access to the machine can obtain keys stored for the local machine.

Categories : Windows

Hosting WCF Service in a Windows Service - and start some stuff at the beginning
Whether this is viable in your circumstance or not will depend on your service design but the two general approaches I would consider for exposing service A to B with the overall design you've presented: pass a reference to the main service instance to the WCF / monitoring service in the constructor if using something like Castle Windsor, register your main service as a singleton so the monitoring service can access the main service instance from various points It's fine It's not necessary at all, but depending on the nature of the main service it might make sense to expose the monitoring functionality in a consistent manner with the primary functionality.

Categories : C#

C# Windows forms Blink label
As discussed in the comments, here is the basics for painting a rectangle onto your form (from this article): using System; using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApplication5 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } // Get your rectangle size from your text box Rectangle tbSize = new Rectangle(10, 10, 50, 20); // invalSize must be slightly bigger due to where the lines are drawn Rectangle invalSize = new Rectangle(10, 10, 51, 21); Timer _timer = new Timer(); bool painting = true; private void Form1_Load(object sender, EventArgs e) { this._timer.Interval = 1000; this._timer.Enabled

Categories : C#

How do you add a string to a Windows Form Label?
Disclaimer: I'm not a C++/CLI wizard. I believe you are looking for something like this: String^ GetSomething() { Int32 id = 0; array <String^>^ Blah = gcnew array<String^>{"test", "fasf", "hhcb"}; return Blah[id]; } You are trying to mix CLI and non-CLI code. Windows Forms uses CLI. Do not use std::string. Instead use System::String (my code assumes that you have using namespace System at the top of your code. You'll also notice that I've replaced int with System::Int32, the managed equivalent. The rest of your code is fine. I have placed the call to GetSomething() in a callback for a button: private: System::Void Button1_Click(System::Object^ sender, System::EventArgs^ e) { this->Label1->Text = "blah blah: " + GetSomething(); }

Categories : Dotnet

Label won't align properly in Windows XP
Apparently it wasn't trimming the string in Windows XP. I did cpuLabel.Text = CPUID.Trim(); and after doing that it worked just fine. Thanks @Zach Smiith

Categories : C#

Best way to store private files in a node.js application hosted on Windows Azure
This question is a bit open-ended, as I'm sure there are several viable ways to securely transfer a file. Having said that: From an Azure-specific standpoint: You should be able to upload a file to your Web Site via ftp. Also, you could push a file to a specific blob and have your app check periodically for files in said blob. To upload (or download later), you'd need the storage account's access key, and as long as you're the only one with that key, you should be ok. When uploading from outside of Azure, you can connect to storage via SSL, further securing the upload. While you could probably use a queue (either Storage or Service Bus) with the .pem file as payload in a message that your node app would monitor, you'd need to ensure that the file fits within the limits of the message siz

Categories : Node Js

Hosting a WCF service from within a Windows Service. cannot be reached
As usual it was a stupid mistake. In my console application I was binding an SSL certificate to a port, this was removed as the powers that be did not want this in production code, which is understandable. So I removed it to then have a seperate batch file or otherwise which has to be manually run... however this is what I forgot to do. :( for those that are interested, below is the code from my test app. process = new Process(); process.StartInfo = BindCertToPort(port, certificate); process.Start(); method: private static ProcessStartInfo BindCertToPort(int iPort, X509Certificate2 certificate, bool bRemove = false) { string strAction = null; string strExtraArguments = null; System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); st

Categories : C#

How to display label field one by one with every 5 secs in windows application?
Set the time.interval = 5000. This will make your timer tick every 5 seconds. Inside the timer you can have the labels and each tick enable a text box using textbox.enabled = true.

Categories : C#

How to position a Label horizontally in Windows Forms code-behind
You can place this code in a SizeChanged event handler of your label1.Parent: if(label1.Parent != null){ //this if check may be removed if it's sure that Parent is not null label1.Left = (label1.Parent.Width - label1.Width)/2; } Better you should do something like this: //SizeChanged event handler for your label1 private void label1_SizeChanged(object sender, EventArgs e){ label1.Left = (label1.Parent.Width - label1.Width)/2; } //SizeChanged event handler for your label1's Parent private void parent_SizeChanged(object sender, EventArgs e){ label1.Left = (label1.Parent.Width - label1.Width)/2; } //you can change label1.Parent with a control reference which you know it's the container of your label1. To make it dynamically, for example you have a class CustomLabel and you want i

Categories : C#

Hosting WCF Service as Windows Service
You need to add the type of the class that implements your service contract in the ServiceHost constructor, and type of the service contract in your AddServiceEndpoint Assuming your service implementation class looks something like this: namespace Deepak.BusinessServices.Implementation { public class ApiImplementation : IApiImplementation { .... } } then you need: m_Host = new ServiceHost(typeof(ApiImplementation), httpUrl); m_Host.AddServiceEndpoint(typeof(IApiImplementation), new WSHttpBinding(), ""); the service host needs to know what (concrete) type of service class to host the endpoint needs to know what service contract (interface) it exposes

Categories : Wcf

Why I can not access private field of a base class when private variables can be accessed this way
If we can access the private variables of Class as mentioned then why a class which extends another class can not access private variables of base class? Because the variable isn't declared in the program text of the derived class, which is how private access is defined for Java and C#. (The details around nested classes vary between Java and C#; if you want details for one language or the other, please be more specific in your question.) I believe when code or classes will be compiled then all the methods, variables etc of base class will be added to derived class. Am I right on this? They're not added to the class, no. They're inherited by the derived class, and any instance of the derived class will have all the fields that are inherited - but that's not the same as them beha

Categories : C#

Is it needed to declare innards of private nested classes private?
The answer depends on how you currently use inner classes. My philosophy for inner classes is to reduce the burden of refactoring. I maintain encapsulation of inner classes: private methods and fields of the inner class are not accessed from the outer class even though they can be. The point of inner classes, then, is to reduce its scope to only the containing class. That way, if later an inner class can be reused elsewhere, it requires almost no work (and a trivial amount of work for non-static inner classes) to move it into its own file. Whether or not the above is your style will affect the following reasons for dropping or keeping the private around methods/fields. The reasons for dropping private are: The outer class has access to private members and methods of inner classes, mea

Categories : Java

Private field name being confused with private string name in Java
private is a keyword in java and you cannot use them for variable names as they are reserved. You need to rename your variable to some other name. As the javadoc says: You cannot use any of the keyword as identifiers in your programs. Here is the javadoc reference for complete list of keywords: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html

Categories : Java

Should the constructor of a private inner class be declared public or private?
As far as other classes are concerned, it shouldn't since the inner class is declared as private. They can't see it at all. It shouldn't make a difference to the enclosing class since it contains the inner class.

Categories : Java

How to reflect a private constructor out of multiple private constructors
public Constructor<T> getDeclaredConstructor(Class<?>... parameterTypes) throws NoSuchMethodException, SecurityException link (Class[])null . How can you cast null to class !? when null is not a class

Categories : Java

PEM_write_PrivateKey() function is not storing the RSA private key in private.pem file
Perhaps it's because you never called SSL_library_init(). Also, your buffered file is probably not getting flushed before the program exits. Before the end of the program you should call: fflush(fpPri);

Categories : C

What is the difference between private and private[Class] declaration in scala?
They are almost equivalent, and most definitely are equivalent in all common use cases. But, there actually is a very tiny semantic difference between the two: private restricts access to the enclosing class C1 and its companion object, but the definition is not inherited by subclasses and cannot override definitions in parent classes. private[C1] also restricts access to C1 and its companion object, but that member is inherited and can be overridden by a child class, as long as that class has access to it (if it is enclosed by C1). Here is an example: class A { private[A] val i = 1 def display() { println(i) } class B extends A { override private[A] val i = 2 } } val a = new A a.display // 1 val b = new a.B b.display // 2 !! B can override i because it has access to

Categories : Scala

css position label text in the true center (vertical and horizontal) without moving the label
You can use line-height: 30px; to center a single line of text instead. The 30px needs to be the same value as the height of the element you wish to vertically center text in. Note: The fiddle has height:40px whereas the code in question has height:30px. Just choose the line-height to match the height. vertical-align would actually moving the entire <label> (and text) down but only applies to inline-level and table-cell elements. It is not applying in your case as the <label> is floated.

Categories : HTML

Highcharts x axis label text wrapping lost on setting label step
It's a bit of a hack, but you could replace each space in the name with <br /> by using the formatter: labels: { step: 1, formatter: function () { return this.value.replace(/ /g, '<br />'); } } It's not exactly what you want as it doesn't split the name according to the space available between ticks, but maybe you can improve the formatter to better suit your needs (splitting by a given n characters for example instead of by space). See it running here.

Categories : Highcharts

What is the difference between Private Dim and Private Property?
The first line includes a Field/Variable and the second one an Auto-Implemented Property, which, as you can read in the MSDN documentation, is just a "quick version" of the conventional Property. You can see advantages/disadvantages between Properties and Fields in the corresponding MSDN definition of Properties and in links like this one. Also you have quite a few posts regarding advantages/disadvantages of Auto-Implemented Properties as compared to the traditional version: Link 1 Link 2 Link 3 Link 4 These links are for C# but the ideas are easily transferable to VB.NET. One of these last links refers to another pretty interesting one (also in C#): Properties vs. Public Variables.

Categories : Vb.Net

IOS Label Animation will not draw inside of label if changing the frame size
Ended up animating the image of the label / view. Here is the code, maybe will help someone. Assuming ARC and Quartz include. - (void) animateFromFrame:(CGRect)fromFrame toFrame:(CGRect)toFrame andView:(UIView*)view { UIGraphicsBeginImageContext(view.bounds.size); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageView* imageView = [[UIImageView alloc] initWithImage:image]; imageView.frame = fromFrame; imageView.layer.cornerRadius = 10; imageView.layer.borderWidth = 4; [self.view addSubview:imageView]; [UIView animateWithDuration:1.0 delay:0.25 options:nil animations: ^{ imageView.frame = toFrame; } completion:^ (BOOL finished) { [imageView

Categories : IOS

Xcode Autolayout: Place a label next to a dynamic label at a constant distance
Make sure that the spacing between your two labels is set to auto and that your days remaining label is left aligned. I suggest keeping a constraint between the trailing edge of your days remaining and the superview, but lowering the priority a bit. The goal there is to ignore it when the label should be far away from the superview, but not clip or go outside of the visible area when the date is very long. You may also need to increase the content hugging priority of the date label and/or decrease the compression resistance of your days remaining label. You may get better insight into what your labels are doing by setting the background color on them temporarily. The goal is to see how large your labels are, where the text is in the label, and where the spaces are. If there are lar

Categories : IOS

How to show label with line and display label outside in piechart in extjs4.1
You've got the display option of the label config, that you can set to 'outside'. As for the lines, you'll have to draw them yourself... Which would be a quite involved hack IMO. If you're interested in trying, that takes place in Ext.chart.Label#renderLabels(), and uses Ext.chart.series.Pie's onCreateLabel() and onPlaceLabel() methods. Don't forget to take your trigonometry with you before diving in there!

Categories : Extjs

How can you drag and drop a list item to a label so it's the label's text in C#?
Test for correct type and then grab it: private void posLB_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.Text)) { String s = e.Data.GetData(DataFormats.Text) as String; if (!String.IsNullOrEmpty(s)) posLB.Text = s; } }

Categories : C#

If input box is empty show label, if there is text, hide label
yes there is, use keyup() function.. $('#name').keyup(function(){ if($(this).val() == ''){ $(this).prev().show(); }else{ $(this).prev().hide(); } }); this is considering your label is always the previous element of textbox else you can use.. $('#name').keyup(function(){ if($(this).val() == ''){ $('label[for="name"]').show(); }else{ $('label[for="name"]').hide(); } }); this gets that particular label whose attribute for is name.

Categories : Jquery

Labelling a grid using n labels, where every label neighbours every other label
You can experiment with a simple greedy algorithm. I don't think that I'm able to give you a strict mathematical prove, at least because the question is not strictly defined, but the algorithm is quite intuitive. First, if you have 1...K numbers (K labels) then you need at least K*(K-1)/2 adjacent cells (connections) for full coverage. A matrix of size NxM generates (N-1)*M+(M-1)*N=2*N*M-(N+M) connections. Since you didn't mention what you understand under 'smallest matrix', let's assume that you meant the area. In that case it is obvious that for the given area the square matrix will generate bigger number of connections because it has more 'inner' cells adjacent to 4 others. For example, for area 16 the matrix 4x4 is better than 2x8. 'Better' is intuitive - more connections and more c

Categories : Algorithm

allow user to tap label and then tap buttons to edit label.text?
To know which UILabel has been touched add a tap gesture to each label which triggers an action. In that actions store which label has been touched in e.g. a property. For the buttons, just connect them to action methods (could also be a single one), inside these methods do your calculation and updated the label indicated by the property described above.

Categories : IOS

Should i use Associatedcontrolid in label control to render label HTML tag?
The <label> element in html is a label for an <input> element. So the TextBox that is made as an <input> tag if it is associated with a asp:Label or ASPxLabel which is just an extention of the asp:Label will indicate to the .Net framework to translate it as a html <label> tag. In essence if you don't have a TextBox there is no point to translate the asp:Label to html tag. You had better add a new CSS class and format the span as you please if you don't want the TextBox. If you do want a TextBox, then you should add it to your ASPX file and assign to id the same ID attribute value with the AssociatedControlId value at your label.

Categories : C#

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