« first day (1188 days earlier)      last day (3986 days later) » 

15:01
hits the conversation to get it moving again
@ton.yeung i am using nopcommerce 3.0 source, it comes bundled with the export manager, it exports to either an XML/Excel file that you download
15:12
@ton.yeung have you had any experience with nopcommerce? know what it is?
@ton.yeung oh well its an open source ecommerce solution that uses .NET 4.5 MVC format
@Corbo152 Is this for school?
@no its a personal project i am working on
I don't get why newbies tackle complex projects
15:16
@LewsTherin coz you have to learn somewhere
Then learn from scratch
Console.WriteLine("Hello World")
iv actually managed to do quite a lot with it i just cant do this last bit
and iv already been through those tutorials
hi
can anyone please help me
1
Q: how to read a datagridview of another application

Ishaq GiI want to read a datagridview of a application.There is a application in which many child windows are there.here is a picture of that application and the window containing datagrid view which I want to read,I've highlighted the window which i want to read I've searched the window through UISPY...

by answering this question
@LewsTherin there is a product attributeparser class bundled in the solution, think i should look there?
@IshaqGi you cant do that.
15:21
Y @DaImTo
is there any alternate way of reading that datagrid view subitems
If its not your appllication and the owner of the application hasnt created you some kind of api to give you access to the data in the application. No.
@Corbo152 Without knowing the library I can't really say unfortunately.
But an XML parser should do the job
i've used this code
for reading an another application called odin
n it worked
its just not working to this application
i can get the handle
but not the contents
@DaImTo
with this code i've read this application
all the contents in it
but i am just unable to read that another application
@DaImTo
@ton.yeung Nudge #2 registered.
@ton.yeung nudge hello world
15:38
IList<string> values = _productAttributeParser.ParseProductVariantAttributeValues();
getting close i think, thats the method in the _productAttributeParser
no idea what do to next tho, trial and error lol
What do you want to do?
Lol
So you have the strings, what next?
What's with the room name anyway?
Cars#? :S
i need that one attribute that starts with D-
i m guessing i need to convert html to plain text in order for it to displau
display
Have any of you all created an extension for Visual Studio?
15:46
Nope. But I know someone who has. Shouldn't be that hard
Alrighty lol
var document = System.Xml.Linq.XDocument.Parse(item.AttributesXml);

                    var attribute = document.Element("Attributes").Elements("ProductVariantAttribute").Where(e => e.Attribute("ID") != null && e.Attribute("ID").Value == attributeId.ToString()).FirstOrDefault();
is that not parsing the data i need?
@ton.yeung 26
I guess so
Oh, look, someone didn't understand abstract
virtual, and returns null. -_-
Just ranting
There's no reason for it to be virtual at all, though, because the derived classes are all the same
I think
I'm trying to think of a project for my Distributed Systems class...
That isn't too difficult, but is neat...
load balancer
oh, that's not very neat
15:55
I don't have enough time for difficult
I have to entertain college kids...
@KendallFrey Eh no... ?
How is that a distributed systems project
balancing load between distributed systems?
I don't know what DS is, specifically
That's a tool to help distributed systems.
Rendering a mandelbrot set using parallel threads and machines
cloud computing, peer-to-peer, chatting systems...
basically a project where two machines communicate lol.
15:57
Yeah
Does client/server count?
Oh, I have a great idea
Make a chat app that works over Bluetooth
My friend wants one, and I haven't got around to making it
I've thought of that before but there wasn't a proper Bluetooth API then
Huh.. that would be pretty cool.
15:59
If you make it, I would totally use it
What's the deadline?
@JLott Check if there is an API first, before submitting a proposal.
And Documentation.. very important!
Damn android...
@KendallFrey April
Ah, darn, he wants it soon
I tried with serial ports, but most devices don't create one I guess
I will have to try 32feet
Why does he want one?
16:01
Because wifi is monitored
@KendallFrey I think there are apps out there that already do it
really?
@KendallFrey School or work?
@KendallFrey I googled it...
16:02
I googled "windows bluetooth chat app" and the first 4 results are Android and iOS? what the durrr
lol. I saw one for Andriod. I didn't know you needed Windows.
web...
@ton.yeung Bluetooth?
why..............
Well...
Web Chat, ten people will probably do that
16:04
I wrote a web chat
Ha ha yeah
Why not make an auction system?
I like the bluetooth idea... no one else will probably think about that..
Auction app - not as interesting though.. but still distributed
What about the mandelbrot set?
Isn't that more like... algorithms.
16:05
Not crazy complex (no pun intended), but epic results
@KendallFrey Do you just want us to ask what Mandelbrot is?
@LewsTherin Patterns!
@JLott Not if you compute it with multiple computers
just write a ftp server/client
Ahhh I see
16:05
@LewsTherin No, I expect you to know.
@NETscape Boring
@KendallFrey Cause you repeated it
two computers talking doesn't get too exciting.
Yeah, because it's awesome
at least with your time constraint
16:07
hey guys and @JLott
Who wouldn't love this?
@SteffenWinkler Hey!
So pretty :)
short question for the evening: Does anyone know what is passed into the 'Process.Exited' eventhandler?
16:08
It has been done a lot though... we had to make that for one of our beginning courses
@KendallFrey what is that and why is it causing me headaches?
@SteffenWinkler object sender, EventArgs e
@KendallFrey yeah but what is object sender?
is it the ProcessInfo?
the Process?
@SteffenWinkler You aren't allowed to ask what that is.
@KendallFrey but....why?
16:09
@SteffenWinkler presumably the instance that fired it
@SteffenWinkler pretty
@KendallFrey so the Process object?
that'd be neat
I would think so
@JLott What has been done?
@KendallFrey I am getting disappointed with the people in this room
@LewsTherin Mandelbrot
      wow
                            so disappointed
