how to send an image from raspberry pi to web server?

Question: Looking for example codes on how to send images from Raspberry pi to a web server via wifi.
i am really new to raspberry pi and there's already a tomcat server.
I really need your help
Comment: Welcome. Uploading to a webserver takes place via HTTP, generally but not necessarily via an html interface.  Traditionally this is via a multipart upload form but there are other means as well. However, this is platform agnostic -- it doesn't matter whether the upload comes from a raspberry pi or your laptop, etc., it takes place exactly the same way (if you upload something via a web page, it does not matter what computer you are on, it is pretty much the same). You are better off pursuing web programming questions on our larger parent site, [Stack Overflow](http://stackoverflow.com/).
Comment: This is a networking related question
Answer: I am sure that both hosts have SSH installed so another solution could be to use SCP/SFTP. If not, try to use a regular FTP client.
For example on your RaspberryPi:
scp /path/to/your/imag.jpg YourUser@Webserver:/path/to/destination/

Make sure that YourUser has permissions to write in your destination directory.
If you want to upload a directory don't forget to pass the -r option.
More information about using scp can be found here:

scp manpage
How to Use SCP Command to Transfer Files/Folders in Linux
Answer: That one is really easy.
You should read some tutorials about UNIX.
Use the wget command to upload or download stuff with web servers.
The basic syntax of this command is
wget http://website.com/files/file.zip

