[Solved] Building class to dezerialize from this? can’t get it to work

[ad_1] You probably have an encoding issue with your code. The following works using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; using System.Globalization; namespace ConsoleApplication3 { class Program1 { const string URL = “https://www.sciencedaily.com/rss/top/technology.xml”; static void Main(string[] args) { XDocument doc = XDocument.Load(URL); List<Item> items = doc.Descendants(“item”).Select(x => new Item() { … Read more

[Solved] Split an existing indexed array

[ad_1] Here was my solution, I was calling to the array before the foreach loop did its job reading the txt file, thanks for the assistance Toby <3 string[] taxArray = new string[2]; int count = 0; // string incomeBracket = taxArray[0]; //string[] incomeBracketArray = incomeBracket.Split(‘,’); try { if(File.Exists(filePath)) { //read the lines from text … Read more

[Solved] Array and pointers in c++ [duplicate]

[ad_1] I often hear that the name of an array is constant pointer to a block of memory You’ve often been mislead – or you’ve simply misunderstood. An array is not a constant pointer to a block of memory. Array is an object that contains a sequence of sub-objects. All objects are a block of … Read more

[Solved] WPF Dependency guide [closed]

[ad_1] What is Dependency Dependency means an object depending upon another object. An object O1 depends upon another object O2 when O1 is using O2’s property to do some changes in its own(O1) property. Why we need it To achieve these changes, some notification logic is needed of-course. Before WPF or similar technology, we were … Read more

[Solved] Check if a class is public or private

[ad_1] Since you already determined the type (typeof(Jedi)) you are almost there. The Type class has two properties: IsPublic and IsNonPublic. You can use them to determine the access mode of your types: public class Public { } internal class Program { private class Private { } [STAThread] private static void Main(string[] args) { Private … Read more

[Solved] Pointer gives me the address rather than the value;

[ad_1] OK, now I think you’ve finally posted the code that has the problem class ZombieLand : public Singleton<ZombieLand> { DECLARE_SINGLETON(ZombieLand); public: MachineState* world[19][19]; bool map[19][19]; MachineState* getField(int x, int y) { return world[x][y]; } void setWorld(MachineState state) { world[state.x][state.y] = &state; map[state.x][state.y] = true; } }; This is undefined behaviour because you are saving … Read more

[Solved] How can I get a Boolean from form 2 to form1?

[ad_1] 1- Create a new property In Form2 like this public partial class Form2: Form { public static bool BolleanProperty { get; set; } // … } 2- in the static constructor set property BolleanProperty = true public partial class Form2: Form { public static bool BolleanProperty { get; set; } static Form2() { BolleanProperty … Read more

[Solved] Error due to Stringfrom method [closed]

[ad_1] You don’t have a method called StringfromMonths in your code and this, apart from the compiler error, seems really misleading because I suppose that this lost method returns a string, instead you are trying to print the numeric value of the enum Months.September… If you really want to print the numeric value of a … Read more

[Solved] ways to implement a rand/srand? c++

[ad_1] Have you checked those functions in references? They are pretty well described and there are also some examples. You should always start with that before trying to ‘google’ for the answer. http://en.cppreference.com/w/cpp/numeric/random/srand 1 [ad_2] solved ways to implement a rand/srand? c++

[Solved] How would I allow user to use program again? [closed]

[ad_1] If you want an operation to be preform *untill something you should use a loop #include <iostream> using namespace std; int main() { double bill, ten, fifteen, twenty, end, end2, end3; bool done = false; while(!done){ cout << “Enter your bill’s total: “; cin >> bill; ten = 0.1; fifteen = 0.15; twenty = … Read more

[Solved] Removing some characters from string in c# [closed]

[ad_1] Here is one way: Create a System.Uri from the string Break it apart into .Segments Drop the last segment (the filename). (with .Take(length-1) or .SkipLast(1)) Concatenate the remaining segments back together with string.Join Drop the trailing / using .TrimEnd .NET Framework: var uri = new Uri(“Https://example.com/assets/css/bootstrap.css”); string result = string.Join(“”, uri.Segments.Take(uri.Segments.Length-1)).TrimEnd(“https://stackoverflow.com/”); .NET Standard: string … Read more

[Solved] Converting string to valid DateTime

[ad_1] Try this… var test = “2015-05-08T05:00Z”; DateTime testTime = new DateTime(); testTime = DateTime.Parse(test, null, System.Globalization.DateTimeStyles.RoundtripKind); Console.WriteLine(testTime); Console.ReadLine(); Or even with DateTime.ParseExact() var test = “2015-05-08T05:00Z”; DateTime testTime = new DateTime(); testTime = DateTime.ParseExact(test, “yyyy-MM-ddTHH:ssZ”, System.Globalization.CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); Console.WriteLine(testTime); Console.ReadLine(); Results: 1 [ad_2] solved Converting string to valid DateTime