Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I can't offer any suggestions as to implementation but you may want to have a look at Deshaker which is a free plugin for VirtualDub which is also free.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

When the query returns a single value then you can use ExecuteScalar and do not require a reader.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Best for what? Security? Speed of bug fixes? Rendering speed? This question can usually be answered for specific apps (image manipulation, sound editing, etc.) but is generally pointless for more broad software (OS, browser) unless the question is qualified as in "best for...". You might as well ask what is the best vehicle. It depends on what you are doing with it and what specific features are important to you.

I find that when this question is asked it's usually someone trolling.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

OK. Note that I set certain flags to the opposite of yours so that I would see the progress of the spawned task.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Well, the OP tagged the article with PYTHON so I kinda wonder why you posted php code.

rproffitt commented: Mhissed that. Had PHP on the brain today. +7
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Can anybody give me a solution to do this?

Sounds like homework and nobody is going to do it for you. However, if you show us what you have so far we couuld offer help. What parts are you having problems with? Do you have your algorithm (pseudo-code) written out?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The common complaint from users. "It's just what I asked for but not what I wanted."

rproffitt commented: "Written to spec!" +7
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you have no idea how to do any of these things then I suggest you don't try. You'll just be asking us to do it all for you. Start with something simpler and work your way up. If you want all these features but don't want tu use Windows Photo Gallery I suggest you try Faststone Image Viewer. If you are determined you might want to look at this code sample on generating thumbnails.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Sure. Just write each paragraph as a separate line in the save file. Your loop would be

    For Each tbx As TextBox In Me.Controls.OfType(Of TextBox)()
        `output tbx.Text
    Next

with the reverse on form load. You'd need to do some checking such as checkng if the temp save file exists before trying to read it, etc. If you have other non-paragraph textboxes you could put the save/restore textboxes in a container like a panel or groupbox and loop over that cntainer.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Your most important skill as a programmer is the ability to communicate clearly. Develop that skill first.

Never assume that the person you are communicating with has developed that skill. When you are asked to do a job, write down the job (in detail) as you understand it, then get your interpretation verified.

Have principles. Learn when to say no. Many users should be treated like children. Just because they want something doesn't mean they should get it.

Remember that your primary goal as a programmer is not to write code. It is to solve problems. That will likely involve writing code but don't make that your first option.

Aeonix commented: I'm so doomed. +4
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can do it from Windows. Open a command shell as Aministrator and run DISKPART.EXE.

First, list the mounted disks

list disk

Select the usb stick by its disk number (let's assume it is disk 1)

select disk 1

Wipe the disk

clean

Create a primary partition

create partition primary

Select the new partition and make it active

select partition 1
active

Format as FAT32 or NTFS

format fs=ntfs quick

or

format fs=fat32 quick

now get out

exit

That should do it.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If one of your database columns does not have value then it will return NULL. You can either test for that before you try to convert or you can use a function in your query to return a default value (like zero). The MS SQL function is COALESCE as I recall. I'm about to go out but I can check this with an example when I return.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Is it possible that the actual datetime value in the database has 00:00:00.000 for the time portion? I tried this with my SQL database and it worked as you wanted. The first time I got 09/14/1994 00:00:00 and my database value was 09/14/1994 00:00:00.000. When I manually set the database value to 09/14/1994 09:17:23.000 then that was the value displayed when I ran the code.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

First of all, you should have specified that this is (probably) a database question, plus, what type of database. You can't autoincrement a string field. You'd have to specify empid as a numeric (int). if you want to use EMP### as the format then you can calculate that on select as

SELECT empid = 'EMP' + FORMAT(empid,'000'), empname 
  FROM Table_1

This is the syntax for MS SQL (the only database engine I have installed).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I suggest you look into WMI (Windows Management Instrumentation). You can get some info plus a free tool to explore WMI from this site. Here is a direct link to the download. More info is available here.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I have a Chromecast that I use to stream video from my laptop to our TV. It works great, however, until VLC (Videolan) releases their promised upgrade with Chromecase support, I am limited to streaming files in the mp4 format. Fortunately, ffmpeg allows me to convert other formats to mp4. Unfortunately, figuring out what parameters to use can be daunting. So far I have determined the commands to use to convert avi, flv and mkv. The last two are a simple repackaging of the contents (takes but a few seconds). The first, avi, requires a complete recoding. The following commands perform the conversion to mp4 with no loss in quality.

ffmpeg -y -i in.avi -c:v libx264 -crf 17 -preset slow -c:a aac -strict -2 -b:a 192k -ac 2 out.mp4
ffmpeg -y -i in.flv -vcodec copy -acodec copy out.mp4
ffmpeg -y -i in.mkv -vcodec copy -acodec copy out.mp4

But who wants to have to remember all that and type it in every time. That's why I coded up some vbscript to do it for me. It can be run from the command line (supports wild cards), or you can drag and drop a file onto a shortcut to the script. Copy the code and save it in a file with a name like ConvertVideo.vbs. Before running it you should do the following (only necessary to do this once)

Open a command shell as Administrator and type

cscript //nologo //h:cscript //s

This sets cscript.exe as the default script engine. If …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Try

Private Function NextID(empid As String) As String

    Dim n As Integer = CInt(empid.Substring(3))
    Return empid.Substring(0, 3) & Format(n + 1, "000")

End Function

Test with

MsgBox(NextID("EMP013"))
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You do

Dim con As New MySqlConnection

but you haven't assigned a connection string so there is no way to actually connect to your database. Also, you are doing ExecuteReader before you create cmd and assign the query string. For examples of how to connect, query and read please see this code snippet

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

GetString(num) returns the item at that column in the current record. You are going to have a problem though because you are creating a new ListViewItem (as per my example) but trying to add that into a DataGridView. Add the rows as follows:

dgvreceipt.Rows.Add(New String() {dr2.GetString(0), dr2.GetString(1), dr2.GetString(2)})
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You'll need to add

Imports MySql.Data.MySqlClient

Then you'll need a connection string. Typically something like

Dim con As New OleDbConnection("Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;")

Patch in your own values for myServerAddress, myUsername and myPasswword. Then you need a command.

Dim cmd As New OleDbCommand("", con)    
cmd.CommandText = "SELECT * from daily_income" _
                  " WHERE mydatefield BETWEEN '2015-12-01' AND '2015-12-31'"

Then you have to open the connection.

con.Open()

Read all the records returned

Dim rdr As OleDbDataReader = cmd.ExecuteReader()

Do While rdr.Read
    ListView1.Items.Add(New ListViewItem({rdr.GetString(0), rdr.GetString(1), rdr.GetString(2)}))
Loop

And clean up.

rdr.Close()
con.Close()
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The synax is

SELECT * FROM daily_income
 WHERE someDate BETWEEN '2015-12-17' AND '2016-01-10'
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can get the value as an integer by

Dim key As String = "HKEY_CURRENT_USER\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
Dim proxyEnabled As Long = My.Computer.Registry.GetValue(key, "ProxyEnable", Nothing)

If proxyEnabled <> 0 Then
    MsgBox("Proxy server is enabled. Your privacy is at risk!")
End If
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm assuming (like me) that you have a cable or DSL modem that connects to your router. If that is the case then you might try (for a short time as a test only) cabling your computer directly to the modem (bypassing the router). If you still get the ads then the problem is likely not with the router. If the ads disappear then the router is likely the problem and should be wiped/reset or discarded.

Without going back into all the previous posts, has anyone else suggested booting off a Linux LiveCD to see if the problem persists?

When you type an address into the address bar of the browser, Windows must convert that to an actual IP address. It does this in stages. First it checks to see if the address is of the computer you are on. If not then it checks to see if the HOSTS file has an entry for that address. If so then it uses that IP address. If not then it starts doing DNS queries. Domain names can be cached at various levels. Your router/modem can serve as a DNS but the cache of addresses is usually small. If the address cannot be resolved there then an external DNS must be queried, and so on up the hierarchy until the name is resolved or the top of the hierarchy is reached.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

This might help until you fix the actual problem.

Open a shell as Administrator and add the following line to C:\WINDOWS\System32\drivers\etc\HOSTS

127.0.0.1    wonderlandads.com
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

old Windows feel and familiarity

Except for the fact that they've totally rearranged everything and the start menu is completely different.

usb3.0

Except that this is a hardware thing, not a software thing. My laptop has USB 3.0 and is running Windows 7. Likewise, USB 3 works (DUH) under Linux.

avoid moving all your stuff to the cloud. Stay in control of your stuff!

No argument there.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Or you could run Windows Update from the control panel. Windows 10 should be either in the Optional list or (perhaps by now) in the Important updates.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Yeah. Upgrading is easy. Not upgrading is hard.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

People who prefer Windows will say that Windows is better. Likewise with any flavour of Linux.

Arch Stanton commented: Yes, that's generally true :) +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In order to further (artificially) inflate the number of Windows 10 installations, Microsoft is now showing the following pop-up on some users' computers:

Screenshot-2015-12-16-at-12.53_.29-1200x755_.png

And even more heavy-handed, some users are getting the following:

CWPDV8CUwAEhcpT-1.png

Smart users will realize that they can always click X and just close the window. Smart users are also aware of the awesome GWX Control Panel which, until recently, allowed users to permananently disable the Windows 10 upgrade notices. Microsoft is now silently resetting the AllowOSUpgrade setting as often as once a day. So even if you have stated that you do not want the upgrade and have used GWXControlPanel to specifically block it, Microsoft's response is still f**k you, you're getting it anyway.

Microsoft has also confirmed that early in 2016 they will be changing the status of Windows 10 Upgrade from Optional (which at one time was "accidentally" defaulted to selected) to Recommended which means that users who have opted to apply updates automatically will get Windows 10 whether they want it or not.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Number of deaths in the US in 2013 according to the CDC

  1. Heart disease: 611,105
  2. Cancer: 584,881
  3. Chronic lower respiratory diseases: 149,205
  4. Accidents (unintentional injuries): 130,557
  5. Stroke (cerebrovascular diseases): 128,978
  6. Alzheimer's disease: 84,767
  7. Diabetes: 75,578
  8. Influenza and Pneumonia: 56,979
  9. Nephritis, nephrotic syndrome, and nephrosis: 47,112
  10. Intentional self-harm (suicide): 41,149

Total for the above is 1,910,311. In comparison, since 9/11, 93 people have been killed in terrorist attacks on US soil, the majority by white, conservative terrorists.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you want help with that you should probably format it so that it is readable by humans.

rubberman commented: My sentiments exactly! +13
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Could be a cabling problem. I had to return my Inspiron for repair when the display died last September. It's started to flicker again so i will likely have to send it back in. Does it flicker when you reposition the lid? Does the display go dark when you boot in safe mode? There is a "hidden" video diagnostic you can run from a powered down state. Press and hold the D key when you power up.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Same to you, and you might want to keep the cat off the keyboard. The hair gets into everything.

diafol commented: Heh heh - v droll. +0
rproffitt commented: Niece moved in last week. 4 cats. Will update later. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm thinking thal last_insert_id() doesn't get set until you actually execute the query so how about trying

$stmt = $this->db->prepare("INSERT INTO product_master(reg_id,category_id,sub_cat_id,product_name)      VALUES(:reg_id,:category_id,:sub_cat_id,:product_name)");

$stmt->execute(array(':reg_id'=>$productDetails['registration_id'],
':category_id'=>$productDetails['catagory_id'],
':sub_cat_id'=>$productDetails['sub_cat_id'],
':product_name'=>$productDetails['product_name']));

$query=$this->db->prepare("INSERT INTO gy_product_detail(product_id,product_detail,"
    . "product_image_back,product_image_left,product_image_name,product_image_right,"
    . "product_rate,product_discount) VALUES (last_insert_id(),:product_details,"
    . ":product_image1,:product_image2,:product_image3,:product_image4,"
    . ":rate,:discount");

$query->execute(array(
':product_details'=>$productDetails['product_details'],
':product_image1'=>$productDetails['image1']['name'],
':product_image2'=>$productDetails['image2']['name'],
':product_image3'=>$productDetails['image3']['name'],
':product_image4'=>$productDetails['image4']['name'],
':rate'=>$productDetails['product_cost'],
':discount'=>$productDetails['product_discount']));
shany0786 commented: this seems not working don't know where i am wrong +1
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

"Some luck lies in not getting what you thought you wanted but getting what you have, which once you have got it you may be smart enough to see is what you would have wanted had you known."

Garrison Keillor

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How about here?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

OK. Just one more:

Political Correctness: a doctrine, fostered by a delusional, illogical minority, and rabidly promoted by an unscrupulous mainstream media, which holds forth the proposition that it is entirely possible to pick up a turd by the clean end.

BustACode commented: You're close, however that stench you're commenting on imminates from deeper down--from the Khazarian sewer. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Can't find anything? Thsts funny. When I google update error 8007007F I get quite a few hits.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How difficult could be to recognize DaniWeb as an app that could have multiple UI's

Keep in mind that, unlike Google and Facebook, Daniweb is the product of one person with finite time and resources.

The second question should be the obvious one, I have to click in the menu sandwich ... I am going away from it and the menu sandwich don't go away , why? Is there any reason for that or it is only you don't care ?

One of the things I look for in controls is consistency. If I see a specific type of control, it should behave the same way in different places. The waffle behaves that same way in Chrome and Firefox. Why should Dani code it to work differently in Daniweb?

how Google or Facebook do it ?

See point #1.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Unfortunately, now thay you have expanded C into the deleted partition you are likely out of luck. For the future I suggest you do regular backups of your files, especilly the important ones, to external media. Personally, I keep two external hard drives. I back up all changed files to drive-A once a week. I do the same from drive-A to drive-B once a month. It doesn't take a lot of time and it has saved my bacon several times.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can find just about any connection string at connectionstrings.com.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

"It's all about me".

Reminds me of my wife's sister. Seriously though. I agree with Dani on this one. And you only have to click on it once to figure out what it's for.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Welcome to DaniWeb. Feel free to post questions. Before you do, please review the rules. The rules are not useless boilerplate drivel. They're meant to be read and followed.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Once you get Windows 7 back up and running you may want to have a look at GWX Control Panel to help prevent any further attempts from Microsoft to UPDATE-YOU-FOR-YOUR-OWN-GOOD.

@ECODATA - That's why they invented Virtual Box, Virtual PC and VMWare.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It's time to start ruling things out. Run task manager. Disconnect from the internet (yank the cable or turn off your wireless). Does your CPU usage go down? Boot into safe mode. Is CPU still high? If the CPU is maxed out, what task(s) are responsible? The snapshot you posted doesn't show high CPU. Try running SysInternals Process Explorer.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

My career at Manitoba Hydo was about 20% developing/maintaining new applications and 80% maintaining/enhancing applications/systems developed by others. You have to context switch between only two systems, both developed by you. While I am sympathetic, trust me when I say it could be a lot worse. You can also trust me when I say it that context switching gets a lot easier the more you do it.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You are over complicating the problem. You need three things as input

  1. the number of organisms in the original population
  2. the number of days to calculate growth
  3. the percentage growth per day

The user will likely enter the growth rate as a number from 1 to 100. You can convert that to a daily multiplier by dividing that by 100 and adding 1. For example, 20% becomes 1 + 20/100 or 1.2. Each time through the loop you multiply the current population by this number to get the next population size. So the only two statements you need in the loop are

population *= growthRate

and a line to add that result to the listBox.

Now I'm going to offer some unasked for advice. It is no longer encouraged to prefix variables with their type, as in intCount. It is also useless to name a variable with a name that does not indicate its function. Integers are, by definition, counting numbers so intCount is both redundant and uninformative. It is more important to name the variable it indicate its function. Generally, the type can be inferred from the function. NumDays, for example, will likely never be anything but an integer.

My suggestion would be to copy your inputs into local variables such as

population
growthRate
numDays

Of course, with appropriate error checking before converting from string to numeric. Then your loop looks like

For day As Integer = 1 To numDays
    population *= growthRate
    lstFinalData.Items.Add("end of day …
ddanbe commented: Great explanation. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

US police seized $4.5 billion in cash and property through civil forfeiture in 2014. In the same period $3.9 billion worth of property was stolen in burglaries. Under civil forfeiture, police do not have to provide any proof of criminal activity. You must show proof of innocence in order to get your assets returned.

rproffitt commented: +6M for RJ +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

"There was only one time in American history when the fear of refugees wiping everyone out did actually come true, and we’ll all be sitting around a table celebrating it on Thursday.”

John Oliver

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Suggestions for improvement - add the ability to re-assign a key that has already been assigned. You could do this by testing (in the common click handler) if the CTRL key was being pressed while the button was clicked. So click on a blank button means assign the next keystroke to the button. CTRL-click on a button, blank or otherwise means the same thing. You might also add the ability to unselect a button. If you followed my earlier suggestion of changing the BG colour you could determine if a currently selected button has been clicked again, in which case you could just unselect it and change thee BG colour back to default.

Also, you might want to ensure that you ignore assigning keys for values that have already been assigned to a button.