This would download the file into your working directory (meaning you'd have to do this from webserver to raspberry)
Here is a basic tutorial for wget:
Using WGET
Another strong program is curl
It would look like
curl -O -C - file:///path/to/some/file

curl man page
This is really a trivial feature of every linux system nowadays, and I guess with the 2 links I posted you should be able to fiddle something together. (If not try watching a youtube video to these programs)
I hope you can manage it
saraba
Comment: *"since a webserver normally is just another linux server"* -> That depends upon the context of use.  In this context, I would say it is most likely **a piece of software** such apache or nginx.  But it is a very vague question.
Comment: @clockw0rk, "wget" is not easy for newbies.  I remember a couple of years ago, the first time I learned to use "wget", it took me 3 hours to complete the job of wget, and untar something.  Of course I can now do it in minutes.  But at that time I was very discouraged and I did give up and stopped playing Rpi for one or two years, until Rpi2 came along, with GUI Desktop, though still slow. At that time I only Windows 7, and I knew how to google, but did not know how to search linux tools, and I did not know stack overflow or rpi stack exchange, ... :(
Comment: aren't these solutions to DOWNload from a webserver instead of UPload?
Comment: @ON5MFJurgen I'm sure I used this for both ways already. Also, since a webserver normally is just another linux server, there should be no big deal on which device pulls from the other. (unless you have webhosting - where you only have a folder for you page) ; also I just wanted to provide OP with a basic idea on which programs there are, since he didn't show any efforts to code / learn something on his own
Comment: @tlfong01 Yes, I remember struggeling with it too, until the point I needed it at work and was forced to use it. Today I still would recommend everybody to go through the struggle and just try it until you get it, cause it is really mighty. "It seems difficult at first, but everything's difficult at first" [M. Miamoto, around 1600]


How to tar all newly generated files in a directory every two hour and moving that tared files to another directory

Question: files will generate every 5th minute in /kit directory.Want to tar all the files and move that files to /kit/bkp directory every 2 hr
Comment: You dialed the wrong number; this is not the scripting service. But we are glad to help if you edit the question to show your attempt for that script. We can point out what went wrong and suggest what to change. Thank you.
Answer: find your_path -t f -mmin 5 -exec tar -zcvf your_compress_file.tar.gz {} +

You can make an script and put your script into crontab.
Answer: Write a script and set it to run with cron jobs or systemd timers. Include the appropriate tar command in the script and use the exclude flag for tar to avoid taring the /tar/bkp folder. And use find with the -mmin 120 flag to limit the files tarred to files modified in the last 120 minutes.
For example:
#!/bin/bash
source='/kit'
dest='/kit/bkp'
find "${source}" -mmin 120 -exec \
  tar cpf "${dest}/$(date +'%Y%m%d%H').tar" --exclude="${dest}" {} +

This script will be executed with /bin/bash, defines a source and destination path, selects only files that have been modified in the last 120 minutes, and then creates a tar file named for the year-month-day-hour in the destination folder, preserving permissions and ownership, and excluding the destination folder.
Then type crontab -e as a user with read and execute access to /kit... write, read, and execute access to /kit/bkp... and read and execute permission to the script we made before. In the cron file add a line like this:
0 */2 * * * /path/to/your/script.sh > /dev/null

This will run the script every 2 hours on the hour and pipe stdout to /dev/null to keep the script silent unless it produces an error. Cron should message you if an error occurs.
Comment: every 5 minutes a file with .log extension is generating, have to tar only all those files with that extension to backup directory.
Comment: Ah, I see, then Using the find command with the option `-mmin 120` to limit the files tar runs on to files modified in the last 120 minutes is your best bet. Everything is the same, except the line with tar in the script needs to be modified to include the find command.
Comment: Now i faced a problem that the source directory contains many files in which the files with name such as starting with 'log' and ending with .log should only tared.
Comment: what to do for that
Comment: You could start by searching google for the `find` command. Or type `man find` in the linux console. Look, I've already done 95% of the work for you. Stack Exchange isn't really meant to solicit other people to write code for you. That's why your question is getting down-voted. It's meant as a way to exchange knowledge. I've told you want needs to be done. I've given you everything you need to know what to do next. It's up to you now.


Is is possible to view some sort of history of users who have saved a networked Excel Spread sheet that is based on a server?

Question: I have an excel spread sheet that is saved on a server, in terms of access to it there are only around 20 people with permissions to the folder,  whoever is there anyway to view a history of the modifications beyond the previous Modifier
Comment: You'll need to tell us a lot more about your setup. What kind of server? How is the spreadsheet downloaded and uploaded? How do editors authenticate to the server? **With all this information**, you should ask on [su], as your question is about achieving a functional requirement rather than a security objective.
Comment: @Gilles there *might* be an element of audit log here, but I agree this is some of the missing information (and, likely that even if that is what he is looking for, it is not a good solution - but that would still be ontopic....)
Answer: Most "servers" permit file level auditing, however this is specific to each server, and specific to each file system.  These audit logs may contain the information you're looking for, but if logging hasn't been enabled, then there isn't much you can gain in retrospect.
The reason I put "servers" in quotes is because there is a different amount of features available for NTFS clients connecting to a NAS vs a Windows based server.  Namely the Linux based variants may contain a different amount of audit granularity than the Windows based file servers.
Answer: You could add some VBA to the file, and set it to run on save. This writes to a worksheet called "log". Add this to the ThisWorkbook module. You would need to make sure the spreadsheet is saved as a .xlsm and that users have macros enabled.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Dim CurrentUser As String
Dim CurrentDttm As Date

CurrentUser = Application.UserName
CurrentDttm = Format(Now, "yyyy/mm/dd hh:mm")

LastRowWithData = Sheets("log").Range("A1").End(xlDown).Row

If LastRowWithData > 65000 Then
    LastRowWithData = 1
End If

Sheets("log").Range("A" & LastRowWithData + 1).Value = CurrentDttm
Sheets("log").Range("B" & LastRowWithData + 1).Value = CurrentUser

End Sub


What is the use of spring.net?

Question: We are developing an application using Silverlight and WCF Services. Is using Spring.Net is beneficial for us?
Comment: What is the use of Quartz with Spring.net?
Comment: In my experience, I've never seen dependency injection used properly.  There were always just a few places where it made sense to use and it ends up getting used in all classes, creating a convoluted, configuration mountain of a mess!  Please don't use something just because it is the latest buzz word in the tech community.  Remember, when you introduce a new pattern into your project, then someone needs to manage that pattern and make sure the code stays clean.  So the less extras you add the better.  ONLY add what is needed!  PLEASE!!!!!
Answer: >> "Is using Spring.Net is beneficial for us?"
I think the spirit of your question is really geared more towards questioning the benefit of using an IoC/DI framework versus manually managing dependencies as needed. My response will focus more on the why and why not of IoC/DI and not so much on which specific framework to use.
As Martin Fowler mentioned at a recent conference, DI allows you to separate configuration from usage. For me, thinking about DI in the light of configuration and usage as separate concerns is a great way to start asking the right questions. Is there a need for your application to have multiple configurations for your dependencies? Does your app need the ability to modify behavior by configuration? Keep in mind, this means that dependencies are resolved at runtime and typically require an XML configuration file which is nice because changes can be made without requiring a recompile of the assembly. Personally, I'm not a fan of XML-based configuration of dependencies as they end up being consumed as "magic strings". So there's the danger of introducing runtime errors if you end up misspelling a class name, etc. But if you need the ability to configure on-the-fly, this is probably the best solution today.
On the other hand, there are DI frameworks like Ninject and StructureMap that allow fluent in-code dependency definitions. You lose the ability to change definitions on-the-fly, but you get the added benefit of compile time validations, which I prefer. If all you want from a DI framework is to resolve dependencies then you could eliminate XML-based frameworks from the equation.
From a Silverlight perspective, DI can be used in various ways. The most obvious is to define the relationship of Views to ViewModels. Going deeper, however, you can define validation, and RIA context dependencies, etc. Having all of the dependencies defined in a configuration class keeps the code free from needing to know how to get/create instances and instead focus on usage. Don't forget that the container can manage the lifetime of each object instance based on your config. So if you need to share an instance of a type (e.g. Singleton, ManagedThread, etc.), this is supported by declaring the lifetime scope of each type registered with the container.
I just realized at this point I'm ranting and I apologize. Hope this helps!
Comment: if we are going to do it run time... then what's the point? i mean we can just do that without even having a framework, and without injecting them, just simply pass the parameter to objects...??? and also there are lot of things spring claim that is capable of... what about them?
Answer: Personally i'd recommend using either Castle or Unity as i've had great success with both and found them both, while different, excellent IOC frameworks.
Besides the IOC component they also provide other nifty tools (AOP in Castle, Interface interception in Unity, for example) which you will no doubt find a use for in the future, and having an IOC framework in place from the start is ALWAYS a hell of a lot easier than trying to retrofit it.
It's incredibly easy to setup and configure, although personally i'm not a huge fan of the XML config way of doing things as some of those config files can turn into a total nightmare. A lot of people will tell you that it's only worth doing if you intend to swap components in and out, but why not just do that anyway IN CASE you decide you need to do that later. it's better to have it and not use it, than not have it and need it. If you're worried about perf hit i've seen on many blog posts around the web people comparing the various IOC frameworks for their speed and unless you're creating brain surgery robots or the US Missile defence platform it won't be an issue.
Answer: A DI Framework might be of use if you want to change big chunks of your application without having to rewrite your constructors. For example, you might want to use a comet streaming service that you will expose through an interface, and later decide that you'd rather use a dedicated messenging system such as MQ or RendezVous. You will then write an adapter to Mq that respects the common facade and just change the spring config to use the Mq implementation rather than the Comet one.
But for the love of tony the pony, don't use Spring.Net to create your MVVM/MVP/MVC bindings for each and every view or you'll enter a world of pain.
DI is a great tool when used with parcimony, please don't end-up with 243 spring configuration files, for your devs' sanity.
Answer: Using an IOC container such as Spring.Net is beneficial as it will enable you to unit test parts of your UI by swapping in mocked or special test implementations of the applications interfaces.  In the long run, this should make your application more maintainable for future developers.
Comment: Use the MOQ library for unit tests.  Introducing a framework and using it everywhere  just for unit tests is not a good idea.
Answer: I think if you do more in the code rather than using the markup to do bindings etc. and have a BAL/DAL DI can help there because it can inject the correct business component reference (as one example).  DI has many other practical advantages, but then you have to do more in code and less in markup.

What is the use of spring.net?


Show all Flows Attached/Triggered by a SharePoint Online List

Question: We're looking for a way to identify any Flows that are connected to specific SharePoint Online lists. We do have access to Flow Admin Center, but there doesn't seem to be a way to filter the Flows to ones connected with a specific list.
Comment: I used the same code, but always it return empty response {"value":[]}, but i have multiple flows for that SharePoint list var _credencials = new SharePointOnlineCredentials("email@example.com", passsecureobject); using (ClientContext clientContext = new ClientContext("https://tenant.sharepoint.com/sites/site1/")) { clientContext.Credentials = _credencials; List list = clientContext.Web.GetList("https://tanant.sharepoint.com/sites/site1/Lists/Countries"); clientContext.Load(list); clientContext.ExecuteQuery(); var flows = list.SyncFlowInstances(); //var flows = list.SyncFlowInstance
Answer: There is a way to access details about flows attached to the list using the CSOM. Here is a sample code that can be used for that:
//You need to connect to the site using CSOM, and then you can use this code to get the flows details
//...
List list = context.Web.GetList("Lists/YourList");
var flows = list.SyncFlowInstances();
context.Load(flows);
context.ExecuteQuery();

flows.SynchronizationData contains the JSON string with all the details about flows.
You can either get the details about flows manualy from the flows.SynchronizationData string or by deserializing it and looping through all the flows.
One way to access it would be by using System.Web.Helpers assembly, like this:
using System.Web.Helpers;

//...

List list = context.Web.GetList("Lists/YourList");
var flows = list.SyncFlowInstances();
context.Load(flows);
context.ExecuteQuery();

dynamic data = Json.Decode(flows.SynchronizationData);
for(var i = 0; i < data.value.Length; i++)
{
    Console.WriteLine(data.value[i].properties.displayName);
}

Comment: This was an excellent approach, thanks. System.Web.Helpers was not available in .NET 4.7, but adding microsoft-web-helpers from Nuget resolved that.
Comment: I tries the above code but all I am able to get from SynchronizationData is '{"value":[]}'. I am on .Net framework 4.5.2 have SCA access on the site and owner of the flow
Answer: Very interesting question -  to achieve this you can write a MS Flow with the action "List Flows as Admin" this will return you all Flow from your environment, then at the end of this we can export the results to csv or we can add the result to SharePoint custom list, from their we can filter by list name.... and also you may seek for similar kind of "List Flows as Admin" action which will get the flow by list.... though I have not checked this :-)  may be something ready-made could be available.
Reference URL :
https://powerusers.microsoft.com/t5/Building-Flows/How-to-get-a-list-of-all-flows-in-environment/td-p/292002


Is it safe to mount 2.5" SSD in Mac Pro w/o bracket?

Question: I have a 2.5" SSD (Crucial CT480M500SSD1) that I want to use as my boot drive on my mid-2010 8-core Mac Pro. It doesn't fit the hard drive mounting brackets, which are designed for 3.5" drives. Because the SSD (a) is very light and (b) has no moving parts (and therefore no gyroscopic effects and no vibration), I'm considering mounting it without using a bracket at all—just plugging in straight into the socket, and letting the socket hold it in place. Is this reasonably safe?
Comment: Way to late to be an answer, but I'd have put it in the spare DVD bay & wired it to the spare SATA sockets on the mobo behind the fan assembly. That way it wouldn't strain anything.
Answer: If you plan on "plugging in straight into the socket" that would be a very bad idea. The SSD is light, but all of that weight will now be supported entirely by the two SATA sockets on the computer and drive. Over time the small amount of weight on the SSD will brake the bracket on the Mac Pro (expensive), or worse the drive (data loss).
If you can find the correct cable you could run a cable from the socket to the hard drive, and double stick tape the drive like the above answer said.
Or just buy a 3.5 to 2.5 adapter and install it in the drive carrier. It is cheaper than repair.
Comment: I bought this adapter and it works great: http://eshop.macsales.com/item/OWC/MMP35T25/
Answer: In my opinion it is reasonably safe. I would do it under your circumstances. However, my caveat to this is if you move your computer at all do something to secure the drive.
One more thing to consider: using some double-sided tape to stick the drive to the mounting area. I did this in my iMac when I added an SSD for a home-built Fusion drive.


How could my animal claws work realistically?

Question: My animals can use its claws to crush hull of modern ships. It evolved on an earth like planet. It uses a chemosynthetic metabolism. My question is that what is the chemical composition of the claws that allows it to crush ship hulls ? What could it realistically be made of?
Comment: Hydraulic presses crush all sorts of things, including those made of similar metals and materials. The important part is the mechanism that allows those to impart pressure/force on thing to be crushed, and the size (so that there's enough surface area in contact). The design here is at least as important as the composition, if not more so.
Answer: Carbon nanotubes grown biologically.
It is actually happening on Earth, as well.

In this study we provide evidence that the cellulose microfibril
arrangement occuring naturally within plant walls1 aids in the
formation of CNTs when plant fiber is carbonized in a cyclic oxidation
process

and they are positing that the biological process can be used to mass-produce carbon nanotubes for manufacturing.

The use of plant materials in the production of CNTs has the potential
to significantly reduce production costs, and it also suggests unique
applications for plant fiber incorporation into thermally produced
products.

See also

The binding free energy of ssDNA to carbon nanotubes rivals that of
two nanotubes for each other. We also demonstrate that DNA-coated
carbon nanotubes can be separated into fractions with different
electronic structures by ion-exchange chromatography. This finding
links one of the central molecules in biology to a technologically
very important nanomaterial, and opens the door to
carbon-nanotube-based applications in biotechnology.

Diamonds, an extremely hard material, are an example of carbon nanotube construction.


making joomla search page search engine friendly

Question: I want to add some seo features to a joomla search component, such as meta and integrated title page. What should i hack in the file ?
Thanks
joomla verion 1.0.15
Answer: I'd suggest hacking directly at the Joomla! search module. this should modules/mod_search.php file and go from there to add your functionality. I'm not too familiar with the topics of SEO optimization.
Comment: SEO doesn't need "optimization" after it. [/pedantry]


StoreGeneratedPattern in Entity framework

Question: If the storage model has the  StoreGeneratedPattern=identity attribute set, why should not the conceptual model reflect this in some way? Either in and attribute or in a readonly nature of a property? If i need to pass a value to the reference field.
Answer: We have released a hotfix for the StoreGeneratedPattern issue. Try it out!
MSConnect: http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=37957
Code Gallery: http://archive.msdn.microsoft.com/KB2561001
Answer: It should.  And it does when it is working correctly.  What you are probably seeing is a result of a bug in the designer.
When you set that property in the designer in VS2010 RTM,  it only adds an annotation tag in the CSDL and does not add anything in the SSDL, so it doesn't treat it as read-only.  Amazingly the same or very similar bug existed in EF 1.0!
If you edit the SSDL section by hand, it will work as advertised in the documentation.  You just have to re-do, or merge your changes when you regenerate your model.
Comment: If you want to avoid the xml-editing portion (and having to track down where the SSDL and CSDL differs), I have an add-in that adds a 'Model Comparer' for EFv4 models to VS2010. It shows differences such as store-gen, data type, nullability, maxlength/precision/scale, missing members, missing entities etc between the three layers (db, SSDL, CSDL), generates reports, and allow easy re-sync of individual differences or all differences.

More info, and screencast-demos over at: http://huagati.blogspot.com/2010/08/using-model-comparer-to-generate.html
Comment: we are starting a new MVC 4 project using VS2012, EF 5 and ODP.NET for Oracle 11
and we are experiencing exactly the same problem.

Everytime we "generate database from model", the ssdl part on edmx file loses the "storedGeneratedPatter=Identity" attribute.

Are you planning an hotfix for VS2012 and EF 5 supporting Oracle too?


Compared to powder, is liquid detergent really better for the health of the washing machine?

Question: I am asking about front loaders. I have heard that powder builds up and it is worse than liquid, although I hear mixed arguments nowdays so I wondered if using liquid detergent is actually better for the washing machine, not the clothes.
Comment: It's water-soluble and the dispaensers usually flush themselves with water, so i wouldn't expect a lot of buildup, and if it did, the buildup would be easy to rinse out. It takes a lot of money to truck water around with liquid detergents, some of that must be passed to the consumer.
Comment: I am talking about a front loader, sorry for not mentioning that.
Answer: Modern machines use so little water that the recommended quantities of powder can lead to a little bit building up below the dispenser drawer because the water has all run before it can dissolve (it also depends where in the drawer you put the powder, with respect to the water jets).  The same machines are usually cold-fill only which further slows the disssolving. Sometimes the rinse water brings the rest of the detergent with it, meaning you don't get a very good rinse. The damp powder can form a caked-on buildup which is harder to shift than the original powder.
Using a little less than stated on the powder box will avoid these effects and save you money on powder, as will liquid (even if you add that via the drawer rather than a dosing ball).  For all but the dirtiest clothes you can use a fair bit less powder than claimed by the people who are trying to sell you detergent.
My machine's quick-wash program wants liquid as there's insufficient time/water for powder to dissolve properly.  I put this in a ball in the drum, which means that the dispenser gets flushed when I use the quick-wash program.  This helps too. This is all in the UK where (almost) all domestic machines are front-loading.
Answer: There are two types of powdered laundry detergent, regular and HE (High Efficiency).  If you have a front load high efficiency washer then you should buy laundry detergent labeled HE.  The HE detergent is more concentrated which means you need much less than the non HE detergent. Build up shouldn't be a problem with HE detergent.


VSTO 3.0 outlook addin does not load

Question: I have written a VSTO 3.0 add in for outlook. It is on the usual lines of ThisAddIn. The addin is targeted at office 2007 or above. We discovered recently that it does not work on certain workstations. Here is a summary of where it fails to load.
The addin loads and works fine on:
1) All 32-bit workstations (both windows server 2003 and windows 7) with Office 2007
2) All 32-bit workstations (both windows server 2003 and windows 7) with Office 2010
The addin does not even load on certain 64-bit workstations. We have compared the workstations where it works and where it doesn't. They are exactly the same, including the set of software installed. In fact, we spent a lot of time ensuring that both are the same in all respects.
They are both 64-bit workstations running Windows server 2003, Office 2007 (32-bit). I have figured so far that Office 2007 does not have a 64-bit version. The exact error that i receive in the event log is:
Please note that i have removed the URL (VSTO URL) from this post.

Customization URI: "VSTO URL" Exception: Customization could not be
  loaded because the application domain could not be created.
  ****** Exception Text ****** Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException:
  Customization could not be loaded because the application domain could
  not be created. ---> System.IO.FileLoadException: Loading this
  assembly would produce a different grant set from other instances.
  (Exception from HRESULT: 0x80131401)    at
  System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
  publicOnly, Boolean noCheck, Boolean& canBeCached,
  RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)    at
  System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
  fillCache)    at System.RuntimeType.CreateInstanceImpl(Boolean
  publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)    at
  System.Activator.CreateInstance(Type type, Boolean nonPublic)    at
  System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
  binder, Object[] args, CultureInfo culture, Object[]
  activationAttributes)    at System.Activator.CreateInstance(Type type,
  BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo
  culture, Object[] activationAttributes)    at
  System.Activator.CreateInstance(String assemblyName, String typeName,
  Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
  args, CultureInfo culture, Object[] activationAttributes, Evidence
  securityInfo, StackCrawlMark& stackMark)    at
  System.Activator.CreateInstance(String assemblyName, String typeName)
  at System.AppDomain.CreateInstance(String assemblyName, String
  typeName)    at System.AppDomain.CreateInstanceAndUnwrap(String
  assemblyName, String typeName)    at
  System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String
  typeName)    at
  Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.LoadMafPipeline(AppDomain
  newDomain, IntPtr hostServiceProvider, AddInInformation info,
  EntryPoints requestedEntryPoints, OfficeApp officeApplication,
  OfficeVersion officeVersion, IntPtr& executor)    at
  Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String
  solutionLocation, String manifestName, String documentName, Boolean
  showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)
  --- End of inner exception stack trace ---
