Programming

52K

Solutions

57

Articles & Videos

40K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.

Share tech news, updates, or what's on your mind.

Sign up to Post

This strange error on displayed text (in image) I have seen over and over again on dozens of pages. Then I tried using Chrome and the problem went away.

SafariMacTextError
Do I need to switch to Chrome?

Thanks
0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

When I use FileInfo to return the size of a file for me, it is returned in bytes. The code is simple enough.
FileInfo fi = new FileInfo(filePath);

Open in new window

The code then returns 16599774 bytes for the file in question.
size in bytesI then convert it to Megabyte by using the following code in an extension method.
return (bytes > 0) ? (bytes / 1024f) / 1024f : bytes;

Open in new window

I return the MB size as follows:
$"{Round(fileLength.ToMegabytes(),1).ToString()} MB";

Open in new window

I see that the size returned is 15,8 MB. When I look at the file properties however, I see this:
file propertiesWhen I view the file in Windows Explorer, I see a different size again
explorer sizeMy question is this:
1. Why the difference in file sizes between 15.8 MB and 16 599 774 bytes that I am seeing in code and in the file properties? Does it have to do with the data types? The bytes being long and the MB being double?
2. Why is the file size in Windows Explorer different again at 16 211 KB?
I understand why there is a difference between Size and Size on disk, but not between bytes and MB.
0
Back in the day (about to show my age here) when I was deep into using the Commodore Amiga and Workbench, I worked with a developer on the ability to create a RAM Drive. Not just a drive letter in Ram, an actual drive.

Essentially, the idea was to create the ability of making a pseudo hard drive in Volatile Ram space, that could be used as a regular hard drive.

Obviously, this had huge benefits in terms of program speed, as you could hack install an operating system into this disk and then install software into it (mostly games at the time) and then run that software at unheard of speeds. He actually got it working too! Sadly, he's now deceased so all his ideas and work were lost with him.

A recent question on Experts Exchange made me remember the project so I was wondering if anyone had heard of something like this for Windows?

NB: I know the RAM considerations, but I currently have a high end server sitting around here doing nothing, that also has 128GB of RAM installed in it. More than enough for an operating system and some programs.  And yes I know that all would be lost if the host operating system crashed :)

All that said.. anyone heard of something like this being developed for Windows?
0
I would like to implement a fast fixed point sine approximation for PIC24F microcontrollers on 16bit.
I started from here: http://www.coranac.com/2009/07/sines/
The approximation is done with polynomials: 3rd order up to 5th or even 6th order.
I am stuck in the beginning.
The 3rd order polynomial is S3(x)=(3/PI)*x-(4/PI^3)*(x^3) or S3(z)=(1/2)*z*(3-z^2) with z=x/(1/(2*PI))
I tried an Excel sheet for this function and I compared with sin() from Excel.
Either I make a mistake or the approximation error is too big.
Here is the Excel: https://goo.gl/2KJXj8 
Could you help to debug this?
0
Hello,

In case it's frowned upon, I apologize for importing a question/thread from another forum but I could use some help understanding a couple of comments.

Several years ago, I began using Directory Opus in place of Windows Explorer as my primary file manager for reasons not really relevant to this question.

Recently, I posted a question on the Directory Opus forum with the title:

Force folder shortcut in Windows Explorer to open destination folder in Directory Opus

However, after receiving two fairly detailed replies, I'm unfortunately still not sure what to do. Also, I sense that the difficulty I'm having is related more to my general level of computer know-how (or lack thereof :P) rather than my proficiency level re Directory Opus — although it could easily be that I'm lacking too much in both. Therefore, rather than post a request for a third clarification, I opted to see if one of my friends here on EE (who is likely more familiar with my skill level) could help me understand what to do.

The thread from the other site is included in its entirety below (in case it is the topic of a future search on EE) or it can obviously be accessed at the above link.

Thanks

__________________________________________________
Thread from Force folder shortcut in Windows Explorer to open destination folder in Directory Opus
0
Hello,
I am trying to add a header and tabs with info about the XML data file to .xml file in SAS code. How exactly this can be done? Please see what I have currently I have for my SAS code. I can see the XML data file as my output but the Header (tab and tab2) with all info about the XML file does not show up yet in the XML file.
 
