insteadof echo $b, append a$ to C$ with a comma each time you go through your foreach. You will need a little finesse to make sure you don't end up with a comma at the very end.
DaveAmour 160 Mmmmmm beer Featured Poster
insteadof echo $b, append a$ to C$ with a comma each time you go through your foreach. You will need a little finesse to make sure you don't end up with a comma at the very end.
Next time I'm in Belgium definatley, haven't been for about 35 years though!
"a label is on the screen, with text = "YES"
when I press button 1 the text changes to = "NO" (I did this is too easy)
but when I close the app. and open it again I want that text stay "NO"
how is this possible?"
This is an excellent question - very clear and easy to understand so now I can help you!
So to do this you need to store information between running the app, closing it and running it again. Do you have any preference of where to save this? A text file may be ideal for example.
Regarding the other question, you should post this as a new seperate question rather than mixing it in with this one.
Apologies ddanbe, I never realised there was a side question, only just spotted it. I really did think you had posted in the wrong thread!
@Anyone - I'm not really talking about a lack of gratitude - I don't need any, I'm just talking about badly worded, half sentences that don't describe the help needed in the first place.
I don't see any quantity or sales columns :(
What database is this coming from?
Do you want the SQL to populate your dataset in the first place, or are you wanting to sum things after the data is in a .net DataSet?
@ddanbe - think you posted in the wrong thread. On the whiskey already!?
@no123 - youre welcome
If you are serializing and then encrypting and writing to a file then the reverse will be read from disk, decrypt and then create an object in memory, then does it matter whether it's xml? You can also serialise to binary as well - see the link I posted earlier. You could also write your own serialization classes to serialize to 4th century Gaelic if you like but you never read it serialized as a human so it doesn't matter right?
You can serialize to one stream or file by using encapsulation I think. Again there is more info on this in the link I gave earlier but I think if you have an Animal and a Person and you want to serialize together in one go then then you can do something like:
var dave = new Person("Dave", "Amour");
var cat = new Cat("Joey", 7);
If you then have a class that has these as members of a collection, or as properties maybe then you serialise that, not the individual objects. Hope that makes sense?
Ok I feel like a grumpy old man now! In a better mood now the sun is shining :)
There are many ways you can do this. Perhaps the simplest is just to restructure your html slightly with:
<div id="units">
My Company Name
<p>
My company Address<br />
<span>My Company Contact Numbers</span>
</p>
</div>
With CSS there are probably a dozen ways of doing it but the above seems least effort. PS You spelled Company wrong too!
Can you post an HTML snippet too?
You have marked this as solved. Did you want to do that or do you need more help?
View source depending on the browser and how you are viewing the source may show you the source when the page was loaded or it may be a real time representation. Its is usually best to use the built in developer tools for the browser. This is usually arrived at by F12.
Which browser are you using?
Try this:
using System;
using System.Text;
using System.Xml.Serialization;
using System.IO;
namespace ConsoleSerialisation
{
public class Program
{
private static readonly Encoding LocalEncoding = Encoding.UTF8;
static void Main(string[] args)
{
using (MemoryStream stream = new MemoryStream())
{
Person sarah = new Person("Sarah", "Smith", 28);
XmlSerializer personSerialiser = new XmlSerializer(typeof(Person));
personSerialiser.Serialize(stream, sarah);
//At this point it is in an in memory stream
//This puts it into a string
var output = LocalEncoding.GetString(stream.ToArray());
//TODO - Encode the string here
Console.WriteLine(output);
}
Console.Read();
}
}
[Serializable]
public class Person
{
public Person()
{
}
public Person(string firstname, string surname, int age)
{
FirstName = firstname;
SurName = surname;
Age = age;
}
public string FirstName { get; set; }
public string SurName { get; set; }
public int Age { get; set; }
}
}
Is it just me or is it just frustrating and annoying when people want our help but can't be bothered to even type a full, clear sentence or two to explain their problem in a clear unambigious way?
It says it is free here so just download it I guess.
If you reword your qestion you may get more help. It is a real chore to read and doesn't explain things very well. Try and be very specific, unambiguous and use full, clear sentences.
Writer (Author of books etc) or programmer?
To clarify - serialization doesn't mean to serialise to disk - you can serialize to many places - the screen, a printer, a disk, memory, over a network etc.
No - you can serialise in memory, encrypt in memory and then write to disk.
Ok first things first, before getting your code to work lets fix your database as the design is wrong.
There are a set of design guidelines for designing databases called normalisation.
The rules or guidelines help you create databases which are not problematic.
In yours for example you repeat persons name and age for each hobby.
There are a couple of solutions to fixing this design. Its easy enough to explain - I could do it in 10 minutes if you were sat in front of me with a whiteboard but it would take a lot of typing to do it here!
You should google database normalisation and find a tutorial that suits your learning style, or find one on you tube.
After that shout up if you have any questions and after we get your database fixed we can fix your code.
Youre welcome.
I would like to help you with this but you need to be a bit more specific and also record the question - it is not very clear exactly what you need.
For example you say you want to save the text.
Save it where though? In a text file, in memory, in a database, in an excel spreadsheet, under your bed?
Do you have to encrypt BEFORE serializing? Serializing and then encrypting makes far more sense to me.
See this for how to serialize:
http://www.paxium.co.uk/PublicArticle/Article/493
Then just encrypt the xml. This way you can write one piece of code which will work for anything.
Some additional info. When you select someting in jquery, you are using the same selectors used in CSS.
If you do this $("p").append("XXXXXXXXXXXXXXXXXXXXXX")
then this will append to all paragraph tags. If there was just one p tag then it would just do the one. In your page you may only have one form? You need to be more specific in your selector - ie <p id="32">Test</p> to select just this paragraph use $("#32") - # means id.
You can easily experiment with jquery to test things in any page whch uses jquery.
Daniweb does so if you are using IE then hit F12. Then click on the console tab. Then at the bottom type in $("p").append("XXXXXXXXXXXXXXXXXXXXXX") and hit return or maybe type in $("p").hide().
This is a great way to experiment with jquery.
So tip - to improve your jquery skills, study CSS!
Change }).appendTo('form'); to instead of 'form' to be something more specific
Eg #formid if the other form has an id.
Does the other form already exist or are you creating it on the fly?
Ok I see the other sections now, sorry about that.
Anyway the LinkedIn bit is working now, well done!
What was wrong wth it? Was it because I am in the UK - diffeent url maybe?
Ok no worries, you can always just send me a bag of cash if you like!
Hi Dani - Yes LinkedIn still isn't working.
Must be something different about me - browser, location etc?
Do you know if it works for anyone else?
Or how about increasing the character allowance? I have copied and pasted my CV in but only got some of it in. Your limit is 5000 characters but mine is just under 35,000 characters. Mine is a little long as I am a contractor and have 36 jobs on my CV!
A loop is nothing more than an automatic repetition of code eg:
While (i < 10)
{
Print i
i = i + 1
}
End
By the way the above is just pseudo code - ie a made up language to show an idea rather than being a specific language.
In your code you already have a loop.
This is setInterval
setInterval will repeat or loop the same bit of code over and over again at a predefined interval which you have supplied as 3 seconds via pauseTime.
Does that make sense?
reyborn - will that SQL display vendors with Zero products?
Actualy just noticed in your first bit of code you have this:
double food [monkeytot][Wdays];
But then in your second bit you have this:
double food[monkeys][Wdays];
Try changing that.
How do you want to display this?
Also you say 1 person has potentially more than 1 hobby. How are you dealing with this in your database design?
Showing us the Sql statement you use would be helpful.
Ok thanks Dani, no rush I have othe sources of income to sustain me!
You need a comma before Address=
To add only non negative values do this:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim Total As Integer
For Each Str As String In ListBox1.Items
If CInt(Str) >= 0 Then
Total = Total + CInt(Str)
End If
Next
TextBox1.Text = Total
End Sub
As your code stands at the moment it will fall over if you enter a non integer value anyway.
Essentially a poco is just a simple, plain class with just simple properties. Easy to serialise, no dependancies etc.
POCO stands for Plain Old Clr Object. It was coined from the same phrase for Java - POJO. Sometimes you hear people say Plain Old C# Object - this is sometimes wrong and sometimes a tongue in cheek joke from people with a preference to C#.
I was bored so took your/my code and made a slideshow on my site - this is without scrollbars so view the source to see how it works.
If you like what I have done, I can get rid of the scrollbar too if you like?
I think if you change slideShowItem = '.slides li' to slideShowItem = $('.slides li') then you will get a collection of items.
I had a play with your code and changed a few things just for a bit of fun. Its far from perfect but if it gives you any ideas that would be good.
http://www.paxium.co.uk/content/daniweb/slideshow.html
Just view the souce to see the code.
I would be interested to see your CSS which you did not originally post.
Is this any help?
http://www.binaryintellect.net/articles/4a00a9ce-73e5-4d89-aaae-2d835eca0854.aspx
Its not exactly what you are looking for but I think you are more interested in the view aspect rather than the background data access right?
And any preference on data access technologies - ie Entity Framework ok for example?
Any preference on database?
One view in what - MVC with C# for example?
Switching ascending to descending should be easy.
Can you show us your ascending code?
I think ReadOnlyCollection has only been around since 2012 so I don't feel too bad now!
I haven't seen those interfaces before, shall look inot them, thanks :)
With this
public List<TyrePressure> Wheels { get; private set; }
I think you can still change Items in the list. Often you see this kind of thing if you don't want things to be changed:
public IEnumerable<TyrePressure> Wheels { get; private set; }
I have had some that don't support it and some that do. Pot luck usually but as Jorge says you can still connect via the local ip. I think I used to edit my hosts file to make life easier for this:
http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file
Ok thanks I will wait and be patient I suppose...