overwraith 83 Newbie Poster

If it compiles into a dll you can just include it in the project as a reference. I actually think you have to have it as a dll, but I could be wrong. If it is a dll, it's essentially a compiled software library.

overwraith 83 Newbie Poster

Suzy's right about malware, you see, it hooks libraries and kernel stuff, so some malware can actually intercept system calls made by AV products if it is programmed to do so. I have heard you can do an AV scan of the drive from another computer somehow by removing the hard drive, but in this case is best to blow the old OS away. Harvest the keys of the previous OS first with a utility if you need to. They call em password/key recovery programs? I think this is possible, or is it only for office products when your box goes missing? IDK.

overwraith 83 Newbie Poster

Really guys you don't need to hide your strings very often. Encryption is meant to hide data at rest, not something meant to run in a program on strings which are typically used for prompts. Ultimately if somebody is in a position to reverse your exe, then even if you do crypt the strings somebody with enough experience to do reversing will ultimately just step through your code until he finds the crypto functions, and the keys you used to crypt the strings. Any strings that should be crypted should be kept in a secure container like a database, or a cypered file. If you are intersted in crypting your exe, then you should probably look into finding something that obfuscates, or crypts the entire executable. Just understand that ultimately all executables are reversable with enough effort. The only things that are not reversable are operations which take place on a company server because they can be controlled.

overwraith 83 Newbie Poster

Dude, Bit-torrent isn't illegal. Just use wisely. What you download could be illegal, but lots of sites use it to conserve their server's bandwidth. It could be illegal in your country, but I doubt it.

overwraith 83 Newbie Poster

Don't know if anybody mentioned this, but you could probably break some parts out into other source code files. Classes generally live in their own code file.

overwraith 83 Newbie Poster

Break only breaks you out of one nested looping structure. So on the inside loop if you break, the inner loop will cease, and the outter loop will continue execution.

overwraith 83 Newbie Poster

Never done it before, but could bayesian filtering do something like this for you? Basically you count the occurrences of tokens in a sentence and based on that you have a strong probability that two questions are or are not the same, or similar. You would probably need to make a hash map of some kind to get it working right.

sasankasekhar2003 commented: Thanks overwraith, but that did not solve my problem either. But like Diafol, you lead me a step further. Thank youme a +0
overwraith 83 Newbie Poster

<Directed twoard experienced devlopers questions> Perhaps it would be useful to determine which processes actually exist on a windows device by default? Win 7, Win 10, etc? Does anyone know where to find such information? It would be trivial really to examine the processes of a system via C# and query them via LINQ. LINQ in action has some code for this I bellieve. What we need is some way to determine what exactly is not standard. Every time you install a new application you will probably get more processes, but that doesn't concern me overly much. It would also be useful to create a program which can automatically create profiles for existing software as it's installed.

Ananthoju, you said that encrypting and decrypting keyboard input at an application level would be a good idea. I disagree. The reason I disagree is that on a windows system for any 3 step encryption (ex public private keys) there is a keystore on windows where windows stores the keys. If somebody has access to your computer this keystore is available to them, which would make any encryption between the devices moot. Encryption of this nature is designed to protect the communication channel, not the end device. What you are proposing is literally encrypting the keystrokes between the keyboard and the PC, not encrypting them on the PC. If you hack the endpoints, you literally can't trust the device again. Perhaps I don't understand exactly what you think this would accomplish.

I think …

overwraith 83 Newbie Poster

High BS tolerances. jk.

It does strike me however that most of the things you guys are suggesting are soft skills, as opposed to actually knowing the code. I would think not knowing the tools would be a red flag for any employer who needs something done.

overwraith 83 Newbie Poster

I don't know exactly what's wrong without viewing MORE CODE, but it should be fairly straight-forward to point you in the right direction regaurdless. Here is an example that should be more or less correct and should steer you twoard building a tostring method that fits your needs. This looks like java, or C#, so there is an example of each.