libname xmldir xmlv2 '/basepath/examples/XMLData.xml' xmltype=generic;

/* Req. 1: Macro variables to provide appropriate tab spacing. */
%let tab="    ";
%let tab2="        ";

/* Req. 2: XML file information and header*/
data _null_;
   file xmldir;
  
    put '<?xml version="1.0" encoding="UTF-8"?>';
    put '<Schema Name>';
    put &tab. '<Header>';
    put &tab2. '<SampleDate>2017-06-14</SampleDate>';
    put &tab2. '<CaseCount>30</CaseCount>';
    put &tab2. '<Action>Initial</Action>';
    put &tab2. '<YearPeriod>2017</YearPeriod>';
    put &tab. '</Header>';
    put &tab. '<Payload>';
run;

/* Req. 3: Writing two SAS datsets to xmldir library and creating XMLData.xml data file*/ 
data xmldir.dataname1(label="dataset name1 from sashelp library");
       set sashelp.dataset1(obs=10);
run;

data xmldir.dataname2(label="dataset name2 from sashelp library");
       set sashelp.dataset2(obs=20 keep=var1 var2); 
run; 

libname xmldir clear;

/* Req. 4: XML File End*/
data _null_;
   file xmldir mod;

    put &tab'<Payload>';
    put '</Schema Name>';
run;

Open in new window


So, currently only Req. 3 is working.
Any comments or suggestions will be greatly appreciated!
0
I have a python script that will construct a list of futures contracts for a specified symbol, exchange, and year window.  The script will download pricing information from Quandl for each contract in the strip.  This script works properly.

import pandas as pd
from pandas import ExcelWriter
import quandl

symbol = 'ES'
exchange = 'CME/'

start_year = 2015
end_year = 2016


#Constructs a list of futures contract codes for a particular symbol
#and timeframe.
futures = []
months = 'HMUZ'
for y in range(start_year, end_year+1):
    for m in months:
        futures.append("%s%s%s%s" % (exchange, symbol, m, y))

#Download the data from Quandl.
for f in futures:
    quandl.ApiConfig.api_key = "xxxx"  
    data = quandl.get(str(f))
    data = data.drop(data.columns[[3, 4, 7]], axis=1)

I have another python script that will create a continuous futures contract from 2 consecutive contracts in the futures strip.  It uses the perpetual method; identifying the roll date as the first day where volume of the far contract exceeds volume of near contract, and then adjusts the prices of the previous 4 sessions to roll date by weighting the near and far contracts in increments/decrements of 20%.  This script works properly.

import pandas as pd
from pandas import ExcelWriter
import quandl

#Get quandl futures data
quandl.ApiConfig.api_key = "xxxx"    
contract_near = quandl.get("CME/ESH2015")
contract_far = quandl.get("CME/ESM2015")

#Drop the columns …
0
Hello Experts.

I'm still very much a novice when it comes to VB.NET, and am hopeful that with time and practice, I will learn.

I've been working on trying to get some HTML text to scroll inside a fixed graphical frame to give it a nice look.

Today I was able to get just about everything situated, but realized that I really didn't even want vertical scroll bars to be visible.

I thought perhaps I could create regions at the top and bottom where MouseHover would cause the text to scroll up or down, but in the course of my research, found a very promising solution on the MSDN Forum site here.

I'm pretty sure that the primary reason it isn't working for me is because it was designed to work with panels, and I want to apply it to a WebBrowser control, but perhaps there's a way to pull it off. Also note that on the WebBrowser control I set ScrollBarsEnabled to False, but maybe this is required for the HTML text to be "scrollable", and I'll have to find another way to hide it.

Please let me know if you need more details, and I'll be happy to provide it.

Thanks,

Tony G.
Scrolling-Help-Demo.rar.ZIP
0
i am looking for a VBscript code in form of HTA or bat file so that it pops to select folder, once i select the folder, it should rename all pdf files in that folder, by renaming i mean remove any thing after _ underscore of trailing and also replace all dots . with spaces.
0
I'm trying to run commands in command prompt on PC,

