Monday, June 5, 2017

memory - Difference between RAM bandwidth and speed

I am a bit new at this hardware stuff.


I read from Wikipedia that:



Memory bandwidth is the rate at which data can be read from or stored
into a semiconductor memory by a processor.



So, what is ram speed, exactly? Because rams have a PC part which describes the bandwidth and DDR which describes the speed. What's the difference between these two?

On Windows 7, how do I find all my files whose filenames are too long

Dropbox tells me many of my files are not syncing because their name exceeds the max character length


https://www.dropbox.com/help/145/en



Max character length


Windows only allows file and folder names of 260 characters or less.
Note that Windows counts the file path as part of the name, so a file
like C:\Users\Panda\My Documents\Dropbox\Creative Nonfiction\My
Autobiography\Favorite Things\Favorite Foods\Bamboo\Family
Recipes\Fresh Leaves.doc would be 142 characters, not 16. If the
entire file path and name exceed 260 characters, shorten the name or
move the file or folder to a higher-level folder within your Dropbox.



How do I find all the files under a directory whose file and folder names are greater than 250 characters?


(Note: the "Check bad files" tool on that page doesn't find them either.)


Update: there are two suggestions so far, one using powershell that ironically, died when a filename grew too large, the other using cygwin's find and xargs, which may work, but is still running (several minutes later.)


I did solve my immediate problem.


In an emacs shell window, I ran a very simple find


$ find . -type f -print >> ../files.log


Then I opened that in emacs and typed
m-x list-matching-lines ^ ESC 230 . RETURN


Which displays lines that match a regular expression, and the regular expression here is that the line contain at least 230 characters, where 230 was just a rough guess for lines that might be problematical. And that showed me two files that were too long.


For about 20,000 files that regular expression filter turned out to be almost instantaneous.

Sunday, June 4, 2017

How to use Excel 2010 VBA to set series line color, marker fill, and marker line color



I am trying to write an Excel 2010 VBA subroutine to format charts according to a predefined (i.e., defined by me) standard. The particular attributes that I want to be able to set are merely the attributes that become available through the Format Data Series window that opens when one double-clicks on a data series.



In an effort to discover the names of the various properties that I would need to set, I recorded as a macro the changes that I was making to the style of the data series. However, although I can set the Line Color, and the Marker Line Color to different colours via the Format Data Series window, the recorded macro (annotated below) refers to identically named (indistinguishable) objects for the Line Color and the Marker Line Color.



In addition, when I actually run the macro, there are two problems. First, despite the fact that the recorded macro refers to the marker-fill property .ForeColor.Brightness, that line produces an error when the macros is executed. The error says “Method Brightness of object ColorFormat failed". Second the recorded code actually simultaneously sets the marker line colour and the main line for the series, so in the recorded code, they are both first set to what I hoped would be the Marker Line Color, and then both set to what I wanted for the main Line Color.




How do I set the Marker Fill, Marker Line Colour, and Line Colour.



Sub Macro1()
'
' Macro6 Macro
' On Sheet 1 there is a single embedded chrt
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Select
With Selection.Format.Fill
.Visible = msoTrue

.ForeColor.ObjectThemeColor = msoThemeColorText1
.ForeColor.TintAndShade = 0
' The following (recorded line produces an error)
.ForeColor.Brightness = 0.5
.Transparency = 0
.Solid
End With
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent5

.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0.400000006
.Transparency = 0
End With
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent6
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = -0.5
.Transparency = 0

End With
End Sub

Answer



It looks like these formatting options are implemented somewhat awkwardly in Excel 2010 and 2013:




  1. The line color and properties are set as the macro code has recorded them, using the Series.Format object and its children (Fill, Glow, Shadow, etc. [1]).

  2. Marker fill color for all markers in the series is set with Series.MarkerBackgroundColor or Series.MarkerBackgroundColorIndex. Similarly, marker line color for all markers in the series is set with Series.MarkerForegroundColor or Series.MarkerForegroundColorIndex. [2]

  3. Alternatively, marker fill and line colors can be set individually through the Series.Points(n).Format.Fill and Series.Points(n).Format.Line objects. However, at least in Excel 2013, changing Series.Points(n).Format.Line.ForeColor also changes the color of the line segment immediately preceding the relevant data point.




The properties of #2 look like holdovers from the prior Excel DOM, though with expanded functionality in terms of .MarkerForegroundColor and .MarkerBackGroundColor accepting any RGB value. Those of #3 are consistent with the new level of configurability found in Excel 2010 and newer, but they appear buggy. One annoying aspect of the bugginess is that it appears that the marker line colors are problematically intertwined with the series line color--as far as I can tell, it is impossible to change the line color without also affecting the marker line colors, and vice versa. In particular, it would appear that it is impossible to achieve a uniform series line color while also applying point-by-point variations in marker line color using VBA. (Again, I'm testing here in Excel 2013; 2010 may behave differently.)



In any event, in situations where point-by-point color tweaking isn't needed, a helper function such as the following might be useful for making changes to the line color without affecting the marker fill or line colors (here, newLineColor is specified as a Long RGB value [3]):



Sub ChangeLineColorOnly(srs as Series, newLineColor as Long)
Dim oldMkrFill as Long, oldMkrLine as Long

' Store old marker colors

oldMkrFill = srs.MarkerBackgroundColor
oldMkrLine = srs.MarkerForegroundColor

' Set the series ForeColor
srs.Format.Fill.ForeColor.RGB = newLineColor

' Restore the old marker colors
srs.MarkerBackgroundColor = oldMkrFill
srs.MarkerForegroundColor = oldMkrLine


End Sub


An alternative version of the above helper function could easily be written to accommodate colors specified as a SchemeColor [4], or to only store the marker line color, etc.



As for the .ForeColor.Brightness glitch, it presumably resulted from careless recoding of the 'Record Macro' functionality in developing the Excel 2010 release. It probably should only have been inserted into the recorded VBA code for certain types of charts where .Brightness is a valid attribute to be modified.



[1] http://msdn.microsoft.com/en-us/library/office/ff839279(v=office.14).aspx
[2] http://msdn.microsoft.com/en-us/library/office/ff840677(v=office.14).aspx
[3] http://msdn.microsoft.com/en-us/library/zc1dyw8b%28v=vs.90%29.aspx
[4] http://msdn.microsoft.com/en-us/library/office/ff836764(v=office.14).aspx


usb flash drive - How do I make a bootable USB with Windows 8?











How do I make a bootable USB with Windows 8? I would like to install it on my device with a broken DVD device. Has anyone faced this situation?



Answer



Microsoft USB/DVD tool is very easy to use, you need 4GB flash drive and original untouched ISO image. You can obtain them for now from MSDN, Technet and some other places, just make sure to check the SHA of the ISO file.


drivers - AMD graphic card not working after upgrading to Windows 8.1 on a Dell 3521




My Dell 3521 came with Windows 8. I recently upgraded it to Windows 8.1, but since then it is using Intel HD onBoard graphics. I installed the latest drivers for amd but still it picks onboard graphics card only. Also the AMD Catalyst Control Center crashes after every restart. Is there any way to make use of both?



Specs:




  • AMD Radeon HD 8730M (Driver Version: 13.250.31.0)

  • Intel HD Graphics 4000 (Driver Version: 10.18.10.3958 )




Currently I'm unable to use AMD, intel is getting selected by default and if i try to select AMD as the display adapter it reverts back to intel only.


Answer



What you need is graphics drivers from Dell. AFAIK AMD does not bundle Intel drivers with its graphics driver installer and Switchable Graphics functionality can also be missing completely with those or it just doesn't work when drivers are installed separately.



Get newest available graphics drivers directly from Dell, install and test if Switchable Graphics works after that.



Note: this is based on memories from about a year ago when I had to deal with this sort of situations on daily basis. Officially only solution was to use drivers provided by OEM, in few cases where CPU was actually AMD APU did AMD drivers work directly.


partitioning - Windows 10 Tech Preview error: "Windows cannot be installed on MBR disks". My hard drive is GPT. Why am I getting this error?



I'm trying to install the Windows 10 Technical Preview from a USB drive.



The hard drive I'm trying to install on has multiple partitions and is formatted with a GPT partition table. When I start up the Windows 10 TP custom install I get as far as selecting my partition, and then it won't go any further. The installer gives me an error that says "Windows cannot be installed on this disk. The selected disk has an MBR partition table. On EFI systems, Windows can only installed on GPT disks."



But my disk is GPT! When I formatted it, I made sure to make it GPT. Checking it with Gparted in a Linux lives session shows me that the disk is GPT.



Why is Windows failing to recognize that my disk is GPT? And how can I fix it?



Answer



Turns out this problem is caused by trying to install Windows on a GPT disk with USB install media formatted with MBR.



Thanks to a suggestion by @magicandre1981, I created my USB install media with rufus, taking care to select the "GPT partition scheme for UEFI devices" option, booted into the USB drive in UEFI mode, and was able to install Windows properly.


backup - Best language/system to auto-batch copy files & dir's with file rename in Windows 8/10?


Robocopy came so close, but is missing file rename on copy. So could people please direct me to a language or system in Windows that would be well suited to the following :


This is meant to be a simple, basic, back-up plan for a home network with a few Win8/10 laptops & PCs and a central network drive (a USB external drive atached to the router's USB port). Almost all files to be backed up are images or video or music - so already compressed, so there's no point using a commercial backup software with compression. Also, I don't want my files encapsulated in a proprietary backup file format. I just need copies.


I'm imagining a command shell batch file, or VBScript, or.....


The ideal system would allow me to program scheduled backups of selected folders (including all their subfolders) on the computers to their respective folders on the network drive. After an initial full backup of each, the system would perform incremental backups. These incremental backups would really just be to make a copy of any new file, and make a new copy with an indexed filename of any file that has changed since the last backup. That's it.


As I said, Robocopy in a batch file came close, but can't rename files. I don't want to create new folders with indexed names - I want the renamed files in the original folders all together.


I could spend months surveying and learning every possible Windows command and system that exist in hopes of finding something that will do this. I've already spent days researching backup software and Robocopy. So I was hoping this board could just point me in the right direction of something that has the necessary commands and functions to do it.


Thanks.


Answer




After an initial full backup of each



This sounds like an ideal situation for robocopy; it sounds like you're getting hung up on this:



..incremental backups would really just be to make a copy of any new file, and make a new copy with an indexed filename of any file that has changed since the last backup.



To handle that situation I would use FC in a loop to compare a file if it exists in the full backup, and if it does, individually copy it over and include your modified name.




So to set this up, I would determine:



  1. how often you want to do your full backup and whether or not it should erase contents that no longer exist in the source folder and

  2. how often you'd like to do your incremental backups, if not manually.


In both cases, I would likely setup a Scheduled Task in Windows to run the batch file needed. The complexity of either script is going to be determined by your directory structure, but for the most part this is sort of what your incremental backup logic would look like:


@echo off
set "dir=C:\Your\Directory"
set "bkp=N:\Your\Backup\Drive"
for %%A in (%dir%\*) do (
if exist "%bkp%\%%~nxA" (
fc "%%A" "%bkp%\%%~nxA"
if %ERRORLEVEL% EQU 1 (copy /y "%%A" "%bkp%\%%~nA MODIFIED%%~xA")
)
)
)

You can use parameter extensions and different for options to customize the loop based on how your directories are setup. If you don't want to delete anything via robocopy you just use robocopy "source" "destination" /e - you can also loop the robocopy with for to do individual folders at a time as opposed to your root directory - that way you can generate a log file for each one if you're looking to have more granular visibility.


Reference: robocopy, fc, for, copy, parameters


hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...