***** Loaded Assemblies ******* mscorlib
      Assembly Version: 18.104.22.168
      Win32 Version: 2.0.50727.5737 (QFE.050727-5700)
      CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
  ---------------------------------------- Microsoft.VisualStudio.Tools.Office.Runtime.v10.0
      Assembly Version: 10.0.0.0
      Win32 Version: 10.0.21022.1
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Office.Runtime.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Office.Runtime.v10.0.dll

I have figured out that my  addin is failing to load if another addin built on similar lines gets loaded first. This addin, say, Adddin1 if loads renders my addin inactive. Addin1 is built similar to my addin- same target environment. If i disable Addin1 my addin loads fine. I do not have the liberty to change anything on Addin1 due to various reasons. What changes can i make on my addin to load independently of any other addin?
Can i choose the order in which addins are loaded?
Is there any dependency on vstoee.dll?
Any suggestions would help. Thank you.
Comment: Please note that I have reviewed suggested articles and just more than re-installing 3.5 i have got a new workstation itself.
Answer: Procured a new workstation with all new software installation rather than applying an image. This resolved the issue.

VSTO 3.0 outlook addin does not load


What's the difference between Have you ever tried canoeing? Did you ever try canoeing?

Question: Is ever appropriate to use in past simple questions?  Is there a difference in present perfect questions using ever meaning a time period up to now and the past simple use of ever in a question?  If there is a difference in meaning what is it please?
Comment: Yes, _ever_ is appropriate in either past or present tense, with or without the perfect, provided (1) it occurs in a negative environment (_ever_ is a [Negative Polarity Item](http://www.umich.edu/~jlawler/NPIs.pdf)), and (2) the clause refers to some continuous period of time. Both of these conditions are met in your questions: (1) questions are negative environments, and (2) the clause refers to the period of the addressee's lifetime. So _ever_ is equivalent to _at any time_, and that can also be used in either tense, with or without perfect.
Answer: They are very similar in meaning because of the use of ever which is muddying the issue. Without ever the did form tends to refer to a specific time context. For example: "I went to Paris for a holiday." "Did you visit the Eiffel Tower?" It's quite clear that we are referring to the period of the holiday. However the question "Have you visited the Eiffel Tower?" does not reference any time. When the did form is modified by ever they become virtually synonymous.
Answer: They are different. Use the past if you refer to something specific. For example "You said you wanted to go check out that restaurant last week. Did you ever go?" (Finally) or "Did I ever tell you what I did last Friday night?" (Eventually). Use the present perfect if you refer to something general or/and uncertain. For example, "Have you ever visited Paris?" (In your life) or "Have I ever told you how much I love her?" (In all these years). Hope this helps.
Answer: Present perfect tense in this context is used to ask about an experience in people's entire lifetime.For instance, Have you ever played football?( in your life)
But the past simple version of the question which by the way includes an "ever" inside, usually refers to a question about a specific period of time in the past, for example: Did you ever miss me when I was gone?( from the second I left till I was back)
or
   When you were in war, did you ever kill anybody?


Why does a background color in Word not print?

Question: When you go to set a background color doing the the 'correct' way through 'design, page background, page color' (Word 2013), the background color never prints and you're forced to insert a shape and put that behind text.  Why is this background page color not supported by printing and is there a way to allow the background page color to be printed?
Answer: There is an option to print background colors and images. By default, this option is set to false.
From Word 2007, you can find this settings under "Word options" window, "Display" tab, "Printing options" section and the option is called "Print background colors and images".
Source: Office support article.
Answer: Try File > Options > Display, and tick "Print background colors and images".
Answer: The reason a background color is not printed, is because Word assumes you want to be saving ink and thus won't print the background color. The reason you can set one is because on the screen where there's no saving done by not showing the color, it can look nicer.
If my memory serves me correctly, there's an option somewhere to print the background color too. I believe in the page setup section, but it has been many years when I faced this problem, and I forgot how I solved it.
Answer: Using Word 2011, I went to the menu bar and selected Word/Preferences/Print, and checked the box for "Print background colors and images". That preserved the background color when I 'File/Save As' as a pdf.


Protection against Keyloggers?

Question: I was wondering, If I got infected with a Keylogger and I start my On-Screen Keyboard(from OS) and type things, will the symbols will be recorded (considering no Screenshots Keyloggers)? Since Keyloggers act on keystrokes I think this may work against Keylogger, correct me If I'm wrong.
Answer: If you are infected with a keylogger, it is a software keylogger and a software keylogger does not monitor the keyboard, it monitors the events that the OS fires off when a key is pressed.  These events are fired regardless of what type of input you use.  If a letter is generated as input, then it had to go to the OS and request the key be processed and the software keylogger will have seen it.
A hardware key logger is a physical device that is installed in-between the keyboard and computer and doesn't have to infect the computer since it is capturing the signals from the keyboard itself, but these are very rare since they have to be applied physically to the computer.
Comment: Oh yea, so any kind of input that request 'key' on OS will be recorded by the software keylogger..... thanks!
Answer: You are incorrect.
According to this wikipedia page Keystroke_logging#On-screen_keyboards your keystrokes would be captured. This of course assumes its a software logger and not a hardware logger that sits between your keyboard and computer.  Hardware loggers may not be listening for keyboard events so you MAY be safe.
Comment: I will search if Hardware keyloggers save my strokes on the virtual keyboard... thanks for answer
Comment: An hardware keylogger can't capture the on-screen keyboard inputs, only the external keyboard itself.

But software keyloggers will indeed capture them, (at least a decent one...) you'd have no way of safe-typing, better install an AV? or firewall.
Comment: @SomeNickName of course I would install a AV and/or firewall, but im just being hypothetical to know if keylogger can do what I've said. Ty for suggestion
Comment: @Stephenloky and with a firewall (a decente one) you'd be 100% safe from 99% keyloggers.
Comment: @SomeNickName good to know ... thanks for the advices

Protection against Keyloggers?


COnverting web app to ipad app(device detection/event handling)

Question: I need to convert a web app into ipad app. Stressing on style and events.

How to detect device?
How to identify touchevnts?
How to map click to touch,doubleclick to doubletap
How to capture orientation change?
Answer: This is really a broad question. But here are answers to some of your questions to quick start.
How to detect device?
use UIDevice to detect iPhone (UIUserInterfaceIdiomPhone)
How to capture orientation change?
UIInterfaceOrientation
You have to see,for rest of ur questions, InterfaceBuilder Outlets & Action and delegate & datasource. You better google these keywords, you'll find required docs.
Comment: Elaborating my question..web app written in html5/css/javascript works fine in browser but on ipad  issues on these areas.1.On ipad default action for doubletap is zoom.How can i prevent this and override? 2.If i want to set the frame of a control separately for ipad,i need to detect the device first.How to detect the client?3.on ipad how can i detect orientation change using javascript code?
Answer: It really depends on the framework and techniques you used for the original web-app. There are plenty of frameworks out there to build an iOS-web-app. For example jQuery mobile, you also might want to have a look into phonegap.
For the first few steps I can really recommendend reading this free aviable book from o'reilly about creating iPhone-Apps with HTML, CSS and javascript.


What happens internally when a program is compiled? and when We hit RunTest Button?

Question: Can some one please explain what exactly happens when I click on RunTest button? How the code is internally compiled and run? For example In java when we have JVM, JRE. and When we compile, a .class file is generated. Similarly in Salesforce what is happening internally?
Answer: When you call the RunTest command, the system first checks the local code cache for valid byte code. If it fails to find it there, it then checks the pod-wide shared code cache; if the code is there, it's loaded locally and stored in the local cache.
If that fails, it then retrieves your source code from the database, compiles it to byte code, and places a copy in the pod-wide shared cache and local cache. Once the byte code is available, it then runs the code.
The Apex Code execution system is a type of VM like Java, with hooks into various Java libraries-- a process called marshaling-- to help improve the performance of the code when possible. It's also responsible for things like checking governor limits, allocating memory, presenting queries to the database, and so on.
You can watch Peek Under the Hood of the New Apex Compiler for a more in-depth explanation if you'd like. Note that there's only so much salesforce.com can share with you, because they need to protect their Intellectual Property. That said, it works in a manner comparable to Java.
Comment: Thank you very much. I watched the video link that u suggested. It was said in the video that the Apex class is complied into java byte code and then interpreted using their own interpreter. Are they using JMV to compile it into java byte code? Then what is Apex compiler? What is its role?
Comment: I didn't even  understand why he said they are using their own interpreter why is it unsafe to use JRE
Comment: @user52800 the Apex compiler converts Apex source to an unspecified byte code format, which is then run by the Apex interpreter. I don't know why they do it that way, but that's how it's done. Only an internal employee could possibly provide a real reason, but I'm pretty sure it's security related.


How to upload folder of images using pinata - ipfs?

Question: How to upload a folder of images, by giving only path using npm's pinata sdk ? I only want to give folder's path. using javascript.
Answer: Ok, After a lot of R&D,found out that you cannot, upload folder of images using the pinata sdk(npm pack.). But you can use Moralis and IPFS public gateway.
Answer: You can use:
const IMAGES_LOCATION = "path/to/folder";
const imageFolderUploadResponse = await pinata.pinFromFS(IMAGES_LOCATION);

Answer: It's pretty simple using node.js (Javascript)

First resolve the dir path
Read by fs module in node.js
Put the stuff in loop as per below code and then it will automatically pin your files to the Pinat

async function storeImages(imagesDirPath) {
  const fullImagesPath = path.resolve(imagesDirPath);
  const files = fs.readdirSync(fullImagesPath);
  let responses = [];
  console.log("Uploading to Pinata !!!");
  console.log("paths ", fs.createReadStream(fullImagesPath + "/" + files[0]));
  for (fileIndex in files) {
    const readableStreamForFile = fs.createReadStream(
      `${fullImagesPath}/${files[fileIndex]}`
    );
    try {
      const response = await pinata.pinFileToIPFS(readableStreamForFile);
      responses.push(response);
    } catch (error) {
      console.log(error);
    }
  }
  return { responses, files };
}


Editing a question when it's most likely to be closed

Question: Recently, I came across this question. The grammar was in need of desperate help and so I suggested an edit. This question definitely does not belong on SE and is more appropriate for SO (even though I don't see it getting many answers there either). So, should I still be suggesting edits when I know that it will most likely be closed?
Comment: @hims056: I get that, he has 20k+ rep over there, so he can watch and edit deleted answers. But does he really edit them? It's just a waste of time IMHO... :)
Comment: I edit deleted answers / closed questions all the time cause I can't stand it when people forget to format their code blocks.
Comment: @jamylak: You edit deleted answers... Really?
Comment: @Aditya - In Stack Overflow.
Comment: @Aditya Oh right I thought this question was aboout editing a question in general
Comment: @Aditya It's usually just a CTRL-K
Comment: @jamylak: Right.. But.... :)
Answer: There's no point editing an off-topic question on Meta. It will be closed and deleted very quickly (as has happened).
If a question is likely to be closed but you believe you can improve it, and possibly save it from being closed or help to re-open if it does get closed, then you should definitely edit.
Comment: Can't stress the last sentence enough; this is what your decision to edit should be based on. Ask yourself what impact your edit would make, if it's merely grammar on a completely off-topic question then don't waste your time.
Comment: P.S. That question is not appropriate for Stack Overflow. It just asks someone to provide code and barely explains what they're trying to achieve.
Comment: Thanks, that explains it very well.
Comment: P.S. I only mentioned SO, because the question talks about pagination. I know that it is not appropriate to ask for code :)


How much work experience is equivalent to a Computer Science degree?

Question: A lot of software developer jobs list "a CS degree or equivalent work experience" as a requirement. I have a degree in a somewhat related field but only about 6 months of on-the-job experience as an intern and then a severely underpaid developer. How much work experience will it take for employers to consider me as on par with a CS graduate, and take me seriously as a candidate for a junior level position?
Comment: If you base it off of their applicable knowledge straight out of college... 30 days.
Comment: I'd say at least 7 standard time units.
Comment: Well, as I stated, I managed to get an internship, which has led to what I guess you might call a junior position. But I'm still being severely underpaid because they know I'll have trouble finding a job elsewhere with as little experience as I have. So what it boils down to is how long will I have to accept this kind of pay before I'll have a decent shot at a position elsewhere.
Comment: @ramoneramone - I've been working for 14 years now and still make less than my degree-weilding peers. As for how much experience to let you move, it depends on your job market.
Comment: They want you to be able to work on your own.
Answer: It depends.
Some people may have 20 years experience as software developers but in practice are juniors (no idea about separation of concerns, design patterns, SOLID and DRY).
Some people come out with CS degree and need to learn software engineering from scratch (never worked in a team, wouldn't know maintainable code if it hit them in the face, source control is a new concept etc, etc, etc...).
My point with the above two paragraphs is that the comparison is meaningless. Experience does not translate to a CS degree and vice versa.
What matters is provable capability - some of that comes from experience, but not all.
If you can show your developer chops (open source projects or your own private projects) and impress them, they will consider you.
Comment: This makes sense for a programmer, but I strongly suspect HR writes that thinking "4 years is 4 years" thus 4 years of work = 4 years of school. You have to get past HR to "show your chops."
Comment: @Ramhound - I don't think Rarity contests that. The point being made is that HR don't usually think this way.
Comment: +1. Amazing how different developing on a large project is compared to individual projects which don't have to be maintained beyond a small amount of time.
Comment: If only everyone hired this way. I'm with @Rarity.
Comment: @Rarity - I can tell you that 4 years of actual work experience is worth more then a 4 year degree and this comming form somebody who actually has one.  I have learned more in 2 years then my entire college sprint.
Comment: @Oded, I show my developer chops all over the place, in tutorials, in blogs, etcetera, have created two ruby gems, two non-paid collaborative projects. It seems like if it didn't make the NASDAQ, its like who cares, which is kind of counterintuitive because the idea is that you want someone like me, but its like
you don't believe "your lying eyes". Its a grind, but thank you for this answer and it sounds like I should just ignore the "BS in CS or equivalent" and apply anyway.
Answer: I usually see the line CS degree or equivalent. Or the line: "Bachelors degree plus 10 years experience, or masters with 5 years experience, or PHD +1 year experience."
When it is written this way it means that if there is an automated process to screen applicants or resumes the lack of degree will stop the resume from being moved forward. I have even seen a resume rejected because they wanted a BS, and the person had a BA.
The requirements "CS degree or equivalent" means that they will take a large assortment of technical degrees. They can even take a degree if is not technical but related to the subject matter. The less automated the screen the better the chances of them taking a degree in marketing.
In a few cases I have seen them write the line: "X years experience developing software, a Bachelors degree can substitute for A years, or an advanced degree can substitute for B years."
In this case they can be very flexible.
Remember that they might also trying to meet the requirements of a customer. If they are a government contractor, the customer frequently establishes for the contract the specific rate levels. If the applicant can't meet the requirements for the lowest rate category they can't be hired for the position. The category and rate level they fit into determines the maximum salary for that contracted position.
Comment: So ignoring a ba would rule out the elite unis that dont give out BSC's
Comment: @Neuro - What school doesn't offer a Bachlor degree?
Comment: @Ramhound Cambridge doesn't you get a BA in Engineering
Comment: Thank you for this answer. Those cryptic bullet points of BS or equivalent are very confusing and just one more silly game to screen candidates as opposed to looking at what they can do, not just on paid basis, but they have done unpaid, for me it shows passion and enthusiasm and an auto-didactic person. Such a grind this whole process, it really brings me down as a non-BS engineer.
Answer: If they don't state the amount of experience, you should apply anyway. You've done an internship and have a full-time job as a programmer.
The low salary at this point in your career would be considered as a valid reason to leave that job.
Make sure you have strong recommendations from your internship. While you are looking at other jobs and hopefully landing interviews, keep track of the skills they want. You maybe able to do some new project at work where they can implemented.
I can't imagine a years worth of experience, wouldn't get you past the lack of degree for a junior position. There may be some companies that just prefer college graduates, so there's no getting around this bias in their mind.
Answer: If the posting states "relevant work experience considered in lieu of a degree", apply for the job. Basically what they're asking for is proof you can do the job, and you can answer that two ways; by showing them you've been taught to do the job, or by showing them you've already done it. If you have a few years' experience at a job level roughly equivalent to what they're hiring for, you should be considered (perhaps even more so in this environment since without a degree you'll probably be asking for less). That gets you the interview, where you show them you can do the job.


jQuery: Cycle plugin and 100% height

Question: I'm rotating images to appear in the background using the jQuery Cycle plugin. However, I can't get the height to span 100%. I can get the width to span 100%, but I have to set the height in pixels. I attempted to set it equal to the height of the body with jQuery, but unless I specifically give it height in pixels with css, it will revert to a height of 0.
I have it set up so the following div container has a negative z-index and is located at the top of the page:

Page Content goes here...

The height of the page is 1430px, but it's built on a CMS and can change. Is there some way to get my container to span 100% of the height other than #bg-images { height:100% } or $("#bg-images").height() = $("body").height();?
Answer: As always:
html {
    height: 100%;
}
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

jQuery: Cycle plugin and 100% height


ExactTarget REST API - using javascript to get accessToken

Question: With the clientId and clientSecret, is there a way to use JavaScript to get the accessToken through ajax?
Answer: If you are using node.js, you can do so by using the Node.js client for  ExactTarget's Fuel REST APIs.
<code>var fuel = require('fuel').configure({
    authUrl: 'https://auth.exacttargetapis.com/v1/requestToken',
    clientId: 'xxxxxxxxxxxxxxxxxxxxxxxx',
    clientSecret: 'yyyyyyyyyyyyyyyyyyyyyyyy'
});
</code>
Comment: Can I just have it as pure client side without relying on server (in this case, nodejs)?
Answer: Yes.  Use a jquery.post to https://auth.exacttargetapis.com/v1/requestToken with your clientId and clientSecret in the payload.  The result will contain your oauth token.
Comment: Hi Timothy, thanks for your answer but I tried that using jquery ajax, what I get in return is cross origin error but the network transaction is 200 OK, do you have any code sample that I can look at?


How can fully convolution neural networks handle images of different sizes?

Question: I've read that if we want to use images of different sizes in a convolutional neural network without resizing the images to a default size, we can use Fully Convolutional Neural Networks. But I do not see how they solve the issue of images of different sizes. In this video Andrew Ng explains how we can turn a fully connected layer into a fully convolutional layer, you can see the complete drawing which presents the idea at 3:45, if you don't want to watch the entire video. But with only this change we still couldn't use images of different sizes. The critical part is where Andrew transformed a $5$ x $5$ x $16$ volume into a $1$ x $1$ x $400$ volume using $400$ filters with size $5$ x $5$. But given an input image of a different size, this won't work anymore. If the input image will be larger, then the volume at that layer won't be $5$ x $5$ x $16$ anymore, and so the $5$ x $5$ filters won't turn the volume into a $1$ x $1$ x $400$ volume, and the rest of the neural network won't work anymore. So what do people mean when they say that a fully connected network can work with images of different sizes, since this fully connected network couldn't accept an image of a different size if we wanted to do that. What am I missing? I've tried to read the original Fully Convolutional Neural Networks paper, but I am not sure I understand it.
Answer: A fully convolutional network is independent of the number of pixels in the input if the output size is allowed to have a different number of pixels as well.
This is due to the fact that the number of parameters in a convolutional layer is independent of the number of pixels in the input.
However, the same convolution applied to images of different sizes, will produce outputs with different sizes.
This scenario typically occurs in some sort of auto-encoder setup.
After all, it is typically no problem if the size of the hidden representations is greater for large than for small images.
E.g. for segmentation, as in the fully convolutional networks paper, or compression tasks.
To make a prediction network truly independent of the image size, you would typically use global average pooling at some point in the network.
Global average pooling reduces all pixels to a single value by computing the average pixel value.
This makes it possible to add fully-connected (or convolutional) layers with fixed dimensions to obtain the desired output size.
However, this has nothing to do with fully convolutional networks per se.


Daniel 12:12 - Is it A) At the 1,335th day or B) after 1,335 days

