regsvr32 – Windows 7: unable to register DLL – Error Code:0X80004005

regsvr32 – Windows 7: unable to register DLL – Error Code:0X80004005

According to this: http://www.vistax64.com/vista-installation-setup/33219-regsvr32-error-0x80004005.html

Run it in a elevated command prompt.

Open the start menu and type cmd into the search box
Hold Ctrl + Shift and press Enter

This runs the Command Prompt in Administrator mode.

Now type regsvr32 MyComobject.dll

regsvr32 – Windows 7: unable to register DLL – Error Code:0X80004005

Use following command should work on windows 7. dont forget to enclose the dll name with full path in double quotations.

C:WindowsSysWOW64>regsvr32 c:dll.name 

Related Posts

MATLAB: How do I fix subscripted assignment dimension mismatch?

MATLAB: How do I fix subscripted assignment dimension mismatch?

The line:

new_img(rows,cols,:) = curMean;

will only work if rows and cols are scalar values. If they are vectors, there are a few options you have to perform the assignment correctly depending on exactly what sort of assignment you are doing. As Jonas mentions in his answer, you can either assign values for every pairwise combination of indices in rows and cols, or you can assign values for each pair [rows(i),cols(i)]. For the case where you are assigning values for every pairwise combination, here are a couple of the ways you can do it:

  • Break up the assignment into 3 steps, one for each plane in the third dimension:
    new_img(rows,cols,1) = curMean(1);  %# Assignment for the first plane
    new_img(rows,cols,2) = curMean(2);  %# Assignment for the second plane
    new_img(rows,cols,3) = curMean(3);  %# Assignment for the third plane
    

    You could also do this in a for loop as Jonas suggested, but for such a small number of iterations I kinda like to use an unrolled version like above.

  • Use the functions RESHAPE and REPMAT on curMean to reshape and replicate the vector so that it matches the dimensions of the sub-indexed section of new_img:
    nRows = numel(rows);  %# The number of indices in rows
    nCols = numel(cols);  %# The number of indices in cols
    new_img(rows,cols,:) = repmat(reshape(curMean,[1 1 3]),[nRows nCols]);
    

For an example of how the above works, lets say I have the following:

new_img = zeros(3,3,3);
rows = [1 2];
cols = [1 2];
curMean = [1 2 3];

Either of the above solutions will give you this result:

>> new_img

new_img(:,:,1) =

     1     1     0
     1     1     0
     0     0     0

new_img(:,:,2) =

     2     2     0
     2     2     0
     0     0     0

new_img(:,:,3) =

     3     3     0
     3     3     0
     0     0     0

Be careful with such assignments!

a=zeros(3);
a([1 3],[1 3]) = 1
a =
     1     0     1
     0     0     0
     1     0     1

In other words, you assign all combinations of row and column indices. If thats what you want, writing

for z = 1:3
   newImg(rows,cols,z) = curMean(z);
end

should get what you want (as @gnovice suggested).

However, if rows and cols are matched pairs (i.e. youd only want to assign 1 to elements (1,1) and (3,3) in the above example), you may be better off writing

for i=1:length(rows)
    newImg(rows(i),cols(i),:) = curMean;
end

MATLAB: How do I fix subscripted assignment dimension mismatch?

Related Posts

gaussian – GMM by fitgmdist in MATLAB gives different results when running all iterations at once or iteratively

gaussian – GMM by fitgmdist in MATLAB gives different results when running all iterations at once or iteratively

The stopping is likely related to the convergence check in MATLAB/R201Xy/toolbox/stats/stats/@gmdistribution/private/gmcluster.m about halfway through in gmcluster_learn:

%check if it converges
llDiff = ll-ll_old;
if llDiff >= 0 && llDiff < options.TolFun *abs(ll)                                                                                                                    
    optimInfo.Converged=true;
    break;
end
ll_old = ll; 

where ll is set via [ll,post] = estep(log_lh);, but near the top of the function it sets

ll_old = -inf;