npm install -g cordova
cordova platform remove <platform>
cordova platform add <platform>

The NPM part works fine, but when i try to run cordova lines it fails with unknown command cordova. I do have cordova installed since I use it in VS and can deploy to android and ios. I realise I'm somehow missing the path in system path but I cannot find anywhere on the net or computer where the cordova root is. Can anyone help?

Thanks,
Primoz
0
The Ultimate Checklist to Optimize Your Website
LVL 1
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Hi,

I saved a file as a .bat

the file has the code below. It simply copies the files inside a folder into another folder.

xCopy /E/Y E:\source*.* E:\web\newfolder

Open in new window


The problem is that it is not doing it, the black screen comes up and closes right away. I can only see it reads 'files copied 0', but can't see the error. The paths are correct. Both folders exist.

Any ideas?
I am running this on Windows 2012R2
0
The following sessions have data in the Survey Report tab, but do not have a tab in the rest of the report:
124 – Encryption: Policy to Practice (Ali Pabrai) – row 16
137 – 10 Must Have Skills for the 2020 CISO (Todd Fitzgerald) – row 29
147 – How to Build and Grow Your IT Security Team (Tammy Mosites) – row 39
233 – Cyber Future – Security & Privacy Doomed? (Rob Clyde) – row 65
237 – Geek Speak to Business Speak (Mary Breslin) – row 69
246 – Where Audit Analytics Meets Open Source (Andrew Clark) – row 77
258 – Vendor Management with COBIT 5 (William Crowe) – row 89
2510 – How to be an ISACA Speaker (Paul Phillips | Chelsey Fowler) – row 82
Steve_NAC2017_Session-Surveys_5.15..xlsm
0
Hi,

What is the use of below command from eclipse project by right clicking and run as "maven build.."

what is meaning of shade why we need to give in the goal?

please advise
0
Is there a way to export/extract all the values/items from a drop-down field in a PDF?

I have a PDF form, and it contains a few drop-down boxes that I can select.  I want to be able to export/extract all the values contained inside this drop-down.  Is that possible?
0
Hello all

Currently programming another small program that ideally will have a TreeView control that will show the Computers OU and all sub OUs; and the contents of that OU will be displayed in a ListView control. The user will then be able to view information about the computer object and update the computer description and add the computer to an AD group.

I've searched Google and can't find any examples of how to do this at all.

Can anyone give me any examples?
Thanks guys,
0
I'm a relatively experienced (well, old) programmer using VB.Net, usually WinForms applications.  I have a project to write code to automate a weighbridge (used for the weighing of vehicles).  It's a console application.

The weighbridge will have 3 sensors.

