Cannabis Sativa

Content deleted Content added
Line 213: Line 213:


:Until Win 7 there was the [[Windows Task Scheduler]]. --<span style="color:#00A000;">Hans Haase ([[User talk:Hans Haase|有问题吗]])</span> 14:58, 19 October 2017 (UTC)
:Until Win 7 there was the [[Windows Task Scheduler]]. --<span style="color:#00A000;">Hans Haase ([[User talk:Hans Haase|有问题吗]])</span> 14:58, 19 October 2017 (UTC)

:PCs and laptops just don't seem like good platforms for stopwatches, to me. Mine periodically pauses for a few seconds, to start some update, etc. Even if it could deal with that and not mess up the timer if one of those pauses was entirely within the timed period, there's still the delay in pressing the start and stop buttons, should one of those pauses happen then. I use my cell phone stopwatch, and an actual [[stopwatch]] would likely be even better. [[User:StuRat|StuRat]] ([[User talk:StuRat|talk]]) 15:27, 19 October 2017 (UTC)

Revision as of 15:27, 19 October 2017

Welcome to the computing section
of the Wikipedia reference desk.
Select a section:
Want a faster answer?

Main page: Help searching Wikipedia

   

How can I get my question answered?

  • Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
  • Post your question to only one section, providing a short header that gives the topic of your question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Don't post personal contact information – it will be removed. Any answers will be provided here.
  • Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
  • Note:
    • We don't answer (and may remove) questions that require medical diagnosis or legal advice.
    • We don't answer requests for opinions, predictions or debate.
    • We don't do your homework for you, though we'll help you past the stuck point.
    • We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.



How do I answer a question?

Main page: Wikipedia:Reference desk/Guidelines

  • The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
See also:


October 14

Hover over wikilinks

Recently, a new feature mysteriously appeared: when hovering cursor over a wikilink, the tooltip popup displayed a summary from the lead of the target article with an image (if available). It was a nice feature; however, just as mysteriously, that feature is now gone. I haven't done any updates (Firefox, Win7, etc.) or add/remove browser add-ons, etc. Any idea what's going on here? Is this a Wikipedia thing, or Firefox, or... (?) — 2606:A000:4C0C:E200:7595:47BF:7C36:8BA6 (talk) 06:13, 14 October 2017 (UTC)[reply]

I don't know why this feature suddenly occurred for you, but if you create an account, you'll be able to set this as a feature in your preferences. It's under Gadgets > Browsing > Navigation Popups. Rojomoke (talk) 07:19, 14 October 2017 (UTC)[reply]
Odd. I've never had an account, and this all occurred on the same computer. The only thing that I can think of that might be relevant is that this is a dynamic IP -- perhaps it happens only on certain IPs; but that doesn't make sense either. Anyway, ... thanks for the info. 2606:A000:4C0C:E200:7595:47BF:7C36:8BA6 (talk) 08:36, 14 October 2017 (UTC)[reply]
The former reply is a little inaccurate. IP's never get Navigation Popups but they can get the similar mw:Beta Features/Hovercards, called "Page previews" for registered users at Special:Preferences#mw-prefsection-betafeatures. mw:Beta Features/Hovercards#2017 A/B test on English and German Wikipedias mentions a former test where some randomly selected users get it. I guess there is also a current test. PrimeHunter (talk) 20:32, 14 October 2017 (UTC)[reply]
Unregistered users with JavaScript in their browser can see an example article with Navigation Popups here. I don't think you can see Hovercards without being randomly selected or enabling it in an account. PrimeHunter (talk) 20:47, 14 October 2017 (UTC)[reply]
[ec] I have visited German Wikipedia recently; perhaps it carried-over, or something. —2606:A000:4C0C:E200:7595:47BF:7C36:8BA6 (talk) 20:49, 14 October 2017 (UTC) -- And yes, I do see it on the page you linked, so evidently I have JavaScript in my browser (somewhere).[reply]
Okay; A/B test on English and German Wikipedias sounds like the right time period, but seemed more recent, and didn't require visiting de.wikipedia (or voodoo). So...
Resolved
 – 2606:A000:4C0C:E200:7595:47BF:7C36:8BA6 (talk) 21:19, 14 October 2017 (UTC)[reply]


October 15

How to download all <10 kb images (icons) from a website (website, not webpage)