//JAVA IMPLEMENTATION OF TOSTRING
@Override public String toString(){

    return "Your string";
    //Here's a better idea of what you will have to do, you have to 
    //  return the string representations of all member variables. 
    //  most programming languages coerce member variables to strings provided
    //  one of the variables in the chain is actually a string, '+' concatenates strings
    //  If you have integers or something consecutive, cast to string and enclose in parenthasees
    //return memberOne.toString() + memberTwo.toString() + memberThree.toString();
}

//C# IMPLEMENTATION OF TOSTRING
public override string ToString(){
    return "your string";
}

//you can also use StringBuilder's/StringBuffer's if you are accumulating
//  a lot of different strings, and you are concerned about the concatenation
//  overhead. (depends on language)

Also, remember to put spaces in the correct places otherwise the printout will not look legible at all.

overwraith 83 Newbie Poster

I was referring to a programatical interface however, it is a little bit important, and like I said it was a higher level programming class.

public interface ISomething{
    void IDoSomething();
}

I think you would probably agree with me that this is a fairly important concept.

rproffitt commented: Nod. Member should ask much better questions. +0
overwraith 83 Newbie Poster

Well, "What is TCP/IP" is not the worst question I have ever heard. I think the worst one I have ever heard is "What is an interface". Mind you this was in a higher level programming class.

overwraith 83 Newbie Poster

Try not to think of this quote in regaurds to any previous quotes, I think this one's one of the funniest I have ever heard:

"Just close your eyes and think of england. "--Lady Hillingdon

When you look it up you will either think it is the funniest thing in the world, or you will probably think I am being crass, either way please don't ban my account for something I think is funny. It actually came up in a book I am reading as a little bit of off colour humor among some women characters in the book, one of them being from england.

overwraith 83 Newbie Poster

A cool program for sure, but I always submit to the observation I have read in a practical crypto book, "Don't roll your own encryption" I don't know much about this crypto standard, but when people roll their own encryption they tend to make mistakes regaurdless of how well they try. There shouldy be crypto analysts, and mathemeticians, and whole scores of other people involved in implementing a crypto standard. More eyes take care of the problems. Subtle problems are always the bane of crypto programs.

overwraith 83 Newbie Poster

If I have any that I have left unanswered they typically are unanswered, or not answered adequately, but I haven't checked in a while. I guess everybody should check more often. Honestly I had set up a work account for this site here, and that one will never be used again, I should probably look into having it deleted. I don't have access to the email account any more, nor do I really care to touch it.

Noobs not marking as answered is a problem though, typically they probably don't care, or don't know enough about the forum. Perhaps there should be a timeout built into forums, or another level of answered/unanswered, let's call it "dormant".

overwraith 83 Newbie Poster

Yeah, that's just an accumulating loop, it's pretty simple really. You don't have whitespace in the right places so the foreach loop doesn't look intuitive, but you should have no trouble understanding this. The two statements below the foreach loop in your pseudo code would essentially be in brackets in a full up programming languages so that they are grouped to run inside the loop. Perhaps you don't understand how functions work? Functions can and do return objects and collections. After this pseudo code you would typically have a printing statement which prints the total, or you would set a variable for the total whether it be an object unto it's self, or simply a variable to hold the currency value.

overwraith 83 Newbie Poster

Thanks everybody, I am really a beginner in the world of "production programming", so I have very few experiences with other peoples software, and unfortunately the few experiences I do have are not that great so far. I appreciate being able to hear from more seasoned developers than myself, using somebody else as a litmus test is useful to me. Also, anybody else who wants to comment go ahead and post I will keep revisiting this thread for a while.

overwraith 83 Newbie Poster

That seems to be the way to go. Keep it simple stupid. Thanks for your answer, others feel free to answer too.

overwraith 83 Newbie Poster

Hey I have a question, how many people actually use telerik? Does anybody have experience with it, and what are your opinions on it? To me it is just another third party library that nobody knows, but I want an opinion on it from actual seasoned developers. I have worked on a few projects before where people just started throwing in random libraries, and they became unmaintainable. This is one of the reasons I ask. Due to my past experiences whenever I see a company with Telerik on it's webpage I feel squeamish. Is this reaction from bad experiences justified, or what do you all think on Telerik?

overwraith 83 Newbie Poster

