After some search on the internet, what worked for me is deleting the ".vs" folder of the whole solution after closing VS and starting VS again so the IDE can recreate the solution db again.
Wednesday, March 9, 2022
Visual Studio, can't find header file
I had a strange problem with VS 2017, where many errors of "cannot find source file xxxx.h" although they are in search path and in incluse vc++ directories of the project.
Tuesday, October 3, 2017
Matlab: Elementwise multiply a 1D vector or a 2D matrix with each slice of a 3D Matrix
I know that an answer to this can be found in many websites like stackoverflow, and actually I am referring to one that has the answer here too. The thing is sometimes having a different wording may help others in search. Also for me as writing about it here will help me memorize and return back to it when needed :)
Matlab is a great tool for numerical computation, but many tricks may be hard to get used too, one of the main features in MATLAB is factorization and using functions like "bsxfun"
I came across a problem that required me to multiply a 2d Matrix by each slice of a 3D matrix, the regular solution for this is to do a For loop and do a simple element wise multiplication for each 2D slice of the 3D Matrix.
another solution is to use "bsxfun" and "permute":
So Assuming you have a matrix A with 3x4 dimensions and a matrix B with 3x4x5 dimensions, you can use :
result = bsxfun(@times, A, B);
or if you have a vector of A of 5 cells and a matrix B with 3x4x5 dimensions, you can use :
Use bsxfun with permute to align dimensions:
result = bsxfun(@times, permute(vec1,[2 3 1]), mat2);
the original link that I had this solution from is in stackoverflow
Matlab is a great tool for numerical computation, but many tricks may be hard to get used too, one of the main features in MATLAB is factorization and using functions like "bsxfun"
I came across a problem that required me to multiply a 2d Matrix by each slice of a 3D matrix, the regular solution for this is to do a For loop and do a simple element wise multiplication for each 2D slice of the 3D Matrix.
another solution is to use "bsxfun" and "permute":
So Assuming you have a matrix A with 3x4 dimensions and a matrix B with 3x4x5 dimensions, you can use :
result = bsxfun(@times, A, B);
or if you have a vector of A of 5 cells and a matrix B with 3x4x5 dimensions, you can use :
Use bsxfun with permute to align dimensions:
result = bsxfun(@times, permute(vec1,[2 3 1]), mat2);
the original link that I had this solution from is in stackoverflow
Monday, October 5, 2015
Cleaning Debug and release folders in visual studio solutions / projects
Either you need to clean these folders to save space, make sure that your projects are clean rebuilt, or you have the nasty error :
fatal error C1083: cannot open compiler generated file: 'xxxxxx.xxx': permission denied
Searching the internet will give you some results from msdn or stackoverflow , that will mostly work like :
MSDN solution .
StackOverflow
but the one that worked for me is a small C++ project :
Clean Visual Studio Workspaces
from there download the source files and build the project and use it directly to clean all these nasty folders
Tuesday, May 26, 2015
fatal error C1083: Cannot open precompiled header file: 'Debug\xxxxx.pch': No such file or directory
This error lost me a lot of time but fortunatly a wise guy at stackoverflow made an extensive explanation on how to solve it, the original thread is at this link :
how-to-fix-pch-file-missing-on-build
The whole problem lies in some header files needs to be already compiled so your compilation goes through. and there is some strategy for handling header files that must be precompiled as Jive Dadson explains in his answer :
and this did all the magic for me :)
how-to-fix-pch-file-missing-on-build
The whole problem lies in some header files needs to be already compiled so your compilation goes through. and there is some strategy for handling header files that must be precompiled as Jive Dadson explains in his answer :
- Right-click on your project in the Solution Explorer.
- Click Properties at the bottom of the drop-down menu.
- At the top left of the Properties Pages, select All Configurations from the drop-down menu.
- Open the C/C++ tree and select Precompiled Headers
- Precompiled Header: Select Use (/Yu)
- Fill in the Precompiled Header File field. Standard is stdafx.h
- Click Okay
- If you do not have stdafx.h in your Header Files put it there. Edit it to #include all the headers you want precompiled.
- Put a file named stdafx.cpp into your project. Put #include "stdafx.h" at the top of it, and nothing else.
- Right-click on stdafx.cpp in Solution Explorer. Select Properties and All configurations again as in step 4 ...
- ... but this time select Precompiled Header Create (/Yc). This will only bind to the one file stdafx.cpp.
- Put #include "stdafx.h" at the very top of all your source files.
(Unix or cygwin users:
find . -name "*.cpp" | xargs -n1 sed -i '1s/^/#include "stdafx.h"\n/')
and this did all the magic for me :)
Tuesday, February 24, 2015
How to download all files recursively from HTTP folders:
Many times we are faced by the problem of downloading a folder listed by apache or IIS on the web, and we have to download the files one by one, or at best case go to each folder and download all links with a tool like downThemAll or FlashGot, which will download the files in a folder but not in sub folders.
a tip at this page :
https://bmwieczorek.wordpress.com/2008/10/01/wget-recursively-download-all-files-from-certain-directory-listed-by-apache/
shows how you can use a command line application named Wget to accomplish this.
Example: recursively download all the files that are in the ‘ddd’ folder for the url ‘http://hostname/aaa/bbb/ccc/ddd/;
Solution:
wget -r -np -nH –cut-dirs=3 -R index.html http://hostname/aaa/bbb/ccc/ddd/
Explanation:
It will download all files and subfolders in ddd directory:
recursively (-r),
not going to upper directories, like ccc/… (-np),
not saving files to hostname folder (-nH),
but to ddd by omitting first 3 folders aaa, bbb, ccc (–cut-dirs=3),
excluding index.html files (-R index.html)
In addition you may want to use a destination folder with the option
-P destDir
where destDir is your destination folder
you can download A GUI for this tool from here:
https://sites.google.com/site/visualwget/a-download-manager-gui-based-on-wget-for-windows
but actually the GUI tool didn't work for me and I ended using the wget.exe file used by this tool from the command line as explained above.
Saturday, August 31, 2013
Signing C++\CLI assemblies in VS 2010
I lost a lot of valuable time because of this problem, so I thought to share the solution that I got as a combination of other solutions posted by people who are more expert than me in this field.
Hope this saves some time for some of you.
- If your assembly is a third party assembly and you can not access it, or ask for a signed version from its provider, then you can use the solution here: Adding a Strong Name to a Third-Party Assembly .
- If you have the C++/CLI project, you can use the same file used for signing the project you are trying to reference to this C++/CLI. This is usually an .snk file. use this file and follow the steps here: How to sign C++/CLI assemblies with a strong name. If this still doesn't work continue to the next point.
- the answer of user634175 , on this link : Is there an easy way to sign a C++ CLI assembly in VS 2010? solved it to me in combination with the previous step.
<Project DefaultTargets="Build" ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- snip -->
<ItemDefinitionGroup>
<Link>
<KeyFile>$(LinkKeyFile)</KeyFile>
</Link>
</ItemDefinitionGroup>
</Project>
Hope this saves some time for some of you.
Saturday, July 7, 2012
The meth of ebay buyer protection
It is just a meth, they get there money from the sellers, so they will always try to keep good contact with them and keep them happy. SELLERS on ebay LIE all the time (except for some of them). I had many cases on ebay that the item was totally not as described, and these cases were in both under ebay buyer protection and not. The best case scenario is that you will return the item to the seller (and you will pay for the shipping) mm.
and you will have either a full refund of the original amount + the original shipping, or only the original amount without shipping. So the BUYER always looses and the SELLER go away with it. In other cases of course you will get nothing, and they will either tell you sorry the item is not covered by ebay buyer protection or the seller doesn't have a return policy. So any one can lie as he wants on ebay as long as he doesn't offer paypal as a payment method. Of course ebay is happy with these people because they make the buyers scared and make them try to buy in paypal where the profit increases for ebay (they get the commission doubled now) . In a case a seller was offering a laptop where he used multi time technical details about an item, i.e. one time he wrote the laptop has a hard disk of 80 GB and in fine line some where else he wrote no hard disk, also, in another place he wrote that the laptop has a processor of 2.4 GHz and in another place 2.2. Usually when you find in a description that the HD is 80 GB, you don't look about other details about the HD. This is pure scam, but ebay allowed it and even deleted the negative feedback i gave to the seller when the seller agreed to return the item, of course i lost the cost of the shipping both ways although ebay stated in the resolution center in the case that i opened that he will return the original amount + shipping. but at the end they get the money from the seller so he doesn't need to loose anything. even if it is clear that he is a scammer. In any case ebay has many honest sellers and i hope for everyone not to need to deal with ebay themselves as in ebay there is 2 customers the seller and the buyer, and the buyer always comes the second.
Subscribe to:
Posts (Atom)