Question:
11And from the time that the regular burnt offering is taken away and
the abomination that makes desolate is set up, there shall be 1,290
days. 12Blessed is he who waits and arrives at the 1,335 days.

Does it mean

At 1,335th day
After 1,335 days
Comment: (1335thDay) For in depth answer see #34254, Ray Grant's answer, or #34707, Ray Grant's answer. This Day was the final day of the siege of Jerusalem in 70 A.D. when the Destruction of Jerusalem was finally over (except for a few 'mopping up operations). The war against the whole land of Judea lasted 1290 days, but there was one fortress hold-out that didn't surrender until the 1335th day.
Answer: It is unlikely that it means "After 1,335 days".
The word translated as "arrives at" in your translation is the word יגיע, which is a conjugation of the verb נגע (H5060), which is usually translated as "to reach" or "to touch".
To give a flavor, this word is also used in verses like:
Genesis 3:3 (NASB)

but from the fruit of the tree which is in the middle of the garden, God has said, 'You shall not eat from it or touch it, or you will die.'"

Genesis 28:12 (NASB)

He had a dream, and behold, a ladder was set on the earth with its top reaching to heaven; and behold, the angels of God were ascending and descending on it.

Ezekiel 7:12 (NASB)

The time has come, the day has arrived. Let not the buyer rejoice nor the seller mourn; for wrath is against all their multitude.