so when you run all at once, llDiff shrinks over the iterations but when you run one by one, it remains large and the convergence check always fails.

gaussian – GMM by fitgmdist in MATLAB gives different results when running all iterations at once or iteratively

Related posts

javascript – freecodecamp Challenges- Seek and Destroy

javascript – freecodecamp Challenges- Seek and Destroy

You can create an array of all values that are supposed to be removed. Then use Array.filter to filter out these values.

Note: Array.splice will change original array.

function destroyer() {
  var arr = arguments[0];
  var params = [];

  // Create array of all elements to be removed
  for (var k = 1; k < arguments.length; k++)
    params.push(arguments[k]);
  
  // return all not matching values
  return arr.filter(function(item) {
    return params.indexOf(item) < 0;
  });
}

console.log(destroyer([1, 2, 3, 1, 2, 3], 2, 3));
function destroyer(arr) {
  /* Put all arguments in an array using spread operator and remove elements 
     starting from 1 using slice intead of splice so as not to mutate the initial array */
  const args = [...arguments].slice(1);
  /* Check whether arguments include elements from an array and return all that 
     do not include(false) */
  return arr.filter(el => !args.includes(el));
}

console.log(destroyer([1, 2, 3, 1, 2, 3], 2, 3));

javascript – freecodecamp Challenges- Seek and Destroy

This worked for me:

function destroyer(arr) {
    // Remove all the values

    var args = Array.from(arguments);
    var filter = [];

    for (i = 0; i < args[0].length; i++) {
        for (j = 1; j < args.length; j++) {
            if (args[0][i] === args[j]) {
                delete args[0][i];
            }
        }
    }

    return args[0].filter(function(x) {
        return Boolean(x);
    });
}

console.log(
    destroyer([1, 2, 3, 1, 2, 3], 2, 3)
);

Related posts

Where can I find documentation for Barnes and Noble search API?

Where can I find documentation for Barnes and Noble search API?

They actually do have one, but unlike Amazon, its private, and getting access is a very manual and time consuming process.

Heres the process I went through:

  1. Sign up as an affiliate @ http://affiliates.barnesandnoble.com/join-now/ (http://affiliates.barnesandnoble.com/ has more information). You dont actually sign up with B&N, you sign up with LinkShare.
  2. Email [email protected] with your LinkShare ID and the URL of the site you are building
  3. Answer any questions they have about your site
  4. Get approved as an affiliate
  5. Accept the affiliate invitation on LinkShare
  6. Email the LinkShare contact requesting API access
  7. Wait for them to forward that email and B&N to get you set up (took a week in my case)
  8. Receive an email with your access key, and a few 3 page word docs of documentation

After that, youre set.

They do not have one.

http://www.barnesandnoble.com/help/help.asp

Where can I find documentation for Barnes and Noble search API?

Even better, they claim to have one, but when you register, theres actually nothing there:

http://developer.bn.com/page

Related Posts

optional – Option String in ocaml

optional – Option String in ocaml

Note that Some x is a value, not a type. The type returned by the library would be string option. If you happen to know that the value always looks like Some x, thats a different question. But its also pretty unlikely, as the library author could just use the type string for that. You use an option type specifically so you can use None to represent the absence of a value.

Id say the type a option has the same semantics for every type a. The type a option represents a value of the type that can either be present or not. If the value is present, it takes the form Some x, where x is a value of the type. If the value isnt present, it takes the form None.

A value of type string option can be None, or it can be Some , or it can be Some xxx for any string xxx. Theres no special string-specific meaning.

optional – Option String in ocaml

Related Posts

php – Vtiger Custom Module : Sorry! Attempt to access restricted file.

php – Vtiger Custom Module : Sorry! Attempt to access restricted file.

The most likely cause for the vTiger error “Sorry! Attempt to access restricted file.” is the $root_directory value in the ‘config.inc.php’ is incorrect or misspelled.

In order to correct it follow the steps below:

Go to your vTigerCRM directory
Open “config.inc.php” with your favorite text editor
Go to line 86 and adjust $root_directory value to correct vTiger 
directory. Note, that the directory must end with /. It should look 
something like this – $root_directory = ‘/var/www/vtigercrm/’;

Also there is a problem with cache memory. So do check your cache file for template files. For that go to your vTigerCRM directory.
Then Go to Smarty->templates_c.

Here you will get list of cache files. Delete this file and check weather your problem is solved or not.

Dont worry about deletion of this file.

When trying to include files from your custom module, you will get these messages because Vtiger thinks you are including these files from a location they find rather unsafe.

To avoid this error you could use the standard way a module is used in Vtiger by navigating to it like so: ......./index.php?module=Mytest&action=index. Vtiger will include your module and now there is no need for you to include CRMEntity and other data or utils related files. It should all be available this way but make sure you are using the global statement for $current_user, $current_module etc though.

Another way is to edit the following functions located in utils/CommonUtils.php:

heckFileAccessForInclusion() and checkFileAccess()

Remove or comment out the die() in these functions to fix it.

php – Vtiger Custom Module : Sorry! Attempt to access restricted file.

In Save.php file, just add a line.

$focus->column_fields[assigned_user_id] = ;

before the

if($_REQUEST[assigntype] == U) {
$focus->column_fields[assigned_user_id] = $_REQUEST[assigned_user_id];
} elseif($_REQUEST[assigntype] == T) {
$focus->column_fields[assigned_user_id] = $_REQUEST[assigned_group_id];
}

Related Posts

java – what does Dead Code mean under Eclipse IDE Problems Section

java – what does Dead Code mean under Eclipse IDE Problems Section

In Eclipse, dead code is code that will never be executed. Usually its in a conditional branch that logically will never be entered.

A trivial example would be the following:

boolean x = true;
if (x) {
   // do something
} else {
   // this is dead code!
}

Its not an error, because its still valid java, but its a useful warning, especially if the logical conditions are complex, and where it may not be intuitively obvious that the code will never be executed.

In your specific example, Eclipse has calculated that ar will always be non-null, and so the else length = 0 branch will never be executed.

And yes, its possible that Eclipse is wrong, but its much more likely that its not.

Dead code is code that will never be executed, e.g.

 boolean b = true
 if (!b) {
    .... 
    // dead code here
 }

java – what does Dead Code mean under Eclipse IDE Problems Section

Dead code means, that there is no way that this code will be executed.

Sometimes you even cant compile it (like this case:)

private Boolean dead_code()
    {
    return true;
    //Dead code below:
    dosomething();
    }

But in other cases this is not too obvious, eg this statement:

   b=true;
   [...]
   if (b==false)
    {
    //Dead code
    }

If you have this message, there is some major flaw in your code. You have to find it, otherwise your app wont work as intended.

Related posts

javascript – How to Upload files to Puush from Web Server?

javascript – How to Upload files to Puush from Web Server?

Turns out the requests actually go through completely, but due to the nature of CORS, the response is rejected. So the files are uploaded but the response throws an error. Ive decided to pipe the requests through my server to work around the CORS drawback.

javascript – How to Upload files to Puush from Web Server?

Related Posts

sql – Error #1044 – Access denied for user [email protected] to database information_schema

sql – Error #1044 – Access denied for user [email protected] to database information_schema

As Dan Grossman said:

To remove information_schema from the dump, open the file in notepad
and delete those lines. Its just a text file of sequential queries to
run.

Open information_schema and run

FLUSH TABLES

This should clear the information_schema CACHE and will stop the error as it resyncs the tables to the latest schema

sql – Error #1044 – Access denied for user [email protected] to database information_schema

I use a program called Notepad++.

You open your sql file and the program will put it in a way where you can clearly see what the information_schema database is trying to do and why it is failing every time. You can safely remove that part of the database.

Then I install a WAMP on my pc, run a mysql program (mysql front) and import the database. After importing I have full access to the tables and databases.

Just export what you want and then just import then to your new database.

Related Posts