1- the Front to signify something moving on to the weighbridge
2-Near the other end that shows when the front of the vehicle is far enough forward to be sure it is completely on, and
3-The rear to signify if the vehicle is leaving (or is too far forward if it didn't stop in position)

There are traffic lights in place that I set depending on the position of the vehicle (sensor triggered).  However events may not always be triggered in the order I expect and I'm not sure if I'm handling the code correctly.  

Here's an example:

1. When the code starts it runs 'Set Weighbridge Normal' - that sets everything to default values, turns on sensor 1 linking to the event handler 'LorryApproaching' and sets the lights green, then waits ...
2. The lorry pulls onto the Weighbride, sensor triggers, code moves to 'LorryApproaching' that turns on Sensor 2 (link to event 'InPosition') and sensor 3 (linked to 'LorryLeaving') and leaves sensor 1 on aswell as you just don't know what some drivers will do!
3. Lorry triggers in position, which in turn tried to identify the lorry, wait till the weighbridge is stable then take a weight.

What if, at this time, the driver doesn't wait and drives on.  During 'InPosition' we are…
0
Say, kindly suggest easy to use software to capture some screenshots eg. the programming of a modem, to be made available for staff training.
0
Hi Experts,

I was assigned to set up passwords to our users in a way that

1- Each user/department has their own password.
2- It should auto get changed every 3 months.

I was thinking of the following..

Since we have a table containing all users initials (AA, BA, CW..), so the password should be a logic that has both their initial, current year and yearly quarter as part of the password, however it should also contain some logic that users should not figure out that the password is indeed based on those specific info?

What are your thoughts?
0
What software do people use to securely manage these different environments, and to push code from one to the other?

At the moment I have to do it manually using sFTP, but wondering if there is a better way?
0
What Is Transaction Monitoring and who needs it?
LVL 1
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

I want to use XSLT to look ahead to both match an attribute value and then capture the value of another attribute - but am struggling a bit.

From this sample XML my current focus is the first line element:

<data>
  <line x="0" z="aa">aaa</line>   <!-- current focus -->
  <line x="0" z="bb">bbb</line>
  <line x="0" z="cc">ccc</line>
  <line x="23" z="dd">ddd</line>  
  <line x="22" z="ee">eee</line>
</data>

Open in new window


At this point I want to look forward at the following sibling line elements as far as the first one whose x attribute is non-zero, and then assign the value of the z attribute of that element to a variable.

So, in the above example XML I want to store the value of 'dd' to the variable.


My unsuccessful attempts at solving this have got as far as this non-working code:

<xsl:variable name="z_var">
  <xsl:value-of select="following-sibling::line[1]/@x != '0'/@z"/>
</xsl:variable>

Open in new window



Can anyone assist?
0
in my folder C:\Flora\Downloads  i have pdf files with website link with it.

i need help with powershell so that when i run it, it removes are URLs and replaces the addtional dots / with spaces.

C:\Flora\Downloads

PRODUCTAB.EAST.BRE.www.producteast.com
PRODUCTAB.EAST.BRE.www.producteast.com
PRODUCTAB.EAST.BRE.www.producteast.com
PRODUCTAB.EAST.BRE.www.producteast.com
PRODUCTAB.EAST.BRE.www.producteast.com
PRODUCTAB.EAST.BRE.www.producteast.com
PRODUCTAB.EAST.BRE.www.producteast.com


so the end result should look like this
PRODUCTAB EAST BRE
PRODUCTAB EAST BRE
PRODUCTAB EAST BRE
PRODUCTAB EAST BRE
PRODUCTAB EAST BRE
PRODUCTAB EAST BRE
PRODUCTAB EAST BRE
0
Good Day!Please help me on this..

1. I want to copy the data from these columns ID Code,Name,Store,Product Code, Brand,Form,Days,Category and Sales Using VBA.
 wb1.jpg2. Paste these values to another workbook "Master file"(template) to their desired column.
 MasterFile.jpg
Please help me..Im new in VBA and only starting in programming :(
0
Hello,

I am trying to run the following .msi cmd nothing happens on the system I am running it on.

msiexec.exe /q ALLUSERS=2 /m MSIMQXJO /i "OfficeModule_Installer_x64.msi"

I also tried

msiexec.exe /q ALLUSERS=2 /m MSIMQXJO /i "%~dp0OfficeModule_Installer_x64.msi"

Still nothing

When I try to run per-system attended

msiexec.exe ALLUSERS=2 /m MSIMQXJO /i "OfficeModule_Installer_x64.msi"

I get error message - Windows Installer Error - This installation package could not be opened. Verify the package exists and that you can access it, or contact your application vendor to verify that this is a valid Windows Installer package.

When I run the .msi manually/directly it installs successfully.

Do you know if I have script incorrect? I am using SCCM to deploy this packaged, just FYI. THANKS!

Thanks,

nimdatx
0
Is there any way to search for all instances of a string in notepad++ and delete the whole line
on which the string is found?
0
Hi,

We are employing a new developer next week.

Our current developers have been working with us for a number of years and they have direct access to everything (which i know is not the best policy).

01 - What is the best way to rollout a new developer onto a project. We have a set roadmap for them to work on, so essentially they will need to access all of the code.

02 - How can you stop a developer from stealing the code, or at least put security precautions in place?

Thanks in advance for your help.
0

Programming

52K

Solutions

57

Articles & Videos

40K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.