Thus it denotes the idea of making contact with something, but definitely not exceeding it, as would be needed to express the concept of "After 1,335 days". If the text had wanted to express the idea of "after", or "following", the word אחר (H310) likely would have been used (but it was not).
Hence, I think a more literal translation here might be "reaches the 1,335 days". In isolation, I think you could interpret this one of two ways:

upon reaching the beginning of a period of 1,335 days
upon reaching the end of a period of 1,335 days

If you believe that the start of the period of 1,290 days mentioned in the prior verse is the same as the start of the period of 1,335 days, then the first interpretation makes little sense, because there would be no waiting.
But if you believe the 1,335 days start after the 1,290 days, then either interpretation is plausible.
But in neither case does it mean "After 1,335 days" (some indefinite period surpassing the number of days indicated).
Comment: Thanks. This is what I had suspected from reading the english translation.
Answer: Destruction of Judea The answer to your question is made evident by recalling the event in which it transpired. The conquest of Judea by the Roman Legions lasted from 67-70 A.D, that is 1290 days (See Daniel 12, and Flavius Josephus, Wars of the Jews). After besieging the capitol, Jerusalem, and conquering the people, with the burning of the Temple, the War was almost over.
But one group of Zealots held out in the Upper City, in one of Herod's palaces, whose walls and towers were so thick that the Roman machines could never have broken through.  General Titus waited it out...AND mysteriously, the rebels opened the gates and surrendered on the 1335th day of the war!!! The fighting then ceased; the war was over, except for a few mopping up operations.
So "blessed are those people" who made it through all the fighting to the end, with their lives still in tack!