Suzie's suggestion of unregistered user traffic has merrit, however the unregistered users shouldn't be able to downvote, perhaps retain that as a member right. Suzie is also right about more and more people typing in a search query into google in order to obtain code snippets from mulitple sources. I know Snippets really help me, and I get them from a diverse number of sources. I would never copy them word for word for homework assignments, I would use them to understand how something worked. On the same token everything, or mostly everything you can see online is public domain. IDK.

None of the teachers I had told any of their students to copy and paiste snippets from other people's work. I have seen students do some pretty curious things in the past though, such as saying they were going to write a report about quantum computers, and then their "report" was just a printout of the wickipedia article. Perhaps a lot of teachers don't even try to catch the plagerisers because they don't really care, don't have the search tools, or don't have the political capital to persue such ends? (I am actually not suggesting that all teachers should have more political capital, wait 'til you get one with "political" capital, aswell as an axe to grind)

On the other side of the token I have had teachers who wouldn't let you use small utility methods written by others without a (insert obsenity) citation in a format that didn't …

overwraith 83 Newbie Poster

Perhaps there should be a feature where you can't downvote someone when your account is only n days/months old?

rproffitt commented: Social Media (SM) thinking there. Not bad. +0
overwraith 83 Newbie Poster

Arrays don't overload tostring() as far as I am aware in any language. They probably should but they don't. You have to loop through the array in order to print out the array. If they do overload, it is just info about hash, and name, etc, not the actual content.

overwraith 83 Newbie Poster

I have a few observations. From what I have heard the US population is probably shrinking a little bit due to the baby boomer thing. So most programmers these days are actually senior level people. If you take a look at the job market in most places you will quickly come to this conclusion due to the fact that only senior level people are getting hired. I am betting that you all are loosing a good deal of population due to these environmental features. I am also wondering how many people go to college and have to take at least one programming class as an elective. It's a strange thought, I wouldn't think that many people would go for an elective like this, much less need one. However while I was in college I noticed that a lot of students were held to a lot lower standard than I thought was probably required. This could be an errant observation, but I remeber being asked a lot of questions, like "what is an interface, and what is it good for". Also take into account the way the number of languages is ballooning these days with DSL's and scripting languages cropping up all over the place. It could be that everybody is being spread a little bit thin. The colleges I went to start people off at ASM, C/C++, and almost literally move chronologically to Java, C#, SQL, etc, etc, etc. I am not complaining about the number of languages today, I …

overwraith 83 Newbie Poster

Right, good point. The only reason I am using a config object here is that it is a fixed width file parser. I am probably not using the correct vocabulary in some of the program, but I am essentially passing in a config object which contains a file path, as-well as an array of classes which represent the characteristics of each field, widths, alignment, and field name in case somebody actually wants to print a column header in the file (usually you don't but I have seen some CSV's with this user friendly feature). The idea is I can serialize the configuration object, and reload, etc. The objective in my mind for this program was to make it so that it is useful to different companies/people who may not all have the same fixed width formats.

I could probably think of making a few overloads so I could pass streams to this object, but I would have to think about this to make sure the config object is still useful. Perhaps I should just remove the config object's path/name variable?

overwraith 83 Newbie Poster

Say hypothetically you had a reader which did something like this...

//testing reader, automatically parses strings and converts to the custom type via attributes!
using ( FlatFileReader<MyCustomClass> reader = new FlatFileReader<MyCustomClass>(config) ) {
    MyCustomClass custom;
    while ( (custom = reader.ReadLine()) != null ) {
        Console.WriteLine(custom.ToString());
    }
}

Would this actually be useful in not just flat files, but CSV, etc, etc? I am just having some second thoughts about this program, as to whether it would actually be useful to people. There's not really any technical problems with this, I just want some opinions.

overwraith 83 Newbie Poster

Indeed, C/C++ has some awesome features like that... lol

overwraith 83 Newbie Poster

Program calls declaration_list(), declaration_list() calls declaration(), which prints something and returns, then declaration_list() calls declaration_list(), it's self again, which proceeds to call declaration(), then we go back to execute the last line of declaration_list() again...