Is there a way to use a browser extension such as Firefox's DownThemAll or similar to download all the icons from a website such as http://hitfilm.com/reference/hitfilm-express-2017/

Settings to limit file size or image resolution are easy to come by but figuring out how to make the extension spider its way around the folder structure to different webpages is not easy and all the help I can find on Google pertains to the simpler scenario of downloading from a single webpage rather than many webpages in an online directory (incidentally, is it correct to refer to "hitfilm-express-2017" in the above url as an online directory/folder?).

This is an example image

I'm fairly sure HTTrack can do this if you fiddle with the settings. WegianWarrior (talk) 10:18, 15 October 2017 (UTC)[reply]
  • This may be of interest. Short version: you usually cannot, because you have no way to know all valid subpages of a domain. What you can do is crawl the pages (i.e. follow the links from the home page, and the links from there etc.) and pull the images; this may be enough for your purposes. TigraanClick here to contact me 11:12, 16 October 2017 (UTC)[reply]

Google Home

Why cant it be installed it on my samsung phone? I downloaded it but it dont work. Whats wrong?--213.205.252.246 (talk) 01:10, 15 October 2017 (UTC)[reply]

The Google Play app page[1] should tell you if it's compatible with your device.
If it is, and it still won't install, my guess would be that you don't have enough space to install it. ApLundell (talk) 16:32, 16 October 2017 (UTC)[reply]

Difference between some Adobe apps

Can someone help me in knowing the difference between - Adobe Muse, Adobe Dreamweaver, Adobe Portfolio and Adobe Behance?

Thank you 180.151.239.13 (talk) 08:29, 15 October 2017 (UTC)[reply]

Have you read our articles on Adobe Muse, Adobe Dreamweaver, Adobe Portfolio and Adobe Behance?--Shantavira|feed me 09:14, 15 October 2017 (UTC)[reply]

Visual Basic's normal behavior?

I'm using Windows 7 with Visual Studio 6. When I tried a simplest problem to multiply 8778 with 9, the program told me it's "overflow". Bug of some sort or programming error on my part? The actual code is at https://imgur.com/KAa6rw4 Thanks 27.255.221.58 (talk) 19:59, 15 October 2017 (UTC)[reply]

Try Print 8778.0 * 9.0
It's likely that VB is giving your values a default type of a short integer, which will of course overflow. If you make them look like floats, it will then treat them as floats and avoid the overflow. Another way would be to multiply variables of a defined (and adequately large) type, not numeric literals. Andy Dingley (talk) 11:50, 15 October 2017 (UTC)[reply]
Thanks for reply, man. Since I am a neophyte, kindly tell me what numeric literals is and how to go about it. I mean kindly be a bit more explanatory, I know it will take some of your precious time, but please oblige. 150.107.152.46 (talk) 12:00, 15 October 2017 (UTC)[reply]
"8778" is a numeric literal
Dim a as Long = 8778
Is assigning its value to a variable instead. When you do that, you get to tell it what type of variable it is.
I am probably required by law to tell you that VB is an obsolete language, was never a good teaching language, and other and better languages are available for free. Python and Processing for just some. Andy Dingley (talk) 12:49, 15 October 2017 (UTC)[reply]
That's VB6? I don't think Print is what you want. Maybe this article will help. -- zzuuzz (talk) 12:20, 15 October 2017 (UTC)[reply]
See Integer_(computer_science)#Short_integer for a discussion on the limits. StuRat (talk) 22:20, 15 October 2017 (UTC)[reply]
Shouldn't the VB parser treat them as floats, though, since the OP included the radix point? I thought that was an accepted convention in programming semantics. OldTimeNESter (talk) 03:00, 16 October 2017 (UTC)[reply]
AFAIR, that's VB's behaviour. But that's not what the OP did (and it's far from obvious that such a minor change would have such an effect!), it was the first answer. Andy Dingley (talk) 11:00, 16 October 2017 (UTC)[reply]

Disk in USB floppy drive showing up as USB drive after power failure?