How to identify certain term in a long document with NLP?

Question: Given different long documents of the same type, e.g. certain type of report, I need to identify certain items within the report, such as certain item's amount, the name of the certain person etc. How should I frame this problem under nlp? And what are the general approaches? I think the key challenge here is the same type of information will be in different part of the document in different documents. And the documents are 30-40 pages long.
Answer: To me this looks like Named Entity Recognition (NER), more generally a sequence labeling problem. The typical approach is to train a custom NER model using a large sample of annotated data.

Pro: this is a very well known problem, there are multiple libraries which implement this.
Cons: based on the description of your problem it's not sure that annotating a large sample of documents is doable, especially if there are very few target terms.
Comment: Aha, that's what I didn't think about before! As my docs are long, there can be many person names but only 1 particular name can be the CEO etc. In this case, how can NER handles that? Or other techniques needed?
Comment: @Wong it's a matter of amount and quality of training data: if you can have many annotated examples of the CEO name and/or if there are clear clues in the context (e.g. there's almost always the same sequence like "the CEO is John Smith"), then it can work well. If on the contrary there are few examples and the patterns are diverse, the model will probably miss a lot of cases.


How can I configure wpa_supplicant so that my wlan interface is disabled when I plug in ethernet cable?

Question: I am trying to come up with the standard configuration using wpa_supplicant for both Ethernet and wireless interfaces on a Debian system. I would like to do it in a way that when you plug in the Ethernet cable, the wireless interface is disabled, and enabled again when you unplug the cable (a reasonable configuration to get the best performance). How do I do it?
Answer: I second womble's assertion that wpa_supplicant is the wrong place to do this.  You want to set something up in the /etc/network/ subtree, perhaps as womble suggests by increasing the metric of the wifi route, or perhaps by some other means involving a custom script in /etc/network/if-up.d/ that would take the wifi interface down if the ethernet interface came up.
Info on making scripts for /etc/network/if-up.d/ is on the interfaces man page, under the 'IFACE OPTIONS' section.
Comment: Hi, how can I create this custom script in /etc/network/if-up.d/? This sounds the most reasonable way to go forward.
Answer: Are you sure that wpa_supplicant is what you want to be fiddling with to do this?  It's really just for authenticating WPA connections, not doing link status detection and the rest of it.
Personally, I wouldn't even bother disabling the wifi, I'd just have an up action on the wifi interface that gave it's route a higher metric, so that if the wired interface was up it would be preferred.  Something like this should do the trick (assuming that your LAN is 192.168.10.0/24):
<code>iface home inet dhcp
    [usual WPA guff here]
    up route del -net 192.168.10.0 netmask 255.255.255.0
    up route add -net 192.168.10.0 netmask 255.255.255.0 metric 1