Trace through it a line at a time, essentially declaration_list() calls it's self once an execution, so it is in fact infinite. There is no breaking out of this loop. Since there is no way of breaking out, the stack gets too large, and an exception is thrown/executable dies, or the runtime detects a certain number of recurses, and chokes. This is C right?

overwraith 83 Newbie Poster

I don't know, I have been told by some developers that Entity Framework is one of the "new things" in database development only recently (looking up some info on google, it originally came out 7 years ago, but is still under active development). I got some books on the subject, still need to read them, are you sure removing it is a good idea? If it is in fact a troublesome technology I would like to hear some more opinions of experienced developers.

overwraith 83 Newbie Poster

Ok, so I built a writer, here are the code additions...

/*Author: overwraith*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;//for the Missing enumeration
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.Excel;
using System.IO;

namespace ExcelOperations {

    public class ExcelWriter : IDisposable {

        private Application XLApp;
        private Workbook XLWorkbook;
        private Worksheet XLWorksheet;

        //Required for WriteLine method
        public int CtRow { get; private set; } //read only
        public int CtCol { get; private set; } //read only

        public string FullPath { get; private set; } //read only
        public string Name { get; private set; } //read only

        public ExcelWriter(string fname) {

            XLApp = new Application();
            XLApp.Workbooks.Add(Missing.Value);
            XLWorkbook = XLApp.Workbooks[1];
            XLWorksheet = XLWorkbook.Sheets[1];
            Name = fname;
            FullPath = Path.GetFullPath(fname);

            //set current row and column
            CtRow = 1;
            CtCol = 1;

            //eliminate Excel alerts
            XLApp.DisplayAlerts = false;
        }

        public void WriteLine(object[] value) {
            for (int i = 0; i < value.Length; i++, CtCol++)
                XLWorksheet.Cells[CtRow, CtCol] = value[i];

            CtRow++;
            CtCol = 1;
        }

        //the dispose method for this wrapper class disposes of the excel com objects
        public void Dispose() {
            //Cleanup for the excel data types
            object misValue = Missing.Value;

            //save to same file
            XLWorkbook.SaveAs(FullPath);
            XLWorkbook.Close(true, FullPath, misValue);
            XLApp.Quit();
            releaseObject(XLWorksheet);
            releaseObject(XLWorkbook);
            releaseObject(XLApp);
        }

        //used for releasing excel com objects
        private void releaseObject(object obj) {
            try {
                Marshal.ReleaseComObject(obj);
                obj = null;
            }
            catch (Exception) {
                obj = null;
            }
            finally {
                GC.Collect();
            }
        } //end method
    }//end class

}//end namespace

And here is the altered main...

/*Author: overwraith*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; …
overwraith 83 Newbie Poster

Ok, so I got something working pretty good, I just got to replace this print list function with an actual excel writer which I am going to have to design. Here is my main(it's C#, does it really really have to be VB?)...

/*Author: overwraith*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;

namespace ExcelOperations {

    class Program {

        static void Main(string[] args) {

            using (ExcelReader reader = new ExcelReader("RefactorThis.xlsx")) {
                List<string> ctRow = reader.ReadLine().ToList();
                string[] line;

                //loop through the excel file
                while (( line = reader.ReadLine() ) != null) {

                    if (line.ElementAt(0) == "") {
                        //first cell is blank, is repeating data

                        //remove preceding spaces
                        line = ( from str in line where !String.IsNullOrEmpty(str) select str ).ToArray();

                        //append the row
                        ctRow.AddRange(line);
                    }
                    else {
                        //else is new data, first line is not blank
                        ctRow.PrintList();
                        ctRow = line.ToList();
                        line = null;
                    }
                }//end loop

                //if we come to the end of the loop, and ctRow still has data we need to write it
                if (ctRow.Count > 0) {
                    ctRow.PrintList();
                }

            }//end usage

            //pauses output only when I am debugging it
            if (Debugger.IsAttached) {
                Console.Write("Press any key to continue... ");
                Console.ReadLine();
            }

        }//end main

    }//end class

}//end namespace

And here is the excel reader that I wrote...

/*Author: overwraith*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;//for the Missing enumeration
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.Excel;

namespace ExcelOperations {
    public class ExcelReader : IDisposable {

        private Application XLApp;
        private Workbook XLWorkbook;
        private Worksheet XLWorksheet; …
overwraith 83 Newbie Poster

One of the things I have noticed about Excel programs is occasionally Excel thinks that comma separated value text(CSV) files are excel files, so it will automatically open them. You can alter these files with text operations however. Then there are completely different actual excel files which need operated on through excel interop. You are absolutely sure you need to ask Excels permission to modify the files right?

Operating on the assumption that it is in fact an Excel file would this pseudo code be useful?

list ctRow = new list;

Loop through excel file stop when line is empty
    //move next line into the while loop decision part, while readLine != null || not end of file
    list line = ReadLine()//Read line would need implemented return a list of cell content (strings)


    //first cell is blank, is repeating data
    if(String.IsNullOrEmpty(line.elementat(0)))
        ctRow.Append(line)//need to append without the preceding spaces
    else{
        //else is new data, first line is not blank
        ctRow.Write();//write to output excel file
        ctRow.Clear();
    }

end loop

//if we come to the end of the loop, and ctRow still has data we need to write it
if(ctRow.Count > 0)
    ctRow.Write();

If you break up the program into some smaller, more abstract functions you could probably get a more coherent, easily understood program.

I'll try to hack something together today.

overwraith 83 Newbie Poster

Calm down everybody, I know you don't debug in a production environment, but the previous programmer did not. I quite literally could not get anything done to remedy the situation because the production environment was so complex. I was trying to get everything moved to a test server just when the axe fell. So I am thinking to myself, if it is necessary to debug in production because the dick before me decided he didn't need a test server is there anything I can do about it in the short term if debugging in produciton does become necessary?

Also, they had no source control. I can't help smiling a death's head grin right now.

overwraith 83 Newbie Poster

Stop refering to it as the same cell, you're confusing everybody! A 'cell' is one box. A 'row' is one line of boxes left to right. A 'column' is all the cells in a vertical line (up/down).

So what you seem to want is to take the repeating rows, and put them all on one row, one after the other?

These terms matter when you start dealing with the Excel interop stuff.

ddanbe commented: Quite right. +15
overwraith 83 Newbie Poster

I wrote an excel program a while back, If I remember correctly the workspace cell bounds should be uniform regaurdless of whether the cell has data in it or not, or at least that is usually the case. So you should get a well defined box around your data. What I ended up doing is writing basically a wrapper for all the excel stuff, and I got each cell one at a time. This way I could put higher level looping logic in another class which was responsible for everything else. What I was doing was matching two files, not joining cells. In this wrapper though I created a method GetNextCell() which would return the string representation of each cell. I kept the left to right movement and the top to bottom (essentially typewriter like movement) in that method. You could say it is a side effect, but it seemed to work for me.

/*My wrapper basically contained all the excel related elements such as worksheets, excel objects, etc. Was disposable so would close the interop correctly. */