About an hour ago, I was imaging a set of MS-DOS 6.22 floppy disks on my Windows 7 desktop using VirtualBox (the procedure I was using was: MS-DOS 6.22 VM - pure coincidence, by the way; I use that VM for all my floppy imaging and floppy-image editing - with dual virtual floppy drives, assign the host A: drive [a USB floppy drive, in this case] to the first drive, insert an image of a blank floppy in the second, then use the VM, which sees both of these as physical floppy drives, to copy the files from the actual physical drive to the image. I'd used this setup to copy and edit preexisting floppy images before, but this was my first time using it to image floppies; as an aside, having previously worked purely with floppy images rather than the physical things, I'd forgotten how mind-numbingly slow physical floppy drives are) when the fuse powering the outlets in my bedroom blew. When I got the desktop back up and running (it took a very long time to start up compared to normal, but, then again, somehow I doubt that having its juice suddenly cut off counts as "normal"; thank goodness for NTFS journalling that it was able to start up on its own without even needing to use Startup Repair or something more drastic!), I went back into VirtualBox and fired up the VM to check the damage. Fortunately, the VM was fine (once, a VM - also MS-DOS 6.22, coincidentally - froze and I had to kill it in Task Manager, after which I was unable to ever boot said VM again and had to delete and replace it), but when I tried to access the VM's A: drive to check if the files on the floppy that had been in the drive at the time of the power loss had been corrupted or anything (fortunately, the copy was finished by the time the fuse blew, and the image was both complete and undamaged), I kept getting Abort, Retry, Fail? errors. Every single time. I ejected and reinserted the floppy to see if that would help.

At which point something very odd happened.

The floppy was showing up as a 1.38-MiB USB drive with the drive letter K:!

Naturally curious (and possibly quite stupid as well - please feel free to let me know if that was the case for what I did), I hit the "Open folder to view files" button, at which point the files on the floppy showed up. Going into "Computer" in Windows Explorer, I saw the reason the VM couldn't see the disk; the A: drive had apparently disappeared from the host system. At this point, after swearing at the computer (which did not resolve the problem, although it did make me feel a bit better), I ejected the floppy again, unplugged the floppy drive, and plugged it back in. Voilà - "Floppy Disk Drive (A:)" showed up once again in Windows Explorer, and this time, when I (re-re-)inserted the disk, the VM saw it just fine. No permanent damage to the drive (either physical or virtual), the floppy, or the VM; it looks like the only lasting damage was that the sudden power loss corrupted my Kerbal Space Program savefile on the host machine, forcing me to copy in the data from the most recent quicksave file. But does anyone have any idea why the floppy drive disappeared from the system and said system read a floppy disk as a USB drive? Whoop whoop pull up Bitching Betty | Averted crashes 14:48, 15 October 2017 (UTC)[reply]

Have you checked that usb data cable is ok? And usb connectors are ok? How USB is floppy powered? If from the usb plug then the power may be insufficient? Ruslik_Zero 19:39, 15 October 2017 (UTC)[reply]
Well, it works perfectly again now, and I've never had any other issues with it... Whoop whoop pull up Bitching Betty | Averted crashes 23:39, 15 October 2017 (UTC)[reply]
You didn't mention whether you disconnected the floppy drive before powering up again after the power cut. If you left it connected and then booted up, Windows may have read it as a USB drive. I also have a floppy drive, and always take care to connect it to the USB port after the computer has been up and running for some time. Akld guy (talk) 21:18, 16 October 2017 (UTC)[reply]
Ah, that must have been what happened. I'll be sure to disconnect it before turning the computer back on in the future. Thanx!  :-) Whoop whoop pull up Bitching Betty | Averted crashes 18:55, 18 October 2017 (UTC)[reply]
Yes, I think what happens is that, during bootup, Windows knows that something is connected, so it reports that a drive is present. It cannot load the drivers for the floppy drive. That can only happen if Windows is already running when the drive is connected. Akld guy (talk) 21:28, 18 October 2017 (UTC)[reply]
But then how come it detects that it's a floppy drive just fine if the computer is being booted up after a clean shutdown??? Whoop whoop pull up Bitching Betty | Averted crashes 22:01, 18 October 2017 (UTC)[reply]
A clean shutdown results in the computer remembering the status of each port. It doesn't get the chance to do that when there's an unexpected loss of power. Akld guy (talk) 04:40, 19 October 2017 (UTC)[reply]

October 16

How will you describe the "presenter" in the model-view-presenter?

If the Controller is the user and it's activity manipulating the model via the view, what is the "presenter"? What will be you most short, summary (in say 8-10 words) for this term "presenter"? Thank you, Ben-Yeudith (talk) 06:36, 16 October 2017 (UTC)[reply]