</code>
Doing the link-sense autodetection I have no idea about; I don't typically want my network interfaces doing stuff I don't know about, so I've never looked into it.
Comment: Hi, what is the 192.168.10.0 address? I am not sure if its relevant, but I am using this pc on more than one wireless network, so I get different settings from dhcp server.
Answer: Works for me out of the box.
I think the package implementing it is network-manager-gnome (it contains the panel applet).


Is a string literal in С++ created in static memory?

Question: Is a string literal in C++ created in static memory and destroyed only when the program exits?
Answer: Yes, string literals are valid for the entire duration of the program, even during the destruction of static objects.
2.13.4/1 in the Standard says

An ordinary string literal has type "array of n const char" and static storage duration.

The Standard says of 'static storage duration' in 3.7.1/1:

The storage for these objects shall last for the duration of the program.
Answer: Where it's created is an implementation decision by the compiler writer, really. Most likely, string literals will be stored in read-only segments of memory since they never change.
In the old compiler days, you used to have static data like these literals, and global but changeable data.  These were stored in the TEXT (code) segment and DATA (initialised data) segment.
Even when you have code like char *x = "hello";, the hello string itself is stored in read-only memory while the variable x is on the stack (or elsewhere in writeable memory if it's a global). x just gets set to the address of the hello string. This allows all sorts of tricky things like string folding, so that "invalid option" (0x1000) and "valid option" (0x1002) can use the same memory block as follows:
+-> plus:0   1   2   3   4   5   6   7   8   9   A   B   C   D   E
|      +---+---+---+---+---+---+---+---+---+---+---+---+---+---+----+
0x1000 | i | n | v | a | l | i | d |   | o | p | t | i | o | n | \0 |
       +---+---+---+---+---+---+---+---+---+---+---+---+---+---+----+

Keep in mind I don't mean read-only memory in terms of ROM, just memory that's dedicated to storing unchangeable stuff (which may be marked really read-only by the OS).
They're also never destroyed until main() exits.
Comment: The BSS segment only ever held zeroed but non-constant data; data initialized to non-zero values was in the DATA segment.
Comment: @Destructor, I'm assuming that was meant as a comment on the answer from JamesHopkin. *That's* the answer that contends that "string literals are valid for the entire duration of the program, even during the destruction of static objects". Neither my answer nor that of unwind (the other that you put this comment on) contends this but at least you have James surrounded :-)
Answer: Well ... Yes. They sort of have to be; the information that makes up the sequence of characters in each string has to be somewhere. If they were to be allocated dynamically and then initialized, where would the information used to to the initialization reside? Thus, it's more efficient to simply make the strings static, so that they are always available and valid once the program is done loading.
Answer: String literals are stored in read-only segments of memory
Comment: Likely, but not required.  A conforming implementation *could* store string literals in read-write memory.  Any program that can tell the difference has undefined behavior anyway.  Of course storing them in read-only memory is a good idea (if the underlying system supports it).
Comment: On a (simple) microcontroller they are usually stored in RAM (without any write protection). Putting them in flash memory to save space requires special measures.