//CtCol, CtRow, and MaxColumns are class level variables
public string GetNextCell(){
    //there are like 3 different options for getting data from excell sheets, text, another for numerics, and another for something else
    var str = XlWorksheet.Cells[ctRow, ctCol].Text;

    //take care of the iteration before we leave the method
    if(CtCol == MaxColumns){
        //excel columns/rows 1 based, not zero
        CtCol = 1;
        CtRow++;
    }else{
        CtCol++;
    }

    return content;
}

Don't have access to the …

overwraith 83 Newbie Poster

Changing all the methods names to a single pattern/name is actually a good idea. If you do that, and you have access to the classes of Airports, Products, and Persons you can modify them to all inherit from an interface, and therefore do what you want to do, make a more generic method for accessing them. The following code is actually C#, and I typed it in notepad, so no promises that it actually compiles, is just an example.

/*
  Warning, the following is C#, and has not been tested, I am firing from the hip here... 
  What you want to do is possible. 

  If you possibly can, changing the methods of all associated classes is preferable because
  that means you can access all three from this method provided they all inherit from a 
  common interface. 
*/

//don't know if you have a better name for this one
public interface ICodeExpressable{
    public string getCode();
}

public static T findObject<T>(String code, T[] arr) where T : ICodeExpressable {
    T result = null;
    String ctCode = null; //your match code, "current" is more readable to me

    //I prefer using 'i' as an 'iterator'
    for(int i = 0; i < arr.length; i++){
        ctCode = arr[i].getCode();

        if(ctCode == code){
            result = arr[i];
            break;
        }
    }

    return result;
}