We have articles on both Model–view–presenter and Model–view–controller.
The Presenter performs the same role as the Controller. The difference is really in the relationship between the View and Model in the two overall patterns. With MVC the Controller performs the "change" actions from the user upon the model, and the "display" actions are performed by the model and the view together, without the controller. This "loop" arrangement makes it harder to slice the pattern into layers, either for easier component testing or for highly laminated platforms, such as the web.
The Presenter, in contrast, forms the interface (and the only interface) between Model and View for both display and change actions. This makes the overall system easier to break down for testing and for deployment onto the web (Views can often be on the web client these days, with connectivity by JSON rather than HTML). The Model and View are both easy to implement and test too (but they were in MVC too). The downside of MVP is that he "Presenter" is often (usually?) poorly designed and instead becomes an instance of the Magic pushbutton or God object anti-patterns, where the whole functionality that ought to be in Model or View ends up in the Presenter instead. Andy Dingley (talk) 10:58, 16 October 2017 (UTC)[reply]

Dependency Inversion principle in OOP

A web programmer told me that the Dependency Inversion principle in OOP describes this:

In OOP design we usually go from outside (request) to the inside (response), from the view, to the model (by the controller CRUDing the model via view).

I have 2 questions regarding this:

1. Is this explanation of the principle accurate? Iא doesn't say why it specifically relates to the principle.

2. Why is "from the outer to the inner" is "inverted" in web?... I can't see why it would be inverted and not the other way around.

Anonymous.

We have an article Dependency inversion principle. The description you heard doesn't sound very accurate to me, but perhaps I'm not understanding it fully. Note by the way that the word "inversion" in this phrase is somewhat of a misnomer. Our article says "Nevertheless, the "inversion" concept does not mean that lower-level layers depend on higher-level layers." CodeTalker (talk) 17:17, 17 October 2017 (UTC)[reply]
Yes, sorry not to mention, the last thing you wrote about what I can call "dependency bidirectionality" was also reminded by the programmer. Thank you. Anonynous. — Preceding unsigned comment added by 79.180.1.206 (talk) 01:07, 18 October 2017 (UTC)[reply]

October 17

C structs

hello, is it allowed to cast a struct A*, say, as struct B*, and vice versa, if struct B has struct A as its very first member?
I want to do something like this:

Extended content
#include <malloc.h>

struct node_ {
	struct node_ *next;
};


struct my_int {
	struct node_ link;
	int data;
 };

struct my_float {
	struct node_ link;
	float data;
};

struct my_int *head=NULL;
struct my_float *head2=NULL;

struct my_int *new_int(int a){
	struct my_int *p=(struct my_int*) malloc(sizeof(struct my_int));
	p->data=a;
	p->link.next=NULL;
	return p;
}

struct my_float *new_float(float a){
	struct my_float *p=(struct my_float*) malloc(sizeof(struct my_float));
	p->data=a;
	p->link.next=NULL;
	return p;
}


void insert(void *a, void *b){
	struct node_** p=(struct node_**)a;
	struct node_ *q=(struct node_*)b;
	q->next=*p;
	*p=q;
}

int main(void){

	insert(&head,new_int(17));
	insert(&head,new_int(18));
	insert(&head,new_int(19));

	insert(&head2,new_float(3.14));
	insert(&head2,new_float(17.2));
	insert(&head2,new_float(19.1));

		
	for(struct my_int *p=head;p!=NULL;p=(struct my_int*)p->link.next){
		printf("%d\n",((struct my_int*)p)->data); 
	} 

	for(struct my_float *p=head2;p!=NULL;p=(struct my_float*)p->link.next){
		printf("%f\n",((struct my_float*)p)->data); 
	} 
	
	return 0;
}

this compiles, and works, but I'm not sure it's kosher. TIA 78.50.125.206 (talk) 20:35, 17 October 2017 (UTC)[reply]

