I have converted an image file into hex file which has R,G,B and alpha values in multiple columns. For example :  3c 48 36 ff 1d 2b 19 ff 08 18 06 ff 08 17 05 ff 14 1f 0d ff 1b 22 11 ff 1a 1f 0e ff 1a 1b 0b ff 1d 1a 0b ff 20 1a 0b ff 23 1a 0c ff 23 1c 0d ff 24 1d 0e ff 24 1d 0e ff 21 1c 0d ff 23 1c 0d ff 1f 1a 0b ff 1e 19 0a ff 1c 19 0a ff 1e 1a 0b ff 20 1a 0b ff 24 18 0b ff 23 18 0a ff 21 18 0a ff  Now I want a way to read and store this data as a collection of 32 bits( i.e. 4bytes). If I do not know how bytes are present in the file (since file can be of any size), how can I achieve this?
I have a text file named "Hex_data.txt". I want to load content of Hex_data.txt into a variable name RAM in verilog. When I try this, I get an error that the text file can't be found. Where is this file loaded from?  The content of "hex_data.txt" :            21            a4          2a          26          7a          ff           6f   I want to create a variable name "RAM" defined like:   reg [6:0] RAM; in which the above content save like:  RAM[0]=21     RAM[1]=a4           RAM[2]=2a             RAM[3]=26            RAM[4]=7a             RAM[5]=ff             RAM[6]=6f   I wrote a code:  module file_read;      reg [7:0] RAM [0:6];          initial $readmemh("Hex_data.txt", RAM);   integer i;               initial begin                    $display("data:");                for (i=0; i &lt; 7; i=i+1)                $display("%d:%h",i,RAM[i]);              end                 endmodule        But the above code not working. How can i get desired output?
ffmpeg working from command line in Terminal but not in an Automator shell script! I have just compiled my own copy of ffmpeg on my system and it's located in the following path:  /opt/local/bin/ffmpeg   When I run the following command in Terminal.app, it runs smooth:  ffmpeg -i /Users/Amit/Documents/input.avi -c:v copy -c:a aac -b:a 384k -strict -2 /Users/Amit/Documents/output.m4v   However, a similar command run as a shell-script in an Automator service fails:  for f in "$@" do     ffmpeg -i "$f" -c:v copy -c:a aac -b:a 384k -strict -2 "${f%.*}.m4v" done   Up until now, I had a pre-compiled build of ffmpeg on my system located at:  /Applications/Scriptlets/   And my Automator shell-script had the full path (/Applications/Scriptlets/ffmpeg) instead of just ffmpeg; and it worked fine. However, today I decided to compile a fresh copy of ffmpeg using MacPorts and removed the earlier version from my Applications/Scriptlets folder. Now, this ffmpeg works fine in Terminal but gives an error whenever I try running it from a shell-script inside of an Automator workflow. Am I doing something wrong here? Please help! I asked a  recently, looking for examples of an online tool. Per the , I answered my own question with a few examples that I had already found. I did this so that these examples would be included in the answers, along with the rest.  The question has received only down votes and insults saying that this shouldn't be done.   Should I not answer my own questions? Can jQuery get all CSS styles associated with an element? SD card not showing files when connected to pc When my phone MOTOROLA G3(2015) is updated to Marshmallow, its not showing files when connected to PC. While connecting, it shows options as charing only, PTP, MTP, MIDI. When I select MTP, it shows the external card, but not showing the contents, where as internal memory is detected and all files are shown. If votes works differently on meta sites how does that of accepting answers work? In the faq of meta sites you can read something like the following:     Voting here works a bit differently   from other Stack Exchange sites. On   Meta Stack Overflow, voting is used to   express agreement or disagreement, not   to point out a lack of quality or   helpfulness. Please don't be concerned   if you receive downvotes – members of   the community may simply disagree with   your bug, feature request, support   issue, or the nature of the   discussion.   My question is: If votes works differently on meta sites how does that of accepting answers work?  Take for instance a question on a meta site that is meant for the community to discuss some issue. What does it mean if the question is accepted? Accepting an answer is up to the author of the question so it cannot be a sign of what answer the community concludes from the discussion. It could mean that the discussion is over but that should be up to the community and not the author of the question. Is it so that accepting an answer for a discussion question on a meta site does not have a particular function? I am aware that, to use a Spell Scroll, you must have the related spell on (at least one of) your spell list(s). Then, if you have the spell slot to cast it, you succeed automatically; else, you must make an ability check in order to cast it (failure resulting in the scroll being wasted).  Consider this example : A Cleric 5 / Wizard 4 finds a Raise Dead Spell Scroll. The spell is on the Cleric List, but is a fifth level spell. Considering that the cleric-wizard has fifth level slots, but can only pick up to third level cleric spells, would he have to make the ability check to successfully cast the Raise Dead in the Spell Scroll, or would he succeed automatically ? How can I propose a new site? I have an idea or subject that should have a Q&amp;A, and want to propose a new site. How can I do this?  Related: Acquiring drive names (as opposed to drive letters) in Java On my Windows machine, my main hard drive has the letter C: and the name "Local disk".   To list the drive letters in Java on Windows, the File object has the static listRoots() method. But I can't find a way to acquire the drive names (as opposed to the drive letters) on Windows.  Has anyone tried this before? What are quarks made of? So atoms are formed from protons and neutrons, which are formed from quarks.  But where do these quarks come from? What makes them? Show that if $n>2$, then $(n!)^2>n^n$. Show that if $n&gt;2$, then $(n!)^2&gt;n^n$.     My work: I tried to apply induction. So, at the induction step, I need to prove, $n^n&gt;(n+1)^{n-1}$ Here, I tried to use induction again without any luck. I also took log of both sides, but I did not get anything. Please help! Both static_cast and reinterpret_cast seem to work fine for casting void* to another pointer type. Is there a good reason to favor one over the other? I'm learning Neural Networks and I grasped the algebra behind them. I'm now interested in understanding how normalization and centering of the input data affect them. In my personal learning project (Regression with NN) I've transformed my input variables to a range between 0 and 1 using the following function:  normalize &lt;- function(x) {return((x - min(x))/ (max(x) - min(x)))}   The NN model fits well and has an acceptable out-of-sample prediction error.   However, I read in other  that scaling the inputs to have mean 0 and a variance of 1 is advised for NN. I don't fully understand:   how this transformation works better for NN against the min-max normalization between 0 and 1. how can I assess which transformation to apply in my data? Crossfading Video AND Audio with ffmpeg This Super User answer  has got me so far, but now that I have tried many solutions and seen every SO link out there, it's time to ask you all for help.  I am trying to crossfade 2 videos that are 10 seconds each in ts format with audio and video at the same time.   The steps are:   Add complex filter black screen Fade out video 1 after 9 seconds, with 1 second fade duration Fade in video 2 at 9 seconds, with 1 second fade duration Trim black filter output to 19 seconds   This works fine for just video alone, but when I attempt to add audio, I can't get past this error message:     Output pad "default" with type audio of the filter instance "Parsed_asetpts_4" of asetpts not connected to any destination   It appears I'm not connecting the audio output properly. I think I need to alter the [over] lines to include audio. But how do I do this?  `ffmpeg -i vid1.ts -i vid2.ts -f lavfi -i color=black -filter_complex \ "[0:v]format=pix_fmts=yuva420p,\ fade=t=out:st=9:d=1:alpha=1,setpts=PTS-STARTPTS[v0];\ [0:a]\ afade=t=out:st=9:d=1,asetpts=PTS-STARTPTS[a0];\ [1:v]format=pix_fmts=yuva420p,\ fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS+9/TB[v1];\ [1:a]\ afade=t=in:st=0:d=1,asetpts=PTS-STARTPTS+9/TB[a1];\ [a0][a1]amix=inputs=2;\  [2:v]scale=720x406,trim=duration=19[over];\ [over][v0]overlay[over1];\ [over1][v1]overlay=format=yuv420[outv]" -vcodec libx264 -y -map [outv] final.ts` What and where are the stack and heap? Programming language books explain that value types are created on the stack, and reference types are created on the heap, without explaining what these two things are. I haven't read a clear explanation of this.  I understand what a stack is. But,    Where and what are they (physically in a real computer's memory)? To what extent are they controlled by the OS or language run-time? What is their scope? What determines the size of each of them? What makes one faster? Is it possible to host a web server from behind a NAT My PC is behind a NAT router that has a public IP address. If I want to host a website then I believe I need a domain name which I can purchase from some site which would pledge to resolve all DNS requests for that domain name and send the IP address of my NAT router (assuming I do not want to host my domain name on their servers). Now I want to host a web server on my computer.   What changes should be done to the NAT router's configuration to forward all HTTP requests for example.com to my PC in the internal network. Is the above strategy correct? Is it commonly used? Should first and last name be formatted? Bachelor thesis or Bachelor's thesis Disable OS X startup sound How can I permanently disable the startup sound (or chime) in Yosemite?  (I am using a late-2014 13" macbook pro)  I already tried several options found here and there :    installed StartNinja.app => did not work installed Auto-Mute.app  => did not work tried to install the old StartupSound prefPane => did not work tried the command "sudo nvram SystemAudioVolume=%80" => volume does not change (I also tried other values than 80, such as 00, 01, or nothing)   NOTE: I know that it is possible to mute the next startup sound by turning the volume down, but this is not a permanent solution. Pseudoinverse and norm Suppose the m * n matrix A =$ \begin{bmatrix}     A_1 \\A_2 \end{bmatrix}$ where A1 is a nonsingular square matrix (n*n) and A2 is an arbitrary matrix. Why is $||A^{+}||_2 \leq ||A_1^{-1}||_2$  ?   ($A^{+}$ denotes the psuedoinverse) derivative of cost function for Logistic Regression I am going over the lectures on Machine Learning at Coursera.   I am struggling with the following. How can the partial derivative of   $$J(\theta)=-\frac{1}{m}\sum_{i=1}^{m}y^{i}\log(h_\theta(x^{i}))+(1-y^{i})\log(1-h_\theta(x^{i}))$$  where $h_{\theta}(x)$ is defined as follows  $$h_{\theta}(x)=g(\theta^{T}x)$$ $$g(z)=\frac{1}{1+e^{-z}}$$  be $$ \frac{\partial}{\partial\theta_{j}}J(\theta) =\sum_{i=1}^{m}(h_\theta(x^{i})-y^i)x_j^i$$  In other words, how would we go about calculating the partial derivative with respect to $\theta$ of the cost function (the logs are natural logarithms):  $$J(\theta)=-\frac{1}{m}\sum_{i=1}^{m}y^{i}\log(h_\theta(x^{i}))+(1-y^{i})\log(1-h_\theta(x^{i}))$$