Interfaces allow you to create generic code in this manner. This doesn't even really have to be 'generic', you can simply replace T with ICodeExpressable like so:
ICodeExpressable result = null;

Interfaces allow you to …

overwraith 83 Newbie Poster

I recently lost a job, pretty much because my previous employer expected miracles from an entry level coder. I was tasked with reading years worth of code developed in a sloppy manner (by another coder) in a production environment where I quite literally could not debug without disrupting somebody. There were no test servers implemented. You have probably all realized that it is a lot harder to read code than to write it. (gripe over, now comes the question...)

The question is, in C#/Visual Studio how would one debug in a manner which is non-intrusive to the business environment (Remember, this is "Production") ? Does attaching to process, and attaching to a specific browser only debug for that particular browser? (there are so many features in Visual Studio it's hard to know exactly what is possible some of the time). Are there any other techniques I could use next time around to develop in a full production environment when creating a test server in the short run is impractical?

Also how does one cut through the bs- code and get the the heart of the matter when analyzing a project which is literally hundreds of files? Perhaps there is a project file system structure that could be explained for general web projects?

If you are faced with a previous coder who took all sorts of rabbit trails in his code, ex technologies which are not ever used how do you quickly learn about those technologies in time to be effective? …

overwraith 83 Newbie Poster

So I have done some googling on this, sometimes they are called transcompilers, other times they are called source to source compilers. They have actually been used a lot more than I thought they had. Python had one for updating python 2 to python 3, there was one for migrating off of typescript (I had to work with some old versions of Typescript, was buggy as hell), etc. There was a wiki article that discussed them. Also apparently there are quite a few tools on sourceforge, I may try to browse some code if the download doesn't take all day (seriously why is turtle svn not multithreaded?). I will keep this thread open for a while in case somebody else has other information/links etc to add. Thanks for the discussion guys.

If there was some computer program which could transcompile between languages, it would make life a hell of a lot easier for certain legacy situations. My last job had some really really old code there that they were still actively developing. :(

The problems I guess would be navigating from a language with a certain feature to a language without a certain feature, example C to C++, one is object oriented, one is not. The tools would also break whenever the API changed. One might need some sort of configuration for each language, as well as a way to automatedly perhaps download API calls/configurations as they were added (web bot?). It seems like a very involved process. I have …

overwraith 83 Newbie Poster

Yes, don't create multiple threads on the same topic. What I would do is look into a packet sniffing library like libnet, or pcap, etc. The wireshark one would be best probably. You may need to learn how to do C-calls from C# in order to get stuff working, but if I remember correctly there should be some sort of port or wrapper online which is open source, you just have to google the right stuff. I always had problems doing packet sniffing in C#/higher level languages, because of getting the darn old stuff to compile correctly, and then getting the C-calls working correctly. I eventually gave up the process. The way I see it, the higher level languages like C#/Java have abstracted themselves away from their users being able to do low level things. It is a real battle to be able to do low level operations in highly abstracted languages. We have built ourselves a tower of abstraction, so now the low level things are not easy to accomplish any more. I believe that one of the libraries I tried to use was actually some kind of static library or something, I don't think C# even supports that anymore. If anybody has actually done this, I could learn a lot too if the road was paved a little bit first...

overwraith 83 Newbie Poster

So, I have heard about code porting, basically where you take existing code from one language, and translate it to another language. What I want to know is how does this process work? Are there automated tools for preforming this type of thing, or is it always a manual process? The languages really don't matter to me, I just want to understand the process. For instance, is source code analyzed, or are automated tools used to translate between bytecodes etc.

I would have selected all languages, but there was a limit on the number I could select.

overwraith 83 Newbie Poster

Visual Basic is harder to read than C#... Sorry about the dig VB coders, but you know what I am referring to, Dim'ing variables instead of simply declairing "int num = 14;", and all those nasty do, end if, end loop, etc. Sometimes I use them in comments even in C#, but I like to have the option, and not be forced to actually type out end ... If a statement is really short brackets are the way to go '{', '}'. Truthfully, there are some things Linq associated that VB can do better, and I also think there are some things Linq associated that C# does better, you would have to read C# in depth by john skeet in order to nail down exactly what does what better, but in my opinion the only differences between the languages is verbosity. Realistically they are both .NET languages, so there shouldn't be anything one does that is "better" than the other. As for me and my house I will use C#.

overwraith 83 Newbie Poster

Unless you learn how to do Arp Cache poisoning... ;)