very  disappoint
                  such  depressed
                        much  upset
many  dissatisfied
16:21
Sigh....
@JLott Why?
@KendallFrey im really close now
@LewsTherin Because none of you know what Mandelbrot is...
i have followed the way it parses and adds the products sku
  /// <summary>
        /// Gets DocID
        /// </summary>
        /// <param name="productVariant">Product variant</param>
        /// <param name="selectedAttributes">Selected attributes (XML format)</param>
        /// <param name="productAttributeParser">Product attribute service (used when attributes are specified)</param>
        /// <param name="DocId">DOCID</param>
        private static void GetDocId(this ProductVariant productVariant, string selectedAttributes, IProductAttributeParser productAttributeParser,
@ton.yeung Right...
16:25
and in the PdfService
@JLott Gotcha.
var item = orderProductVariant.ProductVariant;

                    var document = pv.FormatDociD(orderProductVariant.AttributesXml, _productAttributeParser);

                    cell = new PdfPCell(new Phrase(document ?? String.Empty, font));
                    cell.HorizontalAlignment = Element.ALIGN_CENTER;
                    productsTable.AddCell(cell);
its now adding the SKU to the document, im guessing i need to edit the code that Gets DocID
16:55
Did they ever fix Array covariance?
fix?
Arrays shouldn't be variant...
They are last I checked
I doubt it
You can break it at runtime. But it works at compile time
16:59
 DocId = productAttributeParser.ParseProductVariantAttributeValues;
 public class Animal
    {

    }

    public class Giraffe : Animal{}

    public  class Turtle : Animal{}

    class Program
    {
        static void Main(string[] args)
        {
            Animal[] animals = new Giraffe[10];

           animals[0] = new Turtle();
            Console.ReadLine();
        }

    }
@KendallFrey I guess they didn't fix it. Resharper gives me a warning.
with the current code i now get
"System.Collections.Generic.List`1[Nop.Core.Domain.Catalog.ProductVariantAttribu‌​te]"
wow, wtf
@Corbo152 That's printing the reference name.. why?
@LewsTherin im guessing because of this line
17:06
@KendallFrey Considering how much you stalk Jon Skeet.. I'm shocked.
if (String.IsNullOrEmpty(DocId))
                DocId = productVariant.ProductVariantAttributes.ToString();
Yeah that's why
its now parsing the attributes at least, i have placed a few breakpoints and checked values
@LewsTherin i dont stalk!
 var document = pv.FormatDociD(orderProductVariant.AttributesXml, _productAttributeParser);
17:08
@Corbo152 If ProductVariantAttributes is an IEnumerable<T> shouldn't you filter it?
@KendallFrey Of course you don't ;)
Not Jon Skeet, that is.
I like stalking Steve though.
@LewsTherin what do you mean by filter it?
@KendallFrey Lmao. Cough cough
still smoking, eh?
Ha ha, me no do any smokes.
@Corbo152 How do you expect to get DocId?
17:11
s/smokes/women/
Me smokes many a women
@LewsTherin im guessing by using the productattribute parser to parse the attributes and then select the attribute id i wish to add to the PDF
What is docid? Is it per attribute? Or per document?
!!urban docid
@KendallFrey No definition found for docid
17:14
per document, its the unique identifying string thats passed back from the rendering server
So why are you parsing the productvariantattributes for a docid?
@KendallFrey How does reference conversion work anyway? I mean the reference doesn't change.. unless they really mean reference validation
because that is where it is stored
see here
did anyone make a SQL statement that reads a text file?
oh no its actually stored in the AttributesXML
@Corbo152 The solution is probably simple, we just don't know what you are trying to do :P
17:16
Why does scratching pens on shoes work? o_o
Wait, seriously? That works?
@AmmarAhmed Like a flat file database?
I don't know how many pens I've thrown out over the past month because they myseriously stop working...
@LewsTherin basically there is a unique string that is passed back from the rendering server and stored in the attributesXML
@BenBlack Yeah, my pen didn't work, so I 'shoed' it
17:17
@Corbo152 Show us what the data looks like.
It's so weird
@Shoe yeah. a CSV actually.
You are so weird Kendall.
Stating the obvious again...
17:18
I like your style though
I like how my brain is filling up with ideas as soon as I asked the question. Rubber Duck theory at it's best
@AmmarAhmed If you're using sql server you can use the Import Export wizard
@KendallFrey Just had to be said
<AttributesXml>&lt;Attributes&gt;&lt;ProductVariantAttribute ID="2147483646"&gt;&lt;ProductVariantAttributeValue&gt;&lt;Value&gt;e8bb4282-43de-4baf-aece-5baed6163e03&lt;/Value&gt;&lt;/ProductVariantAttributeValue&gt;&lt;/ProductVariantAttribute&gt;&lt;ProductVariantAttribute ID="2147483645"&gt;&lt;ProductVariantAttributeValue&gt;&lt;Value&gt;D-6DB2F2E5&lt;/Value&gt;&lt;/ProductVariantAttributeValue&gt;&lt;/ProductVariantAttribute&gt;&lt;/Attributes&gt;</AttributesXml>
@LewsTherin Didn't
17:18
@KendallFrey Yes it did. I feel like adding an explicit
the id i need is the D-
D-6DB2F2E5
@Corbo152 Wow, I'm not reading that. Please post well formed XML
the attribute id is: 2147483645 an d the value: D-6DB2F2E5
If you can read it, then you can figure out how to parse it.
:14108439 Bloody hell! :P
Btw use ctrl+k to format the code
thats the bit i dont know how lol
17:20
!!afk secrit
i did press ctrl + k lol
Do any of you think it is necessary to create a WCF to capture information from a website and insert into the database ?
<root>
   <blah>
   </blah>
</root>
Works for me
Or a simple Windows Service is better for this kind of situation ?
@Corbo152 Copy into notepad++. Format it and paste here. And ctrl + k
17:21
You can make http requests from windows service
@AndréSilva You mean WCF hosted as a windows service?
Depends on your design I guess.
WCF goes on in IIS right ? My knowledge in it is really raw
You can host it in IIS yes
17:22
But is it worthy ?
It depends
WCF might be overkill if you just need to scrape
<AttributesXml>
	<Attributes>
		<ProductVariantAttribute ID="2147483646">
			<ProductVariantAttributeValue><Value>e8bb4282-43de-4baf-aece-5baed6163e03</Value>
			</ProductVariantAttributeValue>
		</ProductVariantAttribute>
			<ProductVariantAttribute ID="2147483645">
				<ProductVariantAttributeValue><Value>D-6DB2F2E5</Value>
			</ProductVariantAttributeValue>
		</ProductVariantAttribute>
	</Attributes>
</AttributesXml>
its the second one i need
So use an xml parser
@Corbo152 How do you decide that it is the second one you need?
Hmm, so better not use WCF...
17:27
By the ID im guessing?
@Corbo152 You are guessing?
@AndréSilva You can try a REST approach and use WebAPI?
its that: D-6DB2F2E5 i need to appear on the PDF
@Corbo152 Are you given the id?
as that identifies the Document outputted from the rendering engine
@Corbo152 So this number: 2147483645?
17:28
@LewsTherin Never used it ._.
@AndréSilva Same, but there is a first time for everything..
I guess that means there is hope for me..
the ID "2147483645" is assigned in a key in the web.config and never changes. the value "D-6DB2F2E5" is what is passed back from the rendering engine and is unique to each product on the order
Does the rendering engine always give you this value?
no the value changes it always Starts with D-
I'll have to do it in 3 days
But I'm going to google I think I have enough time
17:31
the ID stays the same the value changes but always starts with D-
@Corbo152 Ok but does the rendering engine always give you the value?
yes it does
So why check the xml?
if (String.IsNullOrEmpty(DocId))
Why that check?
i dont know lol as you say its not needed
but the fact that it was returning that reference before means that it wasnt picking up the doc id
i have now removed that check tho
If the docid is always given you there is no need to go through the pain of parsing the XML
@Corbo152 Ok, now I am really confused.
What reference?
17:36
Gah, i've been writing code without having a millilitre of coffee in me. GAHHH
so if im not parsing the XML how do i retrieve the value
@Corbo152 You're trying to get value from XML without parsing the document?
@MarcinJuraszek i understand this i just dont know how to parse the document lol
LINQ to XML?
He needs an ID, but he doesn't know which.
17:41
@LewsTherin i know which ID i need
THen just use xpath
xpathDocument
@RyanTernier Overkill
> the ID "2147483645" is assigned in a key in the web.config and never changes. the value "D-6DB2F2E5" is what is passed back from the rendering engine and is unique to each product on the order
214... ?
yeah thats the ID
These are saved in a web.config?
17:42
@Corbo152 Paste that code you had before
Then use the COnfigurationManager to get it
the ID is assigned here: <add key="PunchOutDocumentId" value="2147483645"/>
but thats the id not the value
the value is stored against that id
Use the ID to get the value
yes but how do i parse the XML to get the value from the ID
thats the bit im stuck on
17:43
 productVariant.ProductVariantAttributes.SingleOrDefault(pv=>pv.Id== id)
I think...
Depends on your type
@LewsTherin right okay and that code goes where?
If this is in the web.config just use:
ConfigurationManager.AppSettings.GetKey(int index);
:14108905      if (String.IsNullOrEmpty(DocId))
                    DocId = productVariant.ProductVariantAttributes.SingleOrDefault(pv=>pv.Id== id);
Ok so this is how I think you can parse your xml:
pvas = blah.GetDescendants("AttributesXml").GetDescendants("Attributes")
pva.SingleOrDefault(pva=>pva.Element("ProductVariantAttribute").Attribute("ID")== key)
Ah fuk it cba...
XML is a PITA
lol
iv been like CBA for days now
its doint my head in
posted on January 16, 2014 by Eric Lippert

Here's another fragment of the video interview I posted recently. In this fragment I discuss the difference between analying IL and analyzing source code when trying to figure out if a defect exists. It turns out that you can get … Continue reading →

17:51
Actually.. maybe:
pvas.SingleOrDefault(pva=>pva.Element("ProductVariantAttribute").Attribute("ID")== key).Element("ProductVariantAttributeValue").Element("Value")
if (!string.IsNullOrEmpty(item.AttributesXml))
                    {
                        var document = System.Xml.Linq.XDocument.Parse(item.AttributesXml);

                        var attribute= document.Element("Attributes").Elements("ProductVariantAttribute").Where(e =>e.Attribute("ID")!=null && e.Attribute("ID").Value == attributeId.ToString()).FirstOrDefault();

                        if (attribute != null)
                        {
                            var value = attribute.Descendants("Value").FirstOrDefault();
would that work?
I dunno. Run it and see.
you should use casting instead of XElement.Value property
@LewsTherin i would if i knew where to place that code, in the Pdf service class or in the Productextensions class
var attribute= document.Element("Attributes").Elements("ProductVariantAttribute").FirstOrDefault(e => (int?)e.Attribute("ID") == attributeId);
17:56
@Corbo152 I'm not sure how to reply to that
Put it where you feel comfortable
ok so this is code i found in the shopping cart controller that does exactly what i want to do, i just somehow need it to work in the PDF service class
  private ShoppingCartItem FindItemFromDocumentId(string documentId,IEnumerable<ShoppingCartItem> cart,int attributeId)
        {
            ShoppingCartItem r = null;

            if (cart != null && documentId != null)
            {
                foreach (var item in cart)
                {
                    if (!string.IsNullOrEmpty(item.AttributesXml))
                    {
                        var document = System.Xml.Linq.XDocument.Parse(item.AttributesXml);

                        var attribute= document.Element("Attributes").Elements("ProductVariantAttribute").Where(e =>e.
Well, I'm going home. Luck
@LewsTherin ok thanks for all your help :)
Can you upload the .cs files somewhere?
JS fiddle?
17:59
Does JS Fiddle so c#?
do*
or pastebin
Yeah, pastebin

« first day (1188 days earlier)      last day (3986 days later) »