 |
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid..
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
I am using System.IO.Compression to create zip file of PDF or CSV files. I used CompressionLevel.Optimal to maximize the compression ratio. However, the percent of compression is 10-12%.
Was wondering if there is another efficient way to do it?
Framework: 4.5
|
|
|
|
 |
Generally speaking, PDF files are already compressed, and don't compress much further - 4% is about what I expect. CSV files on the other hand are text and I'd expect them to reduce by 75% or more unless they are extremely small (when the overhead on ZIP files starts to outweigh the compression).
So I'd start by using a commercial package such as WinZIP to compress your files for testing and compare those results with the ratios you are getting with your app. Getting the same kind of compression for two file formats that are so different internally is suspicious to my mind.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
 |
OriginalGriff wrote: a commercial package such as WinZIP
Is there anything that WinZip can do that 7-Zip[^] can't?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
 |
Sit on my computer?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
 |
Using 7zip is going to require a C# wrapper, like SevenZipSharp: [^].
However, since .NET now provides GZip, I use that, and it's quite powerful.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
 |
I am using the following code line to input a .obj file with an associated .mtl file and several associated .jpg files pointed to by the .mtl file:
aerobaticsSceneControl.Scene - SerializationEngine.Instance.LoadScene(modelFile);
where model file the pointer to the .obj file.
I have on .obj file that loads correctly. However in another file I have downloaded I get the following exception message at the line above:
An unhandled exception of type System.ArgumentNullException; occurred in mscorlib.dll
Additional Information Value can not be null
I get the following debug messages which as someone new to this type of programming doesn't make any sense:
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\Aerobatics Scene.vshost.exe'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Deployment\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 0x17dc has exited with code 0 (0x0).
The thread 0x5678 has exited with code 0 (0x0).
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\Aerobatics Scene.exe'. Symbols loaded.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\SharpGL.SceneGraph.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\SharpGL.WinForms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\SharpGL.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\SharpGL.Serialization.dll'. Symbols loaded.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.Composition\v4.0_4.0.0.0__b77a5c561934e089\System.ComponentModel.Composition.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.ArgumentNullException' in mscorlib.dll
The program '[22836] Aerobatics Scene.vshost.exe' has exited with code -1 (0xffffffff).
I've used 3-D Builder to make sure that all the .jpg files properly link to the pointers in the .mtl file and that all seems Ok.
I'd appreciate any suggestions on where to go from here. Model loads properly when I remove the pointer to the .mtl file from the .obj file so at least I know the .obj file is not a fault.
Thanks for any help,
Andy Cruce
|
|
|
|
 |
You need to go back to the point in your code where the error occurred to try and establish which variable does not contain the correct value. Use a breakpoint and your debugger to stop the program just before that point and step through to see what is happening.
|
|
|
|
 |
Andy, when you post a question like this, it's helpful to provide a little bit more information. For instance, you're leaving us to guess where SerializationEngine comes from, so while I assume you're talking about SharpGL I can't be certain this is the case. As a hint, when you're running the application inside Visual Studio, you can get the stack trace where the exception occurs. When you get the exception dialog, choose to copy the details of the exception as this lists the full stack and gives you more of an idea where the problem is. Also, if the code you're running against is SharpGL, you can download and build it yourself and step into the code while you're debugging.
This space for rent
|
|
|
|
 |
listshop = (from d in dbcontext.Customers where d.CustomerId==clsCommon.Custid & d.ReservedField3!="InActive"
select new ClsPurchaseOrder
{
CustomerId = d.CustomerId,
CustomerName = d.CustomerName,
ReservedField6=d.ReservedField6
}).ToList();
listshop.OrderBy(x => int.Parse(x.ReservedField6)).ToList();
|
|
|
|
 |
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So where are you stuck? What have you tried? What help do you need?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
 |
I have a question about eager loading of navigation properties using EF6. Note I like to use the extension syntax.
Suppose I have three tables A, B and C. There is a one-to-many relationship between A and B, and also a relationship between B and C. So, for a given A, I can obtain the collection of Bs using two methods:
Method 1 : using a primary key query...
var Bs = context.B.Where(b => b.AId == A.Id).ToList();
Method 2 : using the navigation property...
var Bs = a.Bs.ToList();
Now, suppose I want to load C for each B at the same time. Using Method 1 it is...
var Bs = context.B.Include(b => b.C).Where(b => b.AId == A.Id).ToList();
My question is, is there an equivalent simple way to load C for each B when using Method 2?
|
|
|
|
 |
A lot of the time this is based on the serializer that you're using. JSON.NET, for instance, will do this automatically when serializing an IQueryable. Depending on your serialization strategy, you may need to roll your own.
If you need to work with it in intermediate logic, any queryable references will be resolved automatically as long as is not disposed when you attempt to call them. Just don't force enumeration on the collection until you actually need the data item.
Something like
var b = context.As.SelectMany(a => a.Bs); var c = PerformSomeLogicOnEnumerable(b);
return c.ToArray();
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
 |
If I am not wrong, you need all A, B and relevant C's? Give this a try (where "B" is a collection of B's as a property of "A", and likewise "C" is a collection of C's as a property of "B"):
var abc = context.A.Include("B").Include("B.C");
You have just been Sharapova'd.
|
|
|
|
 |
Hi, For example i have a password "123456", So how to check this on a SSID and Return me a Correct or incorrect answer?
|
|
|
|
 |
Which password are you talking about, the router or some website? In either case it is likely that the only way to check is by trying to login via the web interface.
|
|
|
|
 |
i want to hack the wi-fi router by brutforce so how to pass the password to the router/modem adsl in c#?
|
|
|
|
 |
We do not condone, support, or assist in the production of malicious code in any way, form, or manner. This is a professional site for professional developers.
If you want to know how to create such things, you need to visit a hacking site: but be sure to disable all firewalls and antivirus products first or they won't trust you enough to tell you.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
 |
No, i just want to connect to my wi-fi with my password fo example "12345" how to check it in c#?
|
|
|
|
 |
Daniyaltjm wrote: i want to hack the wi-fi router by brutforce
That is trying to bypass a legitimate security feature.
That is malicious.
You will get no help from us.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
 |
OriginalGriff is right. You might think that you have a legitimate reason for wanting to do this (although I remain to be convinced about this) but you wouldn't be the only one able to read the answer and, if we provide you with code to do this, we are also providing the code for people who want to do damage with this technique. This is why you will get no code for this here - we don't know who will end up reading it.
This space for rent
|
|
|
|
 |
I already suggested you just need to use the web interface to try and login. If your password is not valid it will not let you. But if you want to know how to hack a system then you have come to the wrong place.
|
|
|
|
 |
are you kidding me! no any way to check the wi-fi password in the web! it is for the intrface adsl modem no for the wi-fi password They are two separate Issue.
|
|
|
|