Yes, that is safe, as the first item will be aligned to the beginning of each struct. But there is another weak point in your code: you do not check if malloc() returns a valid pointer! If p becomes NULL, an assignment to p->data will most probably end with a crash. --CiaPan (talk) 20:59, 17 October 2017 (UTC)[reply]
thank you! regarding malloc(3), most I could do is print a message and exit, but when the system's at a point where it can't accomodate memory requests for 20-odd bytes, there's no guarantee it can printf() (and especially, sprintf()) either. So letting it crash with a "core dumped" message would actually be more meaningful... 78.50.125.206 (talk) 09:08, 18 October 2017 (UTC)[reply]
There are reasons other than memory exhaustion that malloc() can fail. For instance, many systems allow the available memory of a process to be limited. Of course this all depends on the problem domain. If this is just a toy program, who cares? But if this is part of a larger program, and you want to be well-behaved, always check malloc. (Personally, I think it's a good thing to do anyway. That way you develop the habit of always doing the Right Thing.) On a related note, malloc.h is a non-standard glibc header. The standard C header containing malloc() is stdlib.h. (Again, fine if you want your program to depend on glibc, but I don't know if you do.) Also, you didn't include stdio.h for printf(). Finally, you didn't free() what you malloc()ed. (The same goes for this as for malloc().) --47.138.160.139 (talk) 22:58, 18 October 2017 (UTC)[reply]
Thought that occurred later: if you're new to C programming, a good self-teaching practice is to enable warnings in your compiler, and disable optimizations and compiler extensions. On GCC, I suggest at least -std=c99 -O0 -Wall -Wextra -Wpedantic. Then fix your code to not generate warnings. This will teach you things you might have overlooked, or didn't know were Bad Things or non-standard compiler extensions. Compiler extensions are not inherently bad, but you should be aware you're relying on them. And if you're wondering about optimizations, they can obscure bugs in your code. For instance, the compiler might optimize away code containing a runtime error. --47.138.160.139 (talk) 05:31, 19 October 2017 (UTC)[reply]
POSIX does say that these functions may fail with ENOMEM, but I don't think that happens in practice except perhaps for the first print to a new stream (which might allocate the output buffer for the FILE). (I also agree with 47's library discipline ideas.) --Tardis (talk) 02:53, 19 October 2017 (UTC)[reply]

October 19

Alpha To Unique Colour

I have a bunch of pngs with alpha that I need to convert into bitmaps, process, then convert back to png's. I'd like to just replace the alpha channel with a solid colour, so when I am going back to png I can just turn that colour to alpha. However, I have a large number of files to process and it would take a lot of time and consideration to make sure that the colour I select to replace the alpha channel is unique (moreover, I'm not 100% sure how to do alpha -> colour in GIMP, or anything else for that matter). Any help or suggestions would be greatly appreciated:-) (This is kind of a hack job, I have a bunch of files that are made up of a set of tiles, but I need them in a different format, it is easy to cut and paste the tiles around with a small script, but it is dealing with the alpha that is the issue - I don't know enough about png to figure out how to easily open them up in code and work with them; I'm sure I could figure this out, but it would, probably, take a good deal longer to do that than to do it this way [it's a one time need]).Phoenixia1177 (talk) 07:41, 19 October 2017 (UTC)[reply]

Nevermind - I didn't realize that you could do alpha for a 32bit bmp, everything worked out rather nice, whilst I feel foolish having brought this here.Phoenixia1177 (talk) 11:20, 19 October 2017 (UTC)[reply]

Stopwatch & Timer

I possess "Sony Xperia XA Ultra Dual". A (built-in) 'clock' app consists of four tabs (Alarm, Worldclock, Stopwatch, Timer), the latter are used quite often, but not sufficient.

I'm looking for an app that consist more than one 'stopwatch' in a "Stopwatch"'s tab and more than one 'timer' in the "Timer"'s tab.

Note: Both of are required to work simultiniously if necessity arrives.

P.S.: Please also include any software for PC known and/or hardware product known.

119.30.39.8 (talk) 12:20, 19 October 2017 (UTC)[reply]

Until Win 7 there was the Windows Task Scheduler. --Hans Haase (有问题吗) 14:58, 19 October 2017 (UTC)[reply]
PCs and laptops just don't seem like good platforms for stopwatches, to me. Mine periodically pauses for a few seconds, to start some update, etc. Even if it could deal with that and not mess up the timer if one of those pauses was entirely within the timed period, there's still the delay in pressing the start and stop buttons, should one of those pauses happen then. I use my cell phone stopwatch, and an actual stopwatch would likely be even better. StuRat (talk) 15:27, 19 October 2017 (UTC)[reply]

Leave a Reply