|
The command window should stay open - so try it and then do two things:
1) type "dnscmd" and see if it runs.
2) type "path" and see if what you get looks sensible (i.e. it includes the folder dnscmd.exe is installed in)
I tried it here (with "whoami") and everything looks fine.
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
How to give C# chart height ,width based on data?
|
|
|
|
|
You own the data and you own the chart so devise a measurement metric based on the content of the data and set the chart width based on that metric.
We are not telepathic, nor can we see your data so we cannot guess what it looks like so can't devise a metric that would make sense!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
my code
int Xcount = dt.Rows.Count * 25;
List<int> levels = dt.AsEnumerable().Select(al => al.Field<int>(dt.Columns[1].ToString())).Distinct().ToList();
int yCount = levels.Max()*500;
Chart chart = new Chart();
//chart.Size = new Size(Xcount, yCount);
chart.DataSource = dt;
//chart.Width = 350;
chart.Height = Xcount;
//create serie...
Series serie1 = new Series();
serie1.Name = "Serie1";
serie1.LabelBorderWidth = 400;
serie1.Color = Color.FromArgb(255, 0, 0);
serie1.BorderColor = Color.FromArgb(164, 164, 164);
serie1.ChartType = SeriesChartType.Column;
serie1.BorderDashStyle = ChartDashStyle.Solid;
serie1.BorderWidth = 1;
serie1.ShadowColor = Color.FromArgb(128, 128, 128);
serie1.ShadowOffset = 1;
serie1.IsValueShownAsLabel = true;
serie1.XValueMember = dt.Columns[0].ToString();
serie1.YValueMembers = dt.Columns[1].ToString();
serie1.Font = new Font("Tahoma", 8.0f);
serie1.BackSecondaryColor = Color.FromArgb(0, 102, 153);
serie1.LabelForeColor = Color.FromArgb(255, 255, 255);
serie1.ChartType = SeriesChartType.StackedBar;
serie1["PixelPointWidth"] = "12";
chart.Series.Add(serie1);
//create chartareas...
ChartArea ca = new ChartArea();
ca.BorderWidth = 2;
ca.Name = "ChartArea1";
ca.BackColor = Color.White;
ca.BorderColor = Color.FromArgb(255, 0, 0);
ca.BorderWidth = 0;
ca.BorderDashStyle = ChartDashStyle.Solid;
ca.AxisX = new Axis();
ca.AxisY = new Axis();
string YAxixName = dt.Columns[1].ColumnName;
ca.AxisY.Title = YAxixName;
// Set axis title
chart.ChartAreas.Add(ca);
chart.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
chart.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;
//databind...
chart.DataBind();
series name for each series is not displaying.
|
|
|
|
|
So pick out all the bits that add to the width of a column, multiply that by the number of columns in the data, add a bit and set your with to that. Run your app and when it looks horrible try and work out what you have missed. Get the max and min of your data range and that will help define your height.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Calculate the largest value.
Assign 100 to this value.
Then assign a proportional value to the other values based on the proportion of a percentage to the highest value.
Plot your values based on this percentage.
It's quite simple when you apply your mind to it
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
|
Hi, I want to create a windows phone 7.1 app for finding the closest postcode too 4 predefined postcodes, I have found an access db that has all the uk postcodes in so i thought I would start by with a simple postcode query and work from there but I am struggling to fidd a query tutorial that will go through query a database.
could someone point me in the right direction please,
regards
Paddy
|
|
|
|
|
It will depend on the geo coding of your source data. When I did something like this in about 2002 I found the postcodes in Britain change from 1 month to the next so there was a need to subscribe to one of the geo coding sources, was very expensive at the time.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft,
thanks for the reply, I am able to get the UK list for free from the post office at present so I would like to go down the database route for this exercise as I have not worked with databases before on windows mobile, I am struggling to find a simple user input query project to help me get started.
Regards
Paddy
|
|
|
|
|
Is there a way to override SerialPort.ReadExisting() method? I'm working on the unit testing on the software that involves with Serial Port communication, using "test doubles".
Anyone can point me any suggestions? Thanks!
|
|
|
|
|
What version of Visual Studio are you using? Ultimate or Premium 2012/2013 can use a Fakes assembly which addresses specifically this with "Shims".
Fakes in Visual Studio Testing[^]
Or are you using some other kind of testing software (please specify)?
|
|
|
|
|
I am using Visual Studio premium 2010
|
|
|
|
|
... Or the other way to perform "stimulated" serial port communication?
|
|
|
|
|
An idea would be to write a simulation program which is sending dummy data to a virtual serial port at which your program is listening. You could pair those two virtual ports using com0com.
|
|
|
|
|
have a list in python like this
{Uin32} {Uin32, Uin32, String, Uin32, double}
How can i access each element in C#
I used this command
IronPython.Runtime.List pRFList = rf_model.model(ut_rx_list, ut_tx_list);
how can i walktrough this list (like foreach command)
thanks in advance
|
|
|
|
|
According to this[^], IronPython.Runtime.List implements IList<object> and IList , so a foreach loop should work.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have following requirement to develop in C#
Open command prompt i.e. invoke cmd.exe
run cd/ command
run command1
run coomand2
run command 3
run exit command
I need to save the output of the command1 , command2 and command3 in the same text file.
Please provide a sample code to execute multiple commands one by one and save output to same text file
|
|
|
|
|
superselector wrote: I have following requirement to develop in C# Basically a batch-file whose output is redirected. A batch-file is a collection of commands that are executed one after another;
DIR C:\TEST
DIR C:\TEST2
You could redirect the output when calling the batch-file, like "MYBATCH.BAT >C:\RESULT.TXT".
superselector wrote: Open command prompt i.e. invoke cmd.exe Google for "C# redirect console output" for examples.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
superselector wrote: Please provide a sample code to execute multiple commands one by one and save output to same text file
No.
That isn't how it works here.
We don't do homework, and we don't do your work for you either.
If you want code written for you to a specific specification, you have to pay - I suggest you go to VWorker.com and ask there.
But be aware: you get what you pay for. Pay peanuts, get monkeys.
If on the other hand you try to do it and get stuck, then feel free to ask for help with a specific problem and we will be glad to assist.
But we aren't going to do it all for you.
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
Hi i have implemented the same in vbscript . i was aware of the batch file concept but wanted to configure the commands in the code itself using Process class in C#.as i don't want it in batch .. thanks for your suggestion though.
|
|
|
|
|
superselector wrote: Need help.....
You certainly do!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi I am doing an exercise to change the content of a button 9windows app 7.1 VS2012)
I create the project and then its says
Drag a Button on to the Designer. See how it updates the Xaml with the Button tag. Selecting items in the Document Outline Window allows you to navigate the Xaml tree and it selects the item visually as well as in the Xaml. It is a handy way to navigate complex Xaml if not all of the Xaml is visable.
Select the Button go to the properties Window - this also creates events.
You can edit the control in the Properties Window or hand-edit the Xaml. To create an event you can either use the properties window or edit the Xaml.
To do this go to the Xaml for MainPage.xaml and find the Button that was added. Type Click= and then tab to create the event handler. This has been added in the code-behind .cs file. Type Button1.Content = "Hello World!"
I have done what it has say and my MainPage.xaml.cs looks like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
namespace Hello_World
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
Button.Content = "Hello World";
}
}
}
the 'Button.Content' produces this error:
Error 1 An object reference is required for the non-static field, method, or property
My MainPaipe.zaml has the following code in but no errors
<phone:phoneapplicationpage
="" x:class="Hello_World.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" d:designwidth="480" d:designheight="768" fontfamily="{StaticResource PhoneFontFamilyNormal}" fontsize="{StaticResource PhoneFontSizeNormal}" foreground="{StaticResource PhoneForegroundBrush}" supportedorientations="Portrait" orientation="Portrait" shell:systemtray.isvisible="True">
<grid x:name="LayoutRoot" background="Transparent">
<grid.rowdefinitions>
<rowdefinition height="Auto">
<rowdefinition height="*">
<stackpanel x:name="TitlePanel" grid.row="0" margin="12,17,0,28">
<textblock x:name="ApplicationTitle" text="MY APPLICATION" style="{StaticResource PhoneTextNormalStyle}">
<textblock x:name="PageTitle" text="page name" margin="9,-7,0,0" style="{StaticResource PhoneTextTitle1Style}">
<grid x:name="ContentPanel" grid.row="1" margin="12,0,12,0">
<Button Content="Button" HorizontalAlignment="Left" Height="79" Margin="142,53,0,0" VerticalAlignment="Top" Width="171" Click="Button_Click_1"/>
Help Appreiated
Paddy
|
|
|
|
|
The problem comes because you are trying to use a variable called Button when there is no such variable. Just because you have defined a Button on the main page, it doesn't mean that the code behind knows about it. There are 2 ways to fix this (without going into doing this via MVVM). The first technique for doing this is to name your button in the XAML using
x:Name="MyButton" (this goes inside your Button declaration) and then use this name in your codebehind. The second way to do this is to take advantage of the fact that the sender argument refers to the control that set it, so you can do
((Button)sender).... to set the value.
|
|
|
|