Don't know if there is any windows specific Arp Cache poisoning software available for you though, I think most of the time it only runs on linux because the hackers prefer them, linux doesn't necissarily need antivirus, on windows AV eats your tools.

P.S. I don't condone hackery, just realize there is a whole new world out there called penetration testing which is legal.

overwraith 83 Newbie Poster

So I was thinking, what is the best software for reading xml comments embedded in source code(C#)? Are there alternatives, or is sandcastle the only one? If there are alternatives, which one is the easiest to use, and which ones are free?

overwraith 83 Newbie Poster

I can't find the C# forum! Where's the link? I don't want to browse all languages, just the ones I am interested in...

overwraith 83 Newbie Poster

I am glad deceptikon touched on security through obscurity. While reading through a crypto book I heard about the concept as well. As it is described in the crypto book, no crypography should rely on the algorithim being secret, but instead it should rely on the keys being secret, and the algorithim being robust (no flaws). When it comes to source code, eventually the binary will be reversed, and the processes will become clearer to hackers who are analyzing the algorithim regaurdless of access to the source code. You can make it harder by not releasing source code, but it is really just an obscurity thing, where somebody really accomplished at reversing wouldn't be phased much at all. So my take on it is that the more people you have contributing to the bug fixes, the more secure your source code will be. Safety in numbers. On the other hand making money often requires souce code remain confidential. For me, whether software is proprietary or not is less about security, and more about other factors.

overwraith 83 Newbie Poster

Lots of people use Remote Desktop Protocol programs to access another computer via another. Some of the programs support dragging and dropping files between desktops (not folders, zip it first). The only thing with these is that you have to deliberately turn the service on on the computer you are RDP-ing to, and you have to login to that computer via the program. RDP will also fall flat if your sys-admin has some device on the network configured to disallow this service, most home routers also don't like this by default. I don't know if the program costs, work provided it to me free.

I haven't used dropbox much, so you are uploading to dropbox? Being that it is a web service, there should be some way of programatically uploading files via a web bot? It would need provided your credentials for your drop box account (don't tell me I don't want to know). So what the problem seems to be is that you are using dropbox at home, and it's not allowed at school, but the files you are uploading are at the school. So you would need some kind of SSL socket on your school computer. Or perhaps you just have doccuments you need to peruse on drop box, which are useful to be able to view/copy/paiste from at school.

Have you considered just buying a flash drive? They are pretty cheap these days. Some even have read/write switches so you can plug into an insecure system and …

overwraith 83 Newbie Poster

I remember this example! Frustrated the hell out of me too back in the day! Am thinking to myself would probably be easy now, to just make an array of chars, and a single for loop starting at the right side, the end of the array, switching values to asterisks as it goes, and printing the whole array each time through the loop. Probably not the textbook version, but now I can see all sorts of clever ways of doing it.

overwraith 83 Newbie Poster

Sending the code along with the app may, or may not be an issue. HTML, CSS, and JavaScript are all transmitted to the client, where the source can be read quite easily. Are you worried about the backend being copied by competitors? If you have sensitive business backend code, then probably just use your own web server. If you decide to code a local one on the customer device whatever web server you code will only be visible to the local net. You basically need to learn about sockets. I know that Elitte Rusty Harold's book Java Network Programming 4th edition has a couple of web servers in it (I know, not the right language, but this book does contain a web server example or two, or more). You could probably at least get a good idea of how to code it from the source code there. I know that it is possible to code a simple C# server, and the examples on the book website should be simple enough to port.

Click Here

Once you understand it is simply a server socket, and a text protocol, you are like OMG, it's that simple? And the threading in his examples is very well thought out and straight forward. I really enjoyed the book.

Source code is located at this site:
Click Here

I can see situations where he may not be giving away code which is very vital, for example a web compiler, or some tool, …

overwraith 83 Newbie Poster

I thought nobody would ever need a loop like this, but I am happy to be mistaken...

This is 'parallel', so you will have to remove the thread pool call, but you should be able to derive something useful from this.

/*Author: overwraith*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace ParallelTests {

    class Program {

        static void Main(string[] args) {
            //int i = 0;
            //ParallelExt.For(
            //    i + 1,                                          //Start value. 
            //    j => j != i,                                    //Comparison operation. 
            //    j => { Console.WriteLine("Counter: " + j); },   //Loop body. 
            //    (ref int j) => { if (j == 10) { j = -1; } });   //Loop conclusion. 

            int i = 5;
            ParallelExt.For(
                i + 1,                                          //Start value. 
                j => j != i,                                    //Comparison operation. 
                j => { Console.WriteLine("Counter: " + j); },   //Loop body. 
                (ref int j) => { if (j == 10) { j = -1; } });   //Loop conclusion. 

            Console.Write("Press any key to continue...");
            Console.ReadLine();
        }//end main

    }//end class

    public static class ParallelExt {

        public delegate void LoopConclusion(ref int counter);
        public delegate void LoopBody(int counter);
        public delegate bool LoopConditional(int counter);

        //method for wrap around for loops, 0, 1, 2, 3, 4, ..., 0, 1, 2, 3
        public static void For(int start, LoopConditional condition, LoopBody body, LoopConclusion conclusion) {
            var events = new List<ManualResetEvent>();

            for (int i = start, j = 0; condition.Invoke(i); i++, j++) {
                var resetEvent = new ManualResetEvent(false);

                ThreadPool.QueueUserWorkItem((arg) => {
                    int value = (int)arg;
                    body.Invoke(value);
                    resetEvent.Set();
                }, i);
                events.Add(resetEvent); …
overwraith 83 Newbie Poster

I don't see why the number of download threads are limited, unless you have users using the threads or something, then it would be more of a matter of limiting them to n threads in the API. Just Curious, why the limitation? Is it a user thing or something? Are you downloading like hundereds of files or something?

My initial thoughts are that if the number of threads are limited perhaps you could serialize the tasks to a file, or CSV, or something (the task object it's self, not the stream, so just thread metadata for restarting), I actually like XML if the threads have been paused, or something. Long running tasks could therefore perhaps be demoted, or paused and sent to a file provided they aren't time sensitive, because the longer the files download, the more they are abusing your obviously limited bandwidth. You could store the index in the file, and some other info like size to ensure the file hasn't changed since the last time you started downloading. If the computer which is preforming the ops need not be rebooted on occasion, then you can just put tasks in a collection. Perhaps you could use some sort of circular buffer or something so the old threads wouldn't be perpetually on the bottom of the list if there were problems with bandwidth.

If a file is clearly more important than others you can use an enum as a flag. I am not even going to lie, the following …

overwraith 83 Newbie Poster

I can't find the code for Combinations, but you appear to have a lot of data coming out of that class. If I was you I would review the code, and see if perhaps I could convert combinations, or something else into an IEnumerable, aka a state machine. Use Yield Return, so you only have one of the lists or something in memory at any given time. I can't see the code though, so I don't know if it is feasible, especially if there are other dependencies. Could you explain what Combinations does, because the name honestly isn't that descriptive. You are providing it a dictionary, but when I think"combinations" intuitivily I would think of something like, hey we got one number, and another number, and I want all combinations between the two, but you are providing it a collection, so I have no idea what it does. Almost literally any place you can turn a collection or file or output into an IEnumerable is a good application of it due to the fact that typically you can keep your memory footprint small. Would a stream help? I don't know. Remember, computers still have limited memory, and even though you have oodles of it to play with these days, Microsoft will eventually smack you down if it thinks your process is too memory hungry.