How to Install Linux without CD/USB

Question: I have a machine with no CD/DVD drive. I do not own a USB. This device has only 32gigs of memory.  I have a Kali iso that I want to install on it.  The notebook currently runs on Debian. Any ideas on how this can be done?  Would I be able to use grub2's isoboot?
Comment: Welcome to the Unix and Linux stack exchange site! Please review the [Help Center](https://unix.stackexchange.com/help) to get more information on how to best post to this site. Sounds like you are already aware of a solution. What have you tried and what is not working? You already have a working Debian install, why is it necessary to switch over to Kali? Many of the tools Kali comes with even work on Windows computers.
Answer: There are methods not specifically documented for Kali which work for Arch and Debian. However, since you have Debian, and Debian is the foundation of Kali, you may add the packages to your Debian install to let it do what Kali does, including downloading, building, and installing the Kali kernel.

How to Install Linux without CD/USB


What is the shortcut to use Zen Coding for Notepad++?

Question: What is the shortcut key (Tab?) to activate Zen Coding within Notepad++ once Zen is installed?  Could it be F1?  Tab is not working.  Nothing in Preferences under Editing.
Answer: Go to settings > Shortcut Mapper > Plugin Commands tab.
Look for "Expand Abbreviations" it has the shortcut "Alt-Ctrl-Enter" by default.
Double-click that line (or hit Modify button) and deselect all checkboxes. Select "Tab" from the drop-down list of available key commands, and boom! Tab now Expands Abbreviations when it finds them, and otherwise functions as the normal Tab.
Hope this helps!
Answer: You have set a shortcut yourself.
Go to settings > Shortcut Mapper > Plugin Commands tab.
There at the end you will find Zen coding commands. Find command named "Expand Abbreviation" and Double click on empty column next to it and define new shortcut key. You may need to restart notepad++ app. Verify this change by going to "plugin > Zen coding" and the shortcut key will appear with command name.
Don't give an already occupied shortcut. Try with some hard key combination. like for me its "ctrl + alt + enter"
Answer: The Default Shortcut Key to "Expand Abbreviation" in Notepadd++ is Ctrl+E, is you can see it under "Zen Coding" menu item; You can change shortcuts for Zencodeing in "\Program Files\Notepad++\plugins\NppScripting\includesfiles\Zen Coding.js". At the very bottom of this file, you can find and edit keyboard shortcuts. But if you use \t for this action, it won't work for indentation, so it's not recommended.
Answer: I had this same issue after installing zen last week. I came here and it gave me the gist of how to fix it, but what I noticed is that my default setting to expand was ctrl+alt+enter. This is also the default to add a return before, so the reason it didn't work is because the return before command was overriding. By changing the default expand function to a free combination (I use ctrl+alt+E) it worked fine.
Answer: Ok so for those of you who've come here with the same problem:
1) Make sure you've read the readme file and you've put the install files in the correct place (check again).
2) Save your document as HTML or CSS (only then will it trigger the shortcuts).
3) Check out the cheat sheet online, type one of the relevant shortcuts, and then hit (Ctrl+E).
If that doesn't work you've done something wrong.