text:
Q: Wordpress background images not showing - issue with database There are some background images missing from my site: http://www.test.cwscambodia.org/
These include:

*

*arrows.png (arrows on the right and left of the image slider)

*sponsor_title.png (behind the the 'our supporters' text) down the bottom of the home page.

*sponsor_arrows.png on each side of the 'our supporters' images at the bottom of the home page

*search_bg.png which is background of the search field.

You can see how these images should look on the theme's test site: http://themes.themolitor.com/wpaid/
I have been told by the theme developer and the host that it is database problem in the wp_options table. However, I do not know which area to fix.
I have been trying to solve this issue for about 3 weeks so I would be really grateful if anyone can help me.

A: In the /wp-content/themes/wpaid/style.css you link to the folder /images. This folder does not  exists.
example
.pxs_navigation span.pxs_prev {
    left: 50%;
    margin-left: -560px;
    background:url(images/arrows.png) no-repeat left top;
}
.pxs_navigation span.pxs_next {
    right: 50%;
    margin-right: -560px;
    background:url(images/arrows.png) no-repeat right top;
}
.pxs_navigation span.pxs_prev:hover {background:url(images/arrows.png) no-repeat left bottom;}
.pxs_navigation span.pxs_next:hover {background:url(images/arrows.png) no-repeat right bottom;}

In this case you will see that the arrows are linked to images/arrows.png, a folder that not exists. The good url link is /wp-content/themes/wpaid/images/arrows.png
That is the problem why you dont see all the backgrounds on your website. You can use a replace function in a text editor to change them all in one time.


text:
Q: click event on dynamic li elements Updated the question as per @Jonathan Kuhn's feedback and it works like a charm
I am building a messaging system for my web application.
where the users should be able to communicate with me via messages (ajax)
I am being able to append
 with additional
 from jQuery
$('#send').click(function(e){
            e.preventDefault();
            var reply = $('#reply').val();

            var project_id = 44; // just for reference
            $.ajax({
                type: "post",
                url: "<?php echo base_url(); ?>messages/send",
                data:{ msg:reply, project_id:project_id },
                success: function (response) {

                    if(response=="success"){

                        $(".messages").append('
'+reply+'delete
');
                        var clearText = "ture";

                    }else{

                    }

                }

            });

Which is working perfectly fine. But I am having problem while deleting the dynamically added list element.
I tried bind() and on() jQuery functions but  as I am not much good at it, I am facing a lot of issues.
$("#messages").on('click', '#delete', function(event) {
                event.preventDefault();
                var id = 22 ; // just for reference
                $.post( "<?php echo base_url(); ?>messages/delete", { type:'single', id:id } )
                  .done(function( data ) {

                });
                $(this).closest('li').remove();
            });

My HTML structure is as below

sdaghdsdelete

A: You have id="#messages" on the
. Remove the # and then the .on one should work.
Also, ids are supposed to be unique throughout the page. So you shouldn't have multiple message ids throughout. If you need multiple, use classes. Remove the id from the
.

redpajama_set_name: RedPajamaStackExchange


text:
Q: New JQuery 1.5 breaks good old image lightbox... why? Currently a (bought) JavaScript lightbox code works on my website that does work perfectly, only on older jQuery libraries like 1.3.2 and 1.4.3,  but not on newer builds like 1.5

The problem on the new jQuery libraries is, that upon clicking a thumbnail the screen first goes into the dark mode but the lightbox never shows up, somewhere during that process it stops. This happens only if I load the new jQuery libraries, which I do prefer to use since all rest of my site works faster it seems with the newer builds.

Any hints Where I should be looking for / where to find Jquery differences?
Your ideas are much appreciated.

A: Line 73 - "SWFObject is not defined"
Edit:
http://blog.jquery.com/2010/11/11/jquery-1-4-4-release-notes/
BACKWARDS-INCOMPATIBLE CHANGES IN JQUERY 1.4.4
The .width() and .height() methods no longer return 0 when inspecting an element hidden using 'display: none'. To determine if an element is hidden, always use .is(':hidden').
Your script is full of height() == 0 or width() == 0 or Maths calculations with width() or height().
My best recommendation is to stick with jQuery 1.4.3 or rewrite the plugin \o/


text:
Q: How to filter out where specific columns are all na Here is a sample dataset:
id <- c("Item1","Item2","Item3","Item4","Item5","Item6")
var1 <- c(2,3,NA,NA,5,6)
var2 <- c(NA,3,5,NA,5,NA)
var3 <- c(NA,3,4,NA,NA,6)
test <- data.frame(id, var1, var2, var3)

I want to filter out where var1, var2 and var3 are all na. I know it can be done like this:
test1 <- test %>% filter(!(is.na(var1) & is.na(var2) & is.na(var3)))
test1

     id var1 var2 var3
1 Item1    2   NA   NA
2 Item2    3    3    3
3 Item3   NA    5    4
4 Item5    5    5   NA
5 Item6    6   NA    6

Is there a better way of doing this?

A: If the filtering is focused on certain columns, e.g. var1:var3, you can use
library(dplyr)

option 1
test %>%
  filter(rowSums(across(var1:var3, ~ !is.na(.))) > 0)

option 2
test %>%
  filter_at(vars(var1:var3), any_vars(!is.na(.)))

option 3
test %>%
  rowwise() %>%
  filter(sum(!is.na(c_across(var1:var3))) > 0) %>%
  ungroup()

output
# # A tibble: 5 x 4
#   id     var1  var2  var3
#   <chr> <dbl> <dbl> <dbl>
# 1 Item1     2    NA    NA
# 2 Item2     3     3     3
# 3 Item3    NA     5     4
# 4 Item5     5     5    NA
# 5 Item6     6    NA     6

A: A base R one-liner.
test[apply(test[-1], 1, function(x) any(!is.na(x))), ]
#     id var1 var2 var3
#1 Item1    2   NA   NA
#2 Item2    3    3    3
#3 Item3   NA    5    4
#5 Item5    5    5   NA
#6 Item6    6   NA    6

One-liners can be difficult to read, here is a broke down version of the code above.
Define an auxiliary function f.
f <- function(x) any(!is.na(x))

Now apply the function rowwise, with MARGIN = 1.
i <- apply(test[-1], 1, f)
i
#[1]  TRUE  TRUE  TRUE FALSE  TRUE  TRUE

Only the TRUE index values will be part of the final result.
test[i, ]
#
# Output omited, identical to above
#

A: You can try this base R approach:
#Base R solution
test[complete.cases(test),]

     id var1 var2 var3
2 Item2    3    3    3


text:
Q: Angular is redirecting to home page even when login credentials are false I'm sorry to ask this, but I've been working on it for hours now and still can't figure it out. We are using an API to pull data from a database for a members-only site. The login form should redirect to the home page of the site if information is correct, else it should show a popup that says: "invalid username and password" (we would also like an error message if fields are left blank). However the login will still go to the home page whether the information is correct or not.
Here is the html form - login.html
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title></title>

    <link rel="stylesheet" href="/CMPS1/css/login.css">

SGAConnect

            <input type="text" placeholder="username" ng-model="username" required>

            <input type="password" placeholder="password" ng-model="password" required>

            <input type="button" value="Login"  ng-click="login(username,password)">

our controller/api -- login_controller.php (based off code igniter framework)
<?php
class Login_controller extends CI_Controller
{

    function validate(){
//       when posting  json data to the api
        $json = key($this->input->post(NULL, TRUE));
        $json = json_decode($json);
        $username = $json->username;
        $password = md5($json->password);
//        when posting with a normal post method with parameters
//        $username = $this->input->post('username');
//        $password = md5($this->input->post('password'));
        $this->load->model('Membership_model');
        $query = $this-Membership_model->validate($username,$password);
        if($query) {
            $data['status']= true;
        }
        else{
            $data['status'] = false;

        }

        $this->load->view('verify.php', $data);
    }

}
?>

the angular file -- app.js
(function() {
    angular.module("sga",[])
        .controller("MainController",["$scope","$http",function($scope,$http){
        $scope.login = function (username, password) {

            var req = {
                url: 'http://localhost/CMPS1/API/application/controllers/Login_controller/validate',
                method: "POST",
                data: {
                    username: username,
                    password: password
                },
                headers: {'Content-Type': 'application/x-www-form-urlencoded'}

            };

            if ($http(req).then(function (response) {
                    if (response.data) {
                        window.open('index.html', '_self');
                    }
                }));

            else {
                alert("Invalid username or password.");
            }
        };

    }]);

})();

the file which actually checks the database to see if info is correct -- membership_model.php
<?php
class Membership_model extends CI_Model{
    function validate($username,$password){
        $this->db->where('username',$username);
        $this->db->where('password',$password);
        $query = $this->db->get('users');
        if($query->num_rows() == 1){
            return $query;
        }
        else{
            return false;
        }

    }
}

Any help would be immensely appreciated. Thank you.

A: Angularjs is used to create single page applications. In your MainController you are redirecting the user to index.html on success.
You should have two views, one for login and another for home page in angularjs.
Include  in your index.html and create routes for login and home page.
.config(function ($routeProvider, $httpProvider) {
$routeProvider
  .when('/', {
    templateUrl: 'views/login.html',
    controller: 'LoginCtrl',
    controllerAs: 'login'
  })
  .when('/home', {
    templateUrl: 'views/home.html',
    controller: 'HomeCtrl',
    controllerAs: 'home'
  })
  .otherwise({
    redirectTo: '/'
  });

});
In the success callback just redirect to /home using "$location.path( "/home" );"


text:
Q: Is there an equivalent to xkill for Windows 7? In Linux there is a utility called xkill that changes the mouse pointer so that whatever you window you click is killed.  This saves you the trouble of finding its PID and killing it with kill -9.
Is there any similar utility for Windows 7 that can save me the trouble of going through the task manager?

A: There is WiXkill. Another alternative is Windows xKill. Here is the direct download link.

A: Process Explorer can do this just fine. You use the icon in the toolbar on the top which looks like a target icon (It's next to the binoculars). As soon as you press it, your cursor turns into that target icon, and the process explorer window is hidden. Drag it over the window you want nuked, and release the mouse button. The process who created that window will be hilighted inside the Process Explorer UI. You can nuke the process at that point as normal (i.e. by pressing the del key)
EDIT: Oh, and this should work for any version of Windows NT as new or newer than Windows XP, not just Windows 7.

A: Found a port of xkill (win-xkill) at bitbucket. Look at the Readme.txt how to use it. You can (instead of using AutoHotkey) create a shortcut to the exe and enter a keyboard shortcut in the shortcuts properties dialog.
I tried it with Windows 10.


text:
Q: PhalconPHP - get specific object with multiple relations I have a model, call it Robot, which has multiple manyToMany relationships with other models - Part, Country and Permision. Relation models being RobotsParts, RobotsCountries and RobotsPermissions.
Each robot can have multiple or no parts, countries and permissions linked to them.
To get all the robots with a certain part, PhalconPHP makes it easy. (aliases being properly set in models, of course).
$part = Part::findFirstByName("arm");
$robotsWithPart = $part->robots;

The same thing applies for robots with a certain country:
$country = Country::findFirstByCode("HR");
$robotsWithCountry = $country->robots;

But how can one get only robots with a certain part, country and permission?
I've had futile attempts like:
$country = Country::findFirstByCode("HR");
$part = Part::findFirstByName("arm");

$robots = $country->getRobots([
    'conditions' => "(partId = :pid:)",
    'bind' => [
        'pid' => $part->id
    ]
]);

But, of course, partId is not recognized as it doesn't belong to any of the selected models;

A: You can use the $model->getRelated('model', $parameters = []) option.
$parameters = [] works the same as how you would normally query a model. i.e; it takes the parameters order, limit, conditions, ...
$country = Country::findFirstByCode("HR");
$part = Part::findFirstByName("arm");

$robots = $country->getRelated('Robot', ['partId = ' . $part->id]);

You can find this in the documentation

UPDATE
That sounds like it wouldn't be possible. You will have to call a custom query on your Robot model. Something like this:
$result = Robot::query()
        ->join('Country', 'Country.id = Robot.countryId')
        ->join('Part', 'Part.robotId = Robot.id')
        ->where('Country.code = :code:')
        ->where('Part.name = :name:')
        ->bind(['code' => 'HR', 'name' => 'arm'])
        ->execute();

You can also use the Querybuilder, if you prefer to use that.


text:
Q: How to create file in %windir% correctly? This creates a bat file, and runs it. It works without any problems.
Dim sb As New System.Text.StringBuilder

sb.AppendLine("@echo off")
sb.AppendLine("set hostspath=%windir%\System32\drivers\etc\hosts")
sb.AppendLine("echo 99.127.158.117 www.example.com >> %hostspath%")
sb.AppendLine("exit")

IO.File.WriteAllText("fileName.bat", sb.ToString())
Process.Start("fileName.bat")

However when I  try to change the file dir, like
IO.File.WriteAllText("%windir%\fileName.bat", sb.ToString())
Process.Start("%windir%\fileName.bat")

It doesnt create and run it. What is the correct way to do that ? (exe is running as an administrator)


text:
Q: Is it right to render the quantifier of existence through a disjunction during skolemization I am to solve a problem:
$\forall x \exists y \neg P(x,y) \rightarrow \exists x \forall y Q(x,y)$
I'm getting rid of implication:
$\exists x \forall y P(x,y) \lor \exists x \forall y Q(x,y)$
And now I'm using  this formula:
 $\exists x A(x) \lor \exists B(x)$ = $\exists x( A(x) \lor B(x))$
$\exists x (\forall y P(x,y) \lor \forall y Q(x,y))$
Then I resolve variable conflicts: y->t
$\exists x (\forall y P(x,y) \lor \forall t Q(x,t))$
And moving all quantifiers to the very begining
$\exists x \forall y \forall t (P(x,y) \lor  Q(x,t)))$
The existence quantifier should be changed to the constanta: x->c
$ \forall y \forall t (P(c,y) \lor  Q(c,t)))$
And then eliminating the $\forall$ quantifiers
$(P(c,y) \lor  Q(c,t))$
Am I right at my solution? Can anybody please check the answer?

A: Yes. Each step is well reasoned and checks out okay.


text:
Q: Using jQuery to get the width of each element in a list I am trying to get the width value of each list item in an element but it keeps returning the object and not the width.  This should be really simple but for some reason I must be missing something.
Here is my code:
    var listWidth = $('ul li').each(function(){
        return $(this).width();
    });

    console.log(listWidth);

A: Use the map()(docs) method instead to return the values to a jQuery object, then the get()(docs) method to convert it to an Array.
var listWidth = $('ul li').map(function(){
    return $(this).width();
}).get();

Or similar, you can use the jQuery.map()(docs) method, which returns an Array.
var listWidth = $.map($('ul li'),function(val){
    return $(val).width();
});

A: You can get them by pushing the values to an array also:
var listWidth = [];
$('ul li').each(function() {
    listWidth.push($(this).width());
});

console.log(listWidth);

Here's an example.

A: Since you will have multiple list items, you can create an array of widths as you go:
var listWidth = [];
$('ul li').each(function(){
    listWidth.push($(this).width());
});

console.log(listWidth);

Or, instead, you could create an object with the widths:
var listWidth = {};
$('ul li').each(function(){
    listWidth[$(this).attr('id')] = $(this).width();
});

console.log(listWidth);

This example creates an object that contains the id of the tag and its width ({ id1: width, id2: width, etc...}, assuming each tag has an id).
The example code you posted had the problem that, when returning the width, it was returning it to the each function (which probably just discarded it), but listWidth was the return value of the each function, not the anonymous function inside (so, since the each function returns a jQuery object, that is what was assigned to listWidth).


text:
Q: how is set clock with GMT(S) iran? GMT iran-tehran is +3:30 but why this site: http://wwp.greenwichmeantime.com/time-zone/asia/iran/tehran/ putting GMT for iran-tehran +4:30.
How set yourself clock(in my code) with change GMT in iran?
MY CODE: http://jsfiddle.net/HZmPg/1/
var int=self.setInterval("clock()",1000);
            function clock()
            {
            var d=calcTime('+3')
            var t=d.toLocaleTimeString();
            document.getElementById("clock").innerHTML=t;
            }
    function calcTime(offset) {

    // create Date object for current location
    d = new Date();

    // convert to msec
    // add local time zone offset
    // get UTC time in msec
    utc = d.getTime() + (d.getTimezoneOffset() * 60000);

    // create new Date object for different city
    // using supplied offset
    nd = new Date(utc + (3600000*offset));

    // return time as a string
    return nd;

}

With respect

A: It should work:
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Lorem ipsum</title>
  <style>
  </style>
</head>
<body>
<script type="text/javascript">
var interval = self.setInterval("clock()", 1000);
function clock(){
  var date = new Date();
  var hourOffset = 3;
  date.setUTCHours(date.getUTCHours(), date.getUTCMinutes());
  var time = date.getTime();
  date.setUTCFullYear(date.getUTCFullYear(), 2, 22);
  var dstStart = date.getTime();
  date.setUTCFullYear(date.getUTCFullYear(), 8, 22);
  var dstEnd = date.getTime();
  if(time > dstStart && time < dstEnd)hourOffset = 4;
  date.setUTCHours(date.getUTCHours()+hourOffset, date.getUTCMinutes()+30);
  var output = date.getUTCHours()+":"+date.getUTCMinutes()+":"+date.getUTCSeconds();    document.getElementById("clock").innerHTML=output;
}
</script>
<b id="clock"></b>
</body>
</html>

A: It appears that Tehran is currently on Daylight Saving Time.
$ TZ=Asia/Tehran date ; date -u
Fri Aug 12 03:45:44 IRDT 2011
Thu Aug 11 23:15:44 UTC 2011


text:
Q: Is it possible to share a session between web and iOS app? I'm using AppAuth in my iOS app for Authorization. Specifically i'm using the Authorization Code flow.
Now with help of URL schema, I will open up iOS app when user clicks on a certain link on the web application. Ideally I would like to authenticate the user automatically from web to the iOS app after the user clicks on the link.
Is this possible?
The current Authorization Flow uses OIDExternalUserAgentSession


text:
Q: Showing GIF image at the time of the Upload HI,
I am working on Asp.net 2.0 and C#.
I stuck with one issue.
I want to upload the file (Large file through upload control in asp.net). but at the time of uploading, want to see a animated gif image (In Process).
I don't want to use Ajax and third party tool to upload. It's in plain asp.net 2.0.
I heard that, through threading it's possible. I tried but no luck... :(
Can anyone please help me out from this problem?
Thanks In Advance...
Mahesh

A: I think there is an issue with IE that prevents animated gifs from fully rendering during upload; it simply shows first frame.
Instead display flash animation, it will work as expected.

A: If you were creating a windows thick client (winform/WPF) then yes a thread would work. ASP.NET is an entirely different beast. It does not have threading (at least in the html) and on the server threading is discouraged because of the possible side effects as the server scales.
What you are trying to do can't be done with out of the box components. To do what you want you must use some sort of javascript. I would look at uploadify. It's simple, easy to use and fits your needs.
If you need the server side code I can post it.


text:
Q: bash workflow for operating with big number of tar.gz archives I am working with the directory consisted of 4 sub-dirrectories
ls -t
pnmrnp40_to_69  pnmrnp9028_to_9100  pnmrnp00_to_39  pnmrnp70_to_9028

inside of each prmnp* subdir there are many filles belonged either to *.tar.gz archive or *.md5sub (which I don not know what is it so it should be removed).
charlie@Precision-7920-Tower:~/Documents/script/mega_data/pnmrnp/pnmrnp40_to_69$ ls -t
ligands57_dir_results.tar.gz.md5sum  ligands40_dir_results.tar.gz.md5sum
ligands57_dir_results.tar.gz         ligands69_dir_results.tar.gz
ligands69_dir_results.tar.gz.md5sum  ligands68_dir_results.tar.gz
ligands68_dir_results.tar.gz.md5sum  ligands67_dir_results.tar.gz
ligands67_dir_results.tar.gz.md5sum  ligands66_dir_results.tar.gz
ligands66_dir_results.tar.gz.md5sum  ligands65_dir_results.tar.gz

I need a simple bash workflow which will move to each of the subdirectories

*

*remove all *.md5sub

*untar all *.tar.gz to the same subfolder (keeping the name of the original archive).

Here is my workflow in bash:
#!/bin/bash
# assuming that the script is in the folder contained all subdirectories
dir="$PWD"

# loop each subdirectory
for subdir in ${dir}
cd ${subdir}
# unzip each archive to the same place
for tar in *.tar.gz; do
tar xzvf $tar
done
# return to initial dir
cd ..
done

are there any possibilities to make this script more efficient in order that it could be adapted for very big number of archives?

A: find(1):
...
       -execdir command ;

       -execdir command {} +
              Like -exec, but the specified command is run from the
              subdirectory containing the matched file, which is not normally
              the directory in which you started find.  As with -exec, the {}
              should be quoted if find is being invoked from a shell.  This a
              much more secure method for invoking commands, as it avoids race
              conditions during resolution of the paths to the matched files.
              As with the -exec action, the `+' form of -execdir will build a
              command line to process more than one matched file, but any
              given invocation of command will only list files that exist in
              the same subdirectory.  If you use this option, you must ensure
              that your $PATH environment variable does not reference `.';
              otherwise, an attacker can run any commands they like by leaving
              an appropriately-named file in a directory in which you will run
              -execdir.  The same applies to having entries in $PATH which are
              empty or which are not absolute directory names.  If any
              invocation with the `+' form returns a non-zero value as exit
              status, then find returns a non-zero exit status.  If find
              encounters an error, this can sometimes cause an immediate exit,
              so some pending commands may not be run at all.  The result of
              the action depends on whether the + or the ; variant is being
              used; -execdir command {} + always returns true, while
              -execdir command {} ; returns true only if command returns 0.
...

find -type f -name '*.tar.gz' -execdir tar xvf {} \;


text:
Q: Best approach to learning web programming I come from a scientific and embedded programming background, and I have had minimal experience with web programming.  What would be the best approach to take to get up to speed with web programming?  Tools and framework suggestions?
One approach would be to dive into learning a framework, such as Rails. I started doing this with rails tutorial, but I find that the framework abstracts so many important concepts that I should be learning.
To sum up, experienced programmer wants to learn web-app programming.

A: Do you know anything about HTML?  This is probably the most basic and easiest yet essential thing you need.  Make yourself a simple webpage, play around with fonts, images, positioning etc and everytime you come across a problem look up the answer.
From there move onto CSS, Server Side Programming etc
I think you find this is the way most of us learnt.

A: From experience, the best way has to be get in too deep. Get making stuff, make mistakes, make lot's of mistakes. Learn from them.
With so many alternate paths, it's a really subjective thing to say you should take any one of them.

A: Few years back I asked this question to myself!
This is what I find easy and organized way to start web programming, you can skip steps which you have already know

*

*To learn web programming, first you have to know

*

*What is a website

*What are the main role players
[Webserver, Mark-up languages, Client side scripting, Server side scripting, Protocols (http), Browsers

*Trace complete server round trip i.e. from typing google.com in browser and to loading the complete page.

*Why http is stateless? Role of session to overcome this?

*Start learning html & little JavaScript

*

*Basic tags

*Marquee :-)

*Alert, change color page background color via javascript etc

*Have some fun playing around with html, javscript and css

*Server side scripting

*

*Start with php

*Use all necessary input – type elements and create forms

*Validate form with plain javascript

*Retrieve submitted form data and display it via php

I think you can complete 1 to 5 quickly.  Its interesting part for all novice web programmers, because of the visual excitement they get while using html and css first time/
Then move to serious stuff!!!
At this time, you know fundamental things of web programming and working of website.
Now, it's your responsibility to choose most appropriate language, platform and framework.
No one here can't help you with this; You have to consider your personal interests and future plans to decide.
My recommendation is to go with php, since you learned it in initial stages.

*

*Next, is databases
a.  Learn how to connect database
b.  Basic sql queries. Select, insert, update and delete
c.  Manipulate user inputs using database

*Now, start creating a personal website; or any simple website

*Download any open source website and learn from it.

Here are few references, which may help you
 1. W3 Schools – for learning basics of html, css, JavaScript, asp, database queries
 2. Php.net– for everything about php
 3. For exploring open source projects
  - http://bitbucket.org/
  - http://github.com/
  - http://www.codeplex.com/
  - http://sourceforge.net/
Always remember that there are several peoples here for help you; if anything happen, post it in stackoverflow.
Find someone with some amount of web programming experience to guide you; it's always easy to learn from experienced programmers.
Do not forget to find some books too… for a starter you can checkout dummies
All the best!!!

A: *

*Start with raw HTML.

*Then get used to CSS

*Learn server side programming with any easy-to-use scripting languages like python or php.

*Learn Javascript.

*Then go for the various web frameworks like MVC for learning web application management. Use the framework that suits you like Ruby-On-Rails or ASP.net MVC. If you switch to any framework depending on a language not learnt in 3rd step like C#(ASP.net) or JAVA(J2EE), then you have to learn that language also.

*Go for JQuery.

A: Maybe you should start learning basics before using more sophisticated tools like a framework. Exactly like you start with easy and simple programs in C before using C++ and libraries, you can start with simple websites in Php or Python, with a frontend in javascript, just to get used to it.
Then, when you feel at ease, you can start making cleaner websites "the right way".

A: I agree with Mild-Fuzz with going deep.
From the start you're going to be working with at least 4 different interacting languages: (Html, Css, JavaScript and at least 1 server side language. Likely you're going to have SQL in there as well, possibly some XML. Then you'll likely also be using a framework or two (for JavaScript and your server-side code).
You will have to start with the obvious basics in each. Ie make a simple html page, style it up with css, make it dynamic with some JS, a few basic CRUD operations to get into the server-side stuff. But after you have a basic knowledge of these you need to try and focus developing them roughly concurrently. You'll often find that to improve one you'll need to improve the others as you go, make sure to embrace this rather than fight it by trying to learn one well before diving into the others. Taking the all at once approach will also help you be more flexible when you move on to bigger things.
You will find that most of your problems and the areas with the most value is on the boundaries between each of these, an AJAX call to update a widget for instance will involve all of JS, CSS, HTML DOM, server-side and probably SQL. Passing data through each layer is you're biggest breaking point, if you are really good at one area in particular you might focus there to fix your bug and have a more convoluted solution than if you had looked at your server-side code.

A: The way I went about it was:

*

*Create a personal website, with only static content (only HTML)

*Extend the website with dynamic content (using PHP)

*Reform everything into a framework, to get better separation of presentation and business logic.

The biggest hurdle I had to wrap my mind about is that the server-side part of a web-application will not do anything without a preceding trigger from the client.


text:
Q: Could not load file or assembly exception Any thoughts on what might be causing this exception?
I have a webservice proj, when i load the link i get

Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.
  Exception Details: System.BadImageFormatException: Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Inner exceptions:

[BadImageFormatException: Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
[ConfigurationErrorsException: Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
[HttpException (0x80004005): Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.]

Version Information:
Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

A: Ok the answer is Got to Start->Run->type inetmgr and on the left application pools, select DefaultAppPool and the virtual directory name of the app and for both make sure to enable 32 -bit applications to true, am using IIS7.0 and windows 7 64-bit.

A: I've started to get this error with Visual studio 2022.
My project is set to AnyCPU, but some dll is compiled to x86, and I was unable to change it because I don't have the source. In previous versions of VS the project works.
I realized that in previous versions of visual studio (vs 2019 for example) the default IIS is to run on x86 (after all it is an x86 process too) as you can see here:

but in VS 2022 this option is checked by default.
Solutions:
The first solution is to uncheck the option 'Use the 64 bit version of IIS Express for web sites and projects' in Options -> Projects and Solutions. However, this will change the IIS Express version for all projects.
The second solution is to change IIS Express only for that solution (I prefer that because most of my projects don't have specific compiled dll's)
1- Go to Project Properties -> Web. In Servers section change bitness to x86:

Conclusion
The best solution is to have all dll compiled to the same platform (x86, x64, AnyCPU, etc.), but if like me you were unable to do it, this will solve for you.

A: BadImageFormatException usually means 64 vs 32 bit conflict. One of the assemblies is set to a specific platform i.e. 64 bit or 32 bit while the other is set or defaults to a different one. Check if both assemblies are for the same platform, preferably "Any CPU". In other words it could be that a 64 bit assembly is trying to load 32 bit one or vice versa.
This also applies if you're calling a COM or a DLL which is compiled for different platform, for example you call 32 bit COM/DLL from an assembly on a 64 bit system where assembly's platform would default to x64. In this case adjust your assembly's platform to match.
To change platform go to project Properties -> Build -> Platform.

A: The most common cause in my experience is that you made a change to a referenced assembly that requires rebuilding other assemblies using that changed assembly, and didn't rebuild them.
Example #1: you have an EXE that references a DLL. You add something to the referenced DLL that adds a new method, new parameter, whatever. This changes the external "signature" of the DLL; that is, the location in memory of various entry points. You don't rebuild the EXE. When the EXE loads and tries to reference the new DLL, its old entry point is no longer valid, so it cannot execute the code it needs.
Example #2: you have an x86 EXE that references a DLL. This DLL must also be compiled for x86 (or Any CPU). If you rebuild it for x64, the EXE, running in a 32-bit space, will not understand the instructions and register references to the 64-bit "extended" world, and will cry uncle.

A: I had the same issue on Visual Studio 2015 on Windows 10 x64. I was already compiling in Any CPU mode. This was a default MVC4 application (nothing added). I found a simple solution over here that worked for me:
https://github.com/aspnet/Home/issues/524
In VS 2015:
Tools > Options > Projects and Solutions > Web Projects > Use the 64 bit version of IIS Express for websites and projects

A: I had this issue, when trying to use 64-bit .dlls in my ASP.Net project, in Visual Studio 2013.
The solution was to click on Tools\Options, and tick this box:

A: If I had to take a guess, it is either a) not finding the interoped assembly or b) the COM DLL is not registered in the local registry. Simply copying DIB to the /bin folder is not enough when you are monkeying with COM.
I believe (B) is the most likely answer to what is happening.

A: My Error fixed, with change of build option to:
in my C#.net win project:
Properties > Build > Platform Target > 'x86'
I accidentally change its value to 'Any CPU' and forget to change it.

A: What worked for me was to add the assembly to GAC. To do that I ran gacutil -i PATH_TO_ASSEMBLY from Visual Studio Command Prompt

A: I finally got around this exception by deleting the entry in the applicationhost.config for IIS Express (C:\Users{username}\Documents\IISExpress\config\applicationhost.config).
I had also stopped the IIS express instance, cleaned and rebuilt in VS. Then change the config file, then restarted VS 2013.

A: An alternate to this issue is to change the build properties of your project.
For vb.net got to Project--> Properties --> Compile --> Advanced Compile Options
Here change the target CPU

A: What worked for me is doing a BIOS update on my machine!

A: This work for me, if not work for you, don't vote down. It's impolite

So it works if I change in the c# project from Any CPU to x86(all dlls
  are compiled in WIN32) from Properties -> Build -> Platform Target. I
  work on a 64-bit Win7 pc and aparently if I use Any CPU as target it
  does't find the wrapper dll.

https://www.codeproject.com/Questions/358717/Could-not-load-file-or-assembly-dll-file

A:
My Error fixed, with change of build option to:

in my C#.net win project:
Properties > Build > Platform Target > 'x86'

I accidentally change its value to 'Any CPU' and forget to change it.
It's work for me


text:
Q: Where clause for list of list I have this code that filters me the LabelType which contains "abcd".
list1 is a List that contains List of Parts (that contains string LabelType)
foreach (var elem in list1)
{
    elem.Parts = elem.Parts.Where(p => p.LabelType != "abcd").ToList();
}

How can I convert all of it in one line using linq?

A: Just to select the items you could use Where to filter and apply the Any to check the occurrence of the condition you want (p.LabelType != "abcd"):
var result = list1.Where(x => x.Parts.Any(p => p.LabelType != "abcd"))
                  .ToList();

Now, if you want to modify the content of the Parts property it is not a good pratice to change the element that is part of your loop scope. You could try it:
var result = list1.Select(x =>
                   {
                     x.Parts = x.Parts.Where(p => p.LabelType != "abcd")).ToList();
                     return x;
                   })
                  .ToList();

In the Select scope you can perform changes on the element (x) but inside of this  there is a loop, so, the result if the same of using the foreach but in design level it is one command. There is no performance gain here.


text:
Q: Not able to close the process I am not able to close the process nb.exe. I need to close this process but it is not getting closed. During closing I also need to ensure that all the dll are unloaded related to this process. Below is my code.
bool ProcessExit(void)
    {
    PROCESSENTRY32 entry;
    entry.dwSize = sizeof(PROCESSENTRY32);
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);

if (Process32First(snapshot, &entry) == TRUE)
{
while (Process32Next(snapshot, &entry) == TRUE)
{
 if (wcsicmp(entry.szExeFile, L"nb.exe") == 0)
{

HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, entry.th32ProcessID);
ExitProcess(entry.th32ProcessID);

CloseHandle(hProcess);
}
}
}

CloseHandle(snapshot);

return 1;

}
Please let me know if you have any inputs.

A: I think you are mistaken as to what ExitProcess(value) does.  You are not doing anything to the process running nb.exe, but are exiting the current process with nb's process ID as the exit code.


text:
Q: Disk boot failure, insert system disk and press Enter Similar to this related question, I came home and found that my media center pc showed this message,
Disk boot failure, insert system disk and press Enter
Before I do anything with the (defective?) harddisk, what are the best first steps I can take to fix this with a minimum of damage?
Normally the machine (Win Vista) is always on and never reboots by itself (Windows auto-updates are disabled too). Something must have caused it to reboot, though I'm sure we didn't have a power outage. The machine can't reboot on that disk, but it will boot on another disk I just plugged in for testing.
I haven't changed anything, or even touched the machine, for several days, and it has been running fine until now. I did replace the power supply some weeks ago, because the old one suddenly stopped working. It has been working fine with the replacement PSU.

A: Maybe a silly answer, but make sure there's no USB drive plugged in that the computer is trying to boot from (and of course failing). I had this happen and felt migthy foolish when I figured it out...

A: I solved the problem by booting from another harddisk with Windows and from there running the standard Windows Checkdisk utility on the defective disk with default settings. That was all it took; I removed the replacement harddisk and was able to boot from the proper (now no longer defective) disk as usual.
It did require me to temporarily install a replacement disk and install Windows on that, so it took a while. But it worked - problem solved. I must admit that I still don't know what the problem actually was...


text:
Q: How to align selectlist in vf page I have a vf page where I need to align two picklist with the above textbox.
Below is my pic and vf page -
        <apex:form >
        <apex:actionRegion >
            <apex:actionFunction action="{!clearErrors}" name="clearErrors" rerender="foo" />
            <apex:outputPanel id="foo" />
        </apex:actionRegion>
        <apex:sectionHeader title="RFP Edit" subtitle="{!IF(rfp.Id != null, rfp.Name, 'New RFP')}" />
        <apex:pageMessages />
        <apex:pageBlock id="thePageBlock" mode="edit">

            <apex:pageBlockSection columns="1" collapsible="false">

                <apex:pageBlockSectionItem >

                    <apex:outputLabel value="{!$ObjectType.RFP__c.Fields.Primary_Target_Audience__c.Label}" />
                    <apex:outputPanel id="primaryTargetAudience" layout="block" styleClass="requiredForSubmitInput">

                        <apex:inputField value="{!rfp.Primary_Target_Audience__c}" styleClass="fullWidth" required="true"/>

                    </apex:outputPanel>
                </apex:pageBlockSectionItem>

    <apex:actionregion >

    Country:
    <apex:selectList value="{!discountScheduleID}" size="1" styleClass=" chzn-select" >
            <apex:actionSupport event="onchange" action="{!FindAllName}" rerender="geographies" oncomplete="renderChosen()" />
            <apex:selectOptions value="{!dept}"/>
    </apex:selectList>

    Geography:

   <apex:outputPanel id="geographies" layout="block"  styleClass="requiredInput">

    <apex:selectList value="{!selectedGeographyIds }" multiselect="true" id="selectedGeographies" styleClass="fullWidth chzn-select" >

            <apex:selectOptions value="{!AllName}" id="movieTextBox"></apex:selectOptions>

        </apex:selectList>
    </apex:outputPanel>

    </apex:actionregion>

       </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>

A: In your apex:pageBlockSection columns="1" you need to change this into columns="2" or you can create table for same
 <apex:actionregion >

        <apex:selectList value="{!discountScheduleID}" size="1" styleClass=" chzn-select" >
                <apex:actionSupport event="onchange" action="{!FindAllName}" rerender="geographies" oncomplete="renderChosen()" />
                <apex:selectOptions value="{!dept}"/>
        </apex:selectList>

       <apex:outputPanel id="geographies" layout="block"  styleClass="requiredInput">
       <apex:selectList value="{!selectedGeographyIds }" multiselect="true" id="selectedGeographies" styleClass="fullWidth chzn-select" >
                <apex:selectOptions value="{!AllName}" id="movieTextBox"></apex:selectOptions>

            </apex:selectList>
        </apex:outputPanel>

or you can use div and some css
<apex:actionregion >

        <apex:selectList value="{!discountScheduleID}" size="1" styleClass=" chzn-select" >
                <apex:actionSupport event="onchange" action="{!FindAllName}" rerender="geographies" oncomplete="renderChosen()" />
                <apex:selectOptions value="{!dept}"/>
        </apex:selectList>

       <apex:outputPanel id="geographies" layout="block"  styleClass="requiredInput">
       <apex:selectList value="{!selectedGeographyIds }" multiselect="true" id="selectedGeographies" styleClass="fullWidth chzn-select" >
                <apex:selectOptions value="{!AllName}" id="movieTextBox"></apex:selectOptions>

            </apex:selectList>
        </apex:outputPanel>

            </apex:actionregion>


text:
Q: Function not defined at HTMLButtonElement.onclick I was trying to make some controls to the box move to left, right, up and down. But when i make all the functions in the script tag, it get an error (in all the four onclick button):

Function not defined at HTMLButtonElement.onclick

in the lines that i make the button tag.

<button onclick = "leftmove()" id = "b1"> Left </button>
<button onclick = "rightmove()" id = "b2"> Right </button>
<button onclick = "upmove()" id = "b3"> Up </button>
<button onclick = "downmove()" id = "b4"> Down </button>

A few notes aside the question:

*

*A
 might be more appropriate instead of the
 for the box

*For rendering performance you would be better of using transform(x, y) instead of margins to move the box

A: Some JavaScript variables were created to manipulate the CSS indirectly. Other elements were also implemented to better understand the movements.

<button onclick = "start()" id = "b0"> Start </button>
<button onclick = "leftmove()" id = "b1"> Left </button>
<button onclick = "rightmove()" id = "b2"> Right </button>
<button onclick = "upmove()" id = "b3"> Up </button>
<button onclick = "downmove()" id = "b4"> Down </button>


text:
Q: Error in Python app, how can I read the log file I'm a Rails developer and I'm trying to install an opensource app called Liveblog
Everything is ok with desktop, but they provide also a mobile app for iOS and Android and I cannot use it for an error.
I log the post request using nginx and this is the log.
{\"username\":\"xxxxx\",\"password\":\"xxxxx\"}
37.117.49.57 - - [24/Dec/2018:16:59:20 +0100] "POST /api/auth HTTP/1.1" 500 157 "-" "Live Blog Reporter/org.sourcefabric.LiveBlogReporter (22; OS Version 12.1.2 (Build 16C101))" "-"

The hash params with user and pass looks good.
In the application log I have this error:
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | ERROR:eve:Exception on /api/auth [POST]
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | Traceback (most recent call last):
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1817, in wsgi_app
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     response = self.full_dispatch_request()
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1477, in full_dispatch_request
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     rv = self.handle_user_exception(e)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1381, in handle_user_exception
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     reraise(exc_type, exc_value, tb)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     raise value
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1475, in full_dispatch_request
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     rv = self.dispatch_request()
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1461, in dispatch_request
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return self.view_functions[rule.endpoint](**req.view_args)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/endpoints.py", line 56, in collections_endpoint
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     response = post(resource)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/methods/common.py", line 284, in rate_limited
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return f(*args, **kwargs)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/auth.py", line 79, in decorated
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return f(*args, **kwargs)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/methods/common.py", line 1040, in decorated
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     r = f(resource, **combined_args)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/methods/post.py", line 40, in post
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return post_internal(resource, payl, skip_validation=False)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/methods/post.py", line 245, in post_internal
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     getattr(app, "on_insert_%s" % resource)(documents)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/events/events.py", line 77, in __call__
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     f(*a, **kw)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/src/superdesk-core/apps/auth/service.py", line 34, in on_create
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     user = self.authenticate(doc)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/src/superdesk-core/apps/auth/service.py", line 30, in authenticate
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     raise NotImplementedError()
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | NotImplementedError
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | ERROR:superdesk.errors:HTTP Exception 500 has been raised:
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | [2018-12-24 16:59:20 +0100] [20670] [ERROR] Error handling request /api/auth
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | Traceback (most recent call last):
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1817, in wsgi_app
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     response = self.full_dispatch_request()
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1477, in full_dispatch_request
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     rv = self.handle_user_exception(e)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1381, in handle_user_exception
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     reraise(exc_type, exc_value, tb)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     raise value
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1475, in full_dispatch_request
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     rv = self.dispatch_request()
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1461, in dispatch_request
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return self.view_functions[rule.endpoint](**req.view_args)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/endpoints.py", line 56, in collections_endpoint
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     response = post(resource)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/methods/common.py", line 284, in rate_limited
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return f(*args, **kwargs)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/auth.py", line 79, in decorated
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return f(*args, **kwargs)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/methods/common.py", line 1040, in decorated
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     r = f(resource, **combined_args)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/methods/post.py", line 40, in post
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return post_internal(resource, payl, skip_validation=False)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/methods/post.py", line 245, in post_internal
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     getattr(app, "on_insert_%s" % resource)(documents)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/events/events.py", line 77, in __call__
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     f(*a, **kw)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/src/superdesk-core/apps/auth/service.py", line 34, in on_create
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     user = self.authenticate(doc)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/src/superdesk-core/apps/auth/service.py", line 30, in authenticate
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     raise NotImplementedError()
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | NotImplementedError
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | During handling of the above exception, another exception occurred:
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | Traceback (most recent call last):
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 135, in handle
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     self.handle_request(listener, req, client, addr)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     respiter = self.wsgi(environ, resp.start_response)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/flaskapp.py", line 1033, in __call__
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return super(Eve, self).__call__(environ, start_response)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1836, in __call__
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return self.wsgi_app(environ, start_response)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1820, in wsgi_app
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     response = self.make_response(self.handle_exception(e))
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/flask/app.py", line 1410, in handle_exception
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return handler(e)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/src/superdesk-core/superdesk/factory/app.py", line 136, in server_error_handler
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return client_error_handler(return_error)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/src/superdesk-core/superdesk/factory/app.py", line 126, in client_error_handler
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return send_response(None, (error.to_dict(), None, None, error.status_code))
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/render.py", line 57, in decorated
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     r = f(*args, **kwargs)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/render.py", line 96, in send_response
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return _prepare_response(resource, *response if response else [None])
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/render.py", line 150, in _prepare_response
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     rendered = globals()[renderer](dct)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/render.py", line 303, in render_json
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     sort_keys=config.JSON_SORT_KEYS)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/simplejson/__init__.py", line 399, in dumps
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     **kw).encode(obj)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/simplejson/encoder.py", line 296, in encode
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     chunks = self.iterencode(o, _one_shot=True)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/simplejson/encoder.py", line 378, in iterencode
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return _iterencode(o, 0)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/io/mongo/mongo.py", line 57, in default
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return super(MongoJSONEncoder, self).default(obj)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/eve/io/base.py", line 36, in default
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     return json.JSONEncoder.default(self, obj)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |   File "/opt/liveblog/env/lib/python3.5/site-packages/simplejson/encoder.py", line 273, in default
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 |     o.__class__.__name__)
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | TypeError: Object of type NotImplementedError is not JSON serializable
Dec 24 16:59:20 liveblog sh[20638]: 16:59:20 rest.1 | POST None status=500 time=0s size=0b

In a Rails log error I can understand where is the problem, here I cannot understand how routes in python works, so i cannot debug the issue. Is there any hint in the log that I can use to start debugging?

A: It's explained with Traceback (most recent call last): => you can look at the last line of the traceback to check which line of code raised (thrown) the exception.
That's the line where to add a debugger breakpoint if the runtime values were not logged in the exception itself.
In your case: raise NotImplementedError() is a manual exception thrown in /src/superdesk-core/apps/auth/service.py", line 30.


text:
Q: Resolving ambiguous abbreviations in forvalues My variables are named as follows:
F_1idoXyea_2_1988
F_1idoXyea_2_1989
F_1idoXyea_2_1990

Given the code
forvalues i = 2(1)12 {
    qui replace F_1idoXyea_`i' = F_1idoXyea_`i'*exp(_b[F_1idoXyea_`i'])
}

an error message appears
F_1idoXyea_2 ambiguous abbreviation

Does anyone know how to solve this issue?

A: The use of a forvalues loop is not the cause of this problem. It's pure and simple: given that you have
F_1idoXyea_2_1988
F_1idoXyea_2_1989
F_1idoXyea_2_1990

any reference whatsoever to  F_1idoXyea_2 is ambiguous. Stata allows abbreviations of variable names (unless that's disabled) but the only way to clear this up is to tell Stata which variable you mean.
It's on all fours with this homely situation. You have three friends Peter A, Peter B and Peter C and you start telling a story about Peter to someone who knows them all. Which Peter are you talking about? is then a fair question.


text:
Q: How To send An Email thru Triggers in PL/SQL I want to send email to a single recipient  thru triggers in pl/sql when any of the DML operation is performed.
may i know the code for it.

A: Generally you should not perform complex operations in triggers. Instead of insert a record into a table, which is processed by a separate job.
To send email from the separate job use the UTL_SMTP package.


text:
Q: Link a PHP file to an AJAX request in Magento I'm a newbie to Magento and I'm using Magento 1.9
I have a template file to a quick order form. As I need to add some custom php coding, I have created a php file under the same folder (/templates/quickorder/QuickOrder.php).
What I need to implement is, when a user clicks on the "Add to Cart" button, an ajax request should be sent to my QuickOrder.php file and that will add the product to the cart.
So far my js code is as follows:
$(document).ready(function(){

    $("button[name=addtocart]").click(function(){

        var id = $("select[name=product]").val();
        var qty = $("input[name=quantity]").val();
        $.ajax({
                url: 'QuickOrder.php',
                method: 'post',
                data: { 'pro_id': id,
                        'qty':qty
                },
                success:function(data){

                },
        });

    });

});

And my QuickOrder.php file will accept the values and add the item to the cart.
$cart =Mage::getSingleton('checkout/cart');
$cart->addProduct($product, array('qty'=>$qty));
$cart->save();

This is not working. It cannot find the QuickOrder.php file.
My question is, can I specify the correct path to the php file without creating a separate module?

A: You need to create new module with frontcontroller action
for that you can refer this link
magento New module action
Then you can give url of that action in your ajax code like
    $.ajax({
            url: 'http://[hostname]/[magento]/frontname/index/action',
    .......


text:
Q: Wait For Seconds Stopping Symptoms(Unity) private void Start()
{
    DataController.GetInstance().LoadItemButton(this);
    StartCoroutine("AddMoneyLoop");
    UpdateUI();
}

IEnumerator AddMoneyLoop()
{
    while(true)
    {
        if(isPurchased)
        {
            DataController.GetInstance().AddMoney(moneyPerSec);
        }
        //Thread.Sleep(2000);
        yield return new WaitForSeconds(1.0f);
    }
}

I did the coding with the above code.
I want AddMoney to loop every second.
But it stops after 3~6 times of repetition.
yield return new WaitForSeconds(1.0f);
I think the code above is the problem. How do you solve it?

A: Depending on the rest of your code, it's likely it's getting garbage collected. You should root it by assigning it to a field in your class when you start it.


text:
Q: WooCommerce Add New Form Field On Product Page I've driven myself crazy looking for this all over the internet on how I would go around sorting this.
So I need to add a new form below the variations on WooCommerce, and get this to post through to the checkout and then into the order notes once payment has been processed. I have got the select fields added to the product view page (front end) using the code below, but now I need to somehow get this to post to the basket and checkout and then into the order in the backend, but not sure where to start with a function doing this.
add_action( 'woocommerce_before_add_to_cart_button', 'espresso_add_flavour_field', 0 );
function espresso_add_flavour_field() {
    global $post;
    global $product;

    // Show this only on the subscription boxes
    $product_type = $product->get_type();
    if( $product_type == 'variable-subscription' ){
        echo "
";
        //echo get_post_meta( $post->ID, 'Product Code', true );
        echo "Please select your favorite flavors we can include in your subscription box*
";

        $flavors = ( get_terms('pa_do-not-use-sub-flav', array('hide_empty' => false) ) );
        echo '<select name="_redeem_in_stores[]" class="chosen-select" multiple="multiple">';
        foreach($flavors as $flavor){
            echo '<option>' . $flavor->name . '</option>';
        }
        echo "</select>";

        echo "
";
    }

    return true;
}

A: I have finally found what I've been looking for on this guide:
https://wisdmlabs.com/blog/add-custom-data-woocommerce-order/


text:
Q: Select drive for user folder Is there a way for selecting a different drive for the user folder when installing windows 10 ? I don't want it to be in c:\ because appdata grows too big after some time and my primary drive is small.

A: I think there isn't, but you can edit your Documents, Videos, Images... after install. I usually do this to separate my files in different disks.
Just right-click on the folder you want to re-locate, click on properties and you'll see a 'location' tab on the window that pops up.
Hope it helps! ;)


text:
Q: Using jQuery/JavaScript to generate meta description and keywords I want to include a javascript/jquery script in my page that will automatically generate Meta description from the content of a specific element. But i have no clue where to start from. Can someone here guide me through this?

A: It's as simple as creating a new meta tag, setting it's name attribute and it's value attribute to the content of the element targetted
$('<meta />').attr({
  name: 'description',
  value: $('#idOfElementWidthDescriptionContent').text()
}).appendTo('body');


text:
Q: Getting Text from Repeater in Protractor
{{menu.label}}

Is the code for our menu. I'm trying to detect an array of the label names with
this.menuNav = element.all(by.repeater('menu in menulist').column('label'));

I bring that page object in a test and try to use the assertion
expect(navHeader.menuNav[1].getText()).toEqual('Label 2');

And I get this error
TypeError: Cannot call method 'getText' of undefined

What am I doing wrong?

A: Protractor returns a promise, you need to change your code into
element.all(by.repeater('menu in menulist').column('label')).then(function(elems) {
    expect(elems[1].getText()).toEqual('Label 2');
});


text:
Q: Run multiple controllers inside a Rack map Inside a modular Sinatra app, I have the following code in the config.ru file:
# ...
map '/' do
  run MyApp::Controller::WelcomesController
  run MyApp::Controller::Authenticated::Foo::HomesController
  run MyApp::Controller::Authenticated::Foo::SearchesController
end
# ...

And the controllers files, such as Homes controller:
# app/controllers/authenticated/foo/homes_controller.rb
require_relative 'base'
module MyApp
  module Controller
    module Authenticated
      module Foo
        class HomesController < Foo::Base
          get '/Users/Foos' do
            haml 'authenticated/foo/homes/show'.to_sym
          end
        end
      end
    end
  end
end

Searches controller:
# app/controllers/authenticated/foo/searches_controller.rb
require_relative 'base'
module MyApp
  module Controller
    module Authenticated
      module Foo
        class SearchesController < Student::Base
          get '/Users/Foos/Searches' do
            haml 'authenticated/foo/searches/index'.to_sym
          end

          get '/Users/Foos/Searches/:id' do
            haml 'authenticated/foo/searches/show'.to_sym
          end
        end
      end
    end
  end
end

Welcomes controller:
# app/controllers/welcomes_controller.rb
require_relative 'base'
module MyApp
  module Controller
    class WelcomesController < Base
      get '/' do
        haml 'welcomes/show'.to_sym, layout: false
      end
    end
  end
end

And I don't know why, but it seems that, there is a conflict between thoses controllers' routes.
If for instance I comment HomesController and SearchesController, then WelcomesController's routes are availables (200). But the routes of the two other controllers are inaccessible (404).
If I uncomment the 3 lines of the config.ru, only the routes of one of thoses 3 controllers are going to be availables.
Is there a tip to fix this trouble?  Thanks a lot!

A: You only get one run per map. Add more maps, or you could try Rack::Cascade:
run Rack::Cascade.new([
  MyApp::Controller::WelcomesController,
  MyApp::Controller::Authenticated::Foo::HomesController,
  MyApp::Controller::Authenticated::Foo::SearchesController,
])

As an aside, you don't win prizes for nesting namespaces - it's Ruby, not Java ;)


text:
Q: Strapi - anonymous browsing I'm developing a mobile app which will allow users to browse without signing up. I would like to have all my endpoints secured via token.
How would we go about allowing anonymous browsing? i.e. provide a token to anonymous users.

A: Not sure to understand your case, why do you need a token if your users aren't registered and your API opens to everyone?
The authentication system of Strapi has been built to only send token to registered users. However, the easiest way to make it work for you is to register every visitor coming in your app based on their IP or something unique as a username and set the same password for each one of them. Then, every time the user comes back, you can call the /auth/local URL to sign-in the user and get the token or use the token stored in the local storage.


text:
Q: C# SQL Connection string " can't find the table " Currently I'm working on a project that generates files....().
Everything seems to work well. I can connect to the database and my methods of reading and writing are working, too, but I can't find the table. I have an error:

$exception    {"Invalid object name 'T_SAL'."} System.Data.SqlClient.SqlException

I don't know if the problem is with my connection string or something else!
Is there anyone that can help me with this, please?
My methods' code:
//SQL connection Methods**
     public static SqlConnection OpenSql(bool Authentification, string   SQL_LOGIN, string SQL_PASSWORD, string SQL_SERVER, string BASE_CONSOLE)

  {

        try
        {
            SqlConnection conn = new SqlConnection();
            String Securité;

            if (Authentification)
            {
                Securité = "Integrated Security = true";
            }
            else
    {Securité = "User Id =" + SQL_LOGIN + ";" + "Password =" + SQL_PASSWORD;}
       conn.ConnectionString = "Data Source=" + SQL_SERVER + ";Initial Catalog=" + BASE_CONSOLE + ";" + Securité + ";";

            conn.Open();
            return conn;
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message.ToString());

            return null;
        }

// Generation :
private void Gen_f_Click(object sender, EventArgs e)
    {
        SqlConnection conn = Methodes.OpenSql(Authentification.Checked, SQL_SERVER.Text, BASE_CONSOLE.Text, SQL_LOGIN.Text, SQL_PASSWORD.Text );
        if (conn == null)
        {
            MessageBox.Show("Connexion impossible");
            return;
        }

        try
        {

            //traitement du fichier des salaeiés
            var lines = Methodes.lecture(fp_text.Text);
            foreach (var ligne in lines)
            {
                string[] cols = ligne.Split(char.Parse(";"));
                string Matricule = cols[0];

                if (Matricule != "" && MatriculeExiste(conn, Matricule) == false)
                {
                    string ligneSorties = "";

                    ligneSorties = ligneSorties + cols[0] + ";";

                    Methodes.Ecriture(ligneSorties, "fp_sorties.'Text'", true);
                }

            }
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message.ToString());

        }
    }

    private bool MatriculeExiste(SqlConnection conn, string Matricule)

         {

        SqlCommand command = new SqlCommand("SELECT MatriculeSalarie FROM [T_SAL] WHERE MatriculeSalarie='" + Matricule + "'", conn);

        using (SqlDataReader reader = command.ExecuteReader())
        {
            if (reader.Read())
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }

A: The issue seems to be in the order of parameters that you pass to OpenSql method:
 public static SqlConnection OpenSql(bool Authentification, string   SQL_LOGIN, string SQL_PASSWORD, string SQL_SERVER, string BASE_CONSOLE)

This is how you call it:
    SqlConnection conn = Methodes.OpenSql(Authentification.Checked, SQL_SERVER.Text, BASE_CONSOLE.Text, SQL_LOGIN.Text, SQL_PASSWORD.Text );

There is definitely some mismatch with the order of parameters, your declaration expects SQL_Login, SQL_PASSWORD, SQL_SERVER, BASE_CONSOLE and you are passing SQL_SERVER, BASE_CONSOLE, SQL_LOGIN, SQL_PASSWORD
So if you use Windows Authentication, it would work, because you are not passing login and password, but instead of correct Database Name you are passing password, so your user ends up into Master db, which does not contain required table.


text:
Q: How to get geolocation in C# I have written code which give me geo-location of user based on IP Address. but when i have connect my pc with USBModem at that time it show wrong location.
string apiKey = System.Configuration.ConfigurationManager.AppSettings["ipInfoDbKey"];
string url = "http://api.ipinfodb.com/v3/ip-city/?ip={0}&key=" + apiKey;
//string url = "http://ipinfodb.com/ip_query.php?ip={0}&timezone=false";
url = String.Format(url, ip);
var result = XDocument.Load(url);
var location = (from x in result.Descendants("Response")
select new LocationInfo
{
     City = (string)x.Element("City"),
     RegionName = (string)x.Element("RegionName"),
     Country = (string)x.Element("CountryName"),
     ZipPostalCode = (string)x.Element("CountryName"),
     Position = new LatLong
     {
          Lat = (float)x.Element("Latitude"),
          Long = (float)x.Element("Longitude")
     }
}).First();
return location;

i have done some work around the IpAddress. i have noticed one thing when i will connect any USBModem at that it take Modem IP address instead of my pc.can you please tell me how i can get geolocation when pc is connected to Modem by using PC IPaddress?

A: You need to work out your external IP address for your existing code to work when you connect via your Modem. Why not call something like http://checkip.dyndns.org and parse the return string?
Something like:
var req = new HTTPGet();
req.Request("http://checkip.dyndns.org");
string[] resp = req.ResponseBody.Split(':');
string ip = resp[1];

Which should give you your external IP address as a string to feed into your existing code.
You can get HTTPGet from here


text:
Q: using the .load() to copy dynamic content Good Evening!
i have a page "student_area.php" and it has 10 links (ie 10 subjects) that, when clicked, open a new php page in a new browser tab.
the student_area.php is the landing page for registered users and it stores the "exam_type" of the user in a p element. so, the element 'exam_type' is set after a successful login and the value can be 1 thru 10.
so, if the student clicks the 'math' link, it opens the math.php page in a new window.
i am using javascript for front end and php for server side.
in the math.php, i am trying to use the .load() function to get the value of 'exam_type' from the student_area.php but the load() is not returning the value of the needed element.
it is returning all the static elements but not the dynamic elements such as exam_type.
can anyone guide me please
regards

A: You can use session or cookie.
<!-- first page -->
<?php
  session_start();
  $_SESSION['exam_type'] = '1';
?>

<!-- second page -->
<?php
    session_start();
    echo $_SESSION['exam_type']; // it will print 1

?>

See it.
http://php.net/manual/en/session.examples.basic.php
http://php.net/manual/en/session.examples.php
or javascript
function post_to_url(path, params, method) {
    method = method || "post";  //default post method
    var form = document.createElement("form");
    form.setAttribute("method", method);
    form.setAttribute("action", path);
    //input type hidden name(key) value(params[key]);
    for(var key in params) {
        var hiddenField = document.createElement("input");
        hiddenField.setAttribute("type", "hidden");
        hiddenField.setAttribute("name", key);
        hiddenField.setAttribute("value", params[key]);
        form.appendChild(hiddenField);
    }
    document.body.appendChild(form);
    form.submit();
}

and call this. post_to_url('math.php', {'exam_type':'1'});
In math.php
$_POST['exam_type']  //  1


text:
Q: What is the easiest way to put a responsive logo into a Bootstrap Navbar So, I am a noob, working through using this template : http://startbootstrap.com/template-overviews/freelancer/
I am editing it, and trying to get some bells and whistles to work better. I want to put my logo into the header and have it be responsive, I cannot get other answers I've found here to work... I may be a bit thick, in fact that is probably the big issue.
What is the easiest way to place a responsive logo graphic into the bootstrap navbar?
This is the code I currently have.

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

</button>

Please advise.

A: Add

after the </button>
In this way boostrap automatically position your logo on left top corner.
And crop your My_logo_navbar.png to size you want and use media queries to change it width or height on smaller devices. If you want you can use two of navbar-brand classes with separate id's. One for larger screens and one for smaller screens.
I always use this for my projects.


text:
Q: Can I plug imaginary unit to solve partial fraction? for example, I have partial fraction to solve:
$$
1/(x^2+1)(x^2+4)=A/(x^2+1)+B/(x^2+4)\
$$
then I need to solve
$$
1=A(x^2+4)+B(x^2+1)
$$
Can I plug x=i and 2i so that I can get the value of A and B directly?
Is there any logical error to do that?

A: If it's meant for integration, it's easier to put $x^2=y$
$$\dfrac1{(y+1)(y^2+1)}=\dfrac A{1+y}+\dfrac{By+C}{1+y^2}$$
$$\iff1=A(1+y^2)+(By+C)(1+y)$$
$A+B=B+C=0,C+A=1\implies-B=C=A=\dfrac12$
Can you take it from here?


text:
Q: Why is the /user/recent/# link redirecting to a link with the date range fixed? I'm not sure what happened but up until recently the user/recent page seemed to get the most recent stuff by just refreshing. Now the first time the page loads, it gets a 302 redirect that adds in some params that lock in the date.
This might be the same issue as this post But that one is old enough that I'd think I would have spotted it well before now.
Whatever the case, the way it is now is just flat broken for anyone who wants to use tabbed browsing effectively.

A: This has been reverted; sorry for the pain.


text:
Q: Checking if authenticated in ApplicationController resulting in "wrong number of arguments (given 1, expected 0)" Right now I'm unable to navigate to my Devise-created route /users/edit without getting the following error:
  ArgumentError - wrong number of arguments (given 1, expected 0):
  app/controllers/application_controller.rb:15:in `authenticate_user!'
  devise (4.3.0) app/controllers/devise/registrations_controller.rb:133:in `authenticate_scope!'
  activesupport (5.1.2) lib/active_support/callbacks.rb:413:in `block in make_lambda'
  activesupport (5.1.2) lib/active_support/callbacks.rb:178:in `block (2 levels) in halting_and_conditional'
  actionpack (5.1.2) lib/abstract_controller/callbacks.rb:12:in `block (2 levels) in <module:Callbacks>'
  activesupport (5.1.2) lib/active_support/callbacks.rb:179:in `block in halting_and_conditional'
  activesupport (5.1.2) lib/active_support/callbacks.rb:507:in `block in invoke_before'
  activesupport (5.1.2) lib/active_support/callbacks.rb:507:in `each'
  activesupport (5.1.2) lib/active_support/callbacks.rb:507:in `invoke_before'
  activesupport (5.1.2) lib/active_support/callbacks.rb:130:in `run_callbacks'
  actionpack (5.1.2) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (5.1.2) lib/action_controller/metal/rescue.rb:20:in `process_action'
  actionpack (5.1.2) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (5.1.2) lib/active_support/notifications.rb:166:in `block in instrument'
  activesupport (5.1.2) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  activesupport (5.1.2) lib/active_support/notifications.rb:166:in `instrument'
  actionpack (5.1.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (5.1.2) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
  activerecord (5.1.2) lib/active_record/railties/controller_runtime.rb:22:in `process_action'
  actionpack (5.1.2) lib/abstract_controller/base.rb:124:in `process'
  actionview (5.1.2) lib/action_view/rendering.rb:30:in `process'
  actionpack (5.1.2) lib/action_controller/metal.rb:189:in `dispatch'
  actionpack (5.1.2) lib/action_controller/metal.rb:253:in `dispatch'
  actionpack (5.1.2) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
  actionpack (5.1.2) lib/action_dispatch/routing/route_set.rb:31:in `serve'
  actionpack (5.1.2) lib/action_dispatch/routing/mapper.rb:16:in `block in <class:Constraints>'
  actionpack (5.1.2) lib/action_dispatch/routing/mapper.rb:46:in `serve'
  actionpack (5.1.2) lib/action_dispatch/journey/router.rb:46:in `block in serve'
  actionpack (5.1.2) lib/action_dispatch/journey/router.rb:33:in `each'
  actionpack (5.1.2) lib/action_dispatch/journey/router.rb:33:in `serve'
  actionpack (5.1.2) lib/action_dispatch/routing/route_set.rb:832:in `call'
  warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
  warden (1.2.7) lib/warden/manager.rb:35:in `catch'
  warden (1.2.7) lib/warden/manager.rb:35:in `call'
  rack (2.0.3) lib/rack/etag.rb:25:in `call'
  rack (2.0.3) lib/rack/conditional_get.rb:25:in `call'
  rack (2.0.3) lib/rack/head.rb:12:in `call'
  rack (2.0.3) lib/rack/session/abstract/id.rb:232:in `context'
  rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
  actionpack (5.1.2) lib/action_dispatch/middleware/cookies.rb:613:in `call'
  activerecord (5.1.2) lib/active_record/migration.rb:556:in `call'
  actionpack (5.1.2) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
  activesupport (5.1.2) lib/active_support/callbacks.rb:97:in `run_callbacks'
  actionpack (5.1.2) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
  actionpack (5.1.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
  actionpack (5.1.2) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
  web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app'
  web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call'
  web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch'
  web-console (3.5.1) lib/web_console/middleware.rb:18:in `call'
  actionpack (5.1.2) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
  railties (5.1.2) lib/rails/rack/logger.rb:36:in `call_app'
  railties (5.1.2) lib/rails/rack/logger.rb:24:in `block in call'
  activesupport (5.1.2) lib/active_support/tagged_logging.rb:69:in `block in tagged'
  activesupport (5.1.2) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (5.1.2) lib/active_support/tagged_logging.rb:69:in `tagged'
  railties (5.1.2) lib/rails/rack/logger.rb:24:in `call'
  sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
  actionpack (5.1.2) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
  actionpack (5.1.2) lib/action_dispatch/middleware/request_id.rb:25:in `call'
  rack (2.0.3) lib/rack/method_override.rb:22:in `call'
  rack (2.0.3) lib/rack/runtime.rb:22:in `call'
  activesupport (5.1.2) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
  actionpack (5.1.2) lib/action_dispatch/middleware/executor.rb:12:in `call'
  actionpack (5.1.2) lib/action_dispatch/middleware/static.rb:125:in `call'
  rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
  railties (5.1.2) lib/rails/engine.rb:522:in `call'
  puma (3.9.1) lib/puma/configuration.rb:224:in `call'
  puma (3.9.1) lib/puma/server.rb:602:in `handle_request'
  puma (3.9.1) lib/puma/server.rb:435:in `process_client'
  puma (3.9.1) lib/puma/server.rb:299:in `block in run'
  puma (3.9.1) lib/puma/thread_pool.rb:120:in `block in spawn_thread'

The method causing the error is ApplicationController:authenticate_user! where I check to see if a user is authenticated before letting them go to any page. I also have a before_action call on all my controllers to this method.
class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception
  before_action :configure_permitted_parameters, if: :devise_controller?
  include Pundit

  layout :layout_by_resource

  protected

  def configure_permitted_parameters
    devise_parameter_sanitizer.permit(:sign_up, keys: [:name])
    devise_parameter_sanitizer.permit(:account_update, keys: [:name])
  end

  #####################################
  # This is what's giving me my error #
  #####################################
  def authenticate_user!
    unless signed_in?
      redirect_to login_path # halts request cycle
    end
  end

  def layout_by_resource
    if devise_controller? && resource_name == :user && action_name == 'new'
      "empty_application"
    else
      "application"
    end
  end

end

What I'm wondering is why my /users/edit page specifically is giving me this problem when no other page is.
My routes look like the following:
                  Prefix Verb   URI Pattern                    Controller#Action
                    root GET    /                              visitors#index
        new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
            user_session POST   /users/sign_in(.:format)       devise/sessions#create
    destroy_user_session GET    /users/sign_out(.:format)      devise/sessions#destroy
       new_user_password GET    /users/password/new(.:format)  devise/passwords#new
      edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
           user_password PATCH  /users/password(.:format)      devise/passwords#update
                         PUT    /users/password(.:format)      devise/passwords#update
                         POST   /users/password(.:format)      devise/passwords#create
cancel_user_registration GET    /users/cancel(.:format)        devise/registrations#cancel
   new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
  edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
       user_registration PATCH  /users(.:format)               devise/registrations#update
                         PUT    /users(.:format)               devise/registrations#update
                         DELETE /users(.:format)               devise/registrations#destroy
                         POST   /users(.:format)               devise/registrations#create
              home_index GET    /home/index(.:format)          home#index
              home_minor GET    /home/minor(.:format)          home#minor
                         GET    /                              home#index
                   login GET    /sign-in(.:format)             devise/sessions#new
                    page GET    /pages/*id                     high_voltage/pages#show

My UsersController.rb looks like:
class UsersController < ApplicationController
  before_action :authenticate_user!

  def index
    @users = User.all
    authorize User
  end

  def show
    @user = User.find(params[:id])
    authorize @user
  end

  def update
    @user = User.find(params[:id])
    authorize @user
    if @user.update_attributes(secure_params)
      redirect_to users_path, :notice => "User updated."
    else
      redirect_to users_path, :alert => "Unable to update user."
    end
  end

  def destroy
    user = User.find(params[:id])
    authorize user
    user.destroy
    redirect_to users_path, :notice => "User deleted."
  end

  private

  def secure_params
    params.require(:user).permit(:role)
  end

end

And my config/routes.rb look like:
Rails.application.routes.draw do
  root to: 'visitors#index'
  devise_for :users

  get "home/index"
  get "home/minor"
  root to: 'home#index'

  devise_scope :user do
    get '/sign-in' => "devise/sessions#new", :as => :login
  end

end

What am I doing in my ApplicationController.authenticate_user! method that's not allowing me to navigate to my /users/edit route and giving me the error, wrong number of arguments (given 1, expected 0)?

A: The problem is that authenticate_user! takes one argument in it's default implementation (authenticate_#{mapping} method)
Thus, if you're going to override it, the definition should be the same:
def authenticate_user!(opts = {})

That's because somewhere the method may be called with an argument
By the way, I don't think you need to override it, because it's already implemented and does what you expect it to do


text:
Q: java ORM Hibernate Exception in java 10 I'm fairly new to Hibernate ORM. Trying to Compile small Program in java with Hibernate.This is simple program that trying to insert one record to MySQL database.Below  I listed all the code i have in Student and Process class .I'm Getting various errors every time i trying to execute My Project.
After do some research i Added all libraries listed below too.
**
javax.activation-1.2.0.jar
jaxb-api-2.3.0.jar
jaxb-core-2.3.0.jar
jaxb-impl-2.3.0.jar**
then later added
jta-1_1.jar
jboss.jar
javaee.jar
now i'm getting different error listed as
 Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/SystemException
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Unknown Source)
    at org.jboss.logging.Logger$1.run(Logger.java:2554)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.logging.Logger.getMessageLogger(Logger.java:2529)
    at org.jboss.logging.Logger.getMessageLogger(Logger.java:2516)
    at org.hibernate.internal.CoreLogging.messageLogger(CoreLogging.java:28)
    at org.hibernate.internal.CoreLogging.messageLogger(CoreLogging.java:24)
    at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:85)
    at ADP.Process.main(Process.java:14)
Caused by: java.lang.ClassNotFoundException: javax.transaction.SystemException
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    ... 10 more

this is my Student Class
package ADProcess;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="student")
public class Student
{
@Id
@Column(name="StudentName")
private String StudentName ;

@Column(name="City")
private String City ;

@Column(name="Country")
private String Country;

@Column(name="Age")
private int Age;

public Student()
{

}

public Student(String studentName, String city, String country, int age)
{

    StudentName = studentName;
    City = city;
    Country = country;
    Age = age;
}

@Override
public String toString()
{
    return "Student [StudentName=" + StudentName + ", City=" + City + ", Country=" + Country + ", Age=" + Age + "]";
}

/**
 * @return the studentName
 */
public String getStudentName()
{
    return StudentName;
}

/**
 * @param studentName the studentName to set
 */
public void setStudentName(String studentName)
{
    StudentName = studentName;
}
/**
 * @return the city
 */
public String getCity()
{
    return City;
}
/**
 * @param city the city to set
 */
public void setCity(String city)
{
    City = city;
}
/**
 * @return the country
 */
public String getCountry()
{
    return Country;
}
/**
 * @param country the country to set
 */
public void setCountry(String country)
{
    Country = country;
}
/**
 * @return the age
 */
public int getAge()
{
    return Age;
}
/**
 * @param age the age to set
 */
public void setAge(int age)
{
    Age = age;
}

}

and this my my Main Class called Process
 package ADProcess;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class Process {

public static void main(String[] args)
{

    SessionFactory factory = new Configuration().configure("hibernate.cfg.xml").addAnnotatedClass(Student.class).buildSessionFactory();
    Session session = factory.getCurrentSession();

    try
    {
        Student student = new Student("Aruna","Newport News","Sri Lanka",29);
        session.beginTransaction();
        session.save(student);
        session.getTransaction().commit();
    }

    finally
    {

        factory.close();
    }

}

}


text:
Q: compare dateofbirth to the current date in cakephp $this->set('one',$this->Profile->find('all',array(
            'conditions'=>array('MONTH(Profile.DOB)'=>'MONTH(CURDATE())','DAY(Profile.DOB)>='=>'DAY(CURDATE())'),
            'order'=>'MONTH(Profile.DOB),DAY(Profile.DOB)'
            )));

can anyone help me in this please.... actually I need to display the date of birth comparing with the current date...

A: By the logic of it, are you trying to find upcoming birthdays for current month? If so, you should check the CakeTime Helper, it has useful functions. In this case you can make a combination of isThisMonth with isToday and isFuture.

A: how about
'conditions'=>
   array(
        'MONTH(Profile.DOB)' => date('m'),
        'DAY(Profile.DOB) >= '=> date('d'),
)

A: If you wanted to 'find' dates that match the current day, you could use the following condition in your find. ( I try and omit using SQL's NOW() function so it does not conflict with the Database servers timezone setting VS the application servers timezone settings IE: Amazon RDS )
$find = $this->Model->find('all',array(
     'conditions'=>array(
         'DATE(Model.DOB)' => date('Y-m-d')
     )
));


text:
Q: screenshot of all tabs chrome extension I'm new, I need to know how to get screenshots of all the tabs at the same time, I've used the function chrome.tabs.captureVisibleTab but as a parameter window, how can I do?Thanks!

A: You'll have to bring up each tab in the window with tabs.update and capture it.
function captureWindowTabs(windowId, callbackWithDataUrlArray) {
    var dataUrlArray = [];

    // get all tabs in the window
    chrome.windows.get(windowId, {populate:true}, function(windowObj) {
        var tabArray = windowObj.tabs;

        // find the tab selected at first
        for(var i = 0; i < tabArray.length; ++i) {
            if(tabArray[i].active) {
                var currentTab = tabArray[i];
                break;
            }
        }

        // recursive function that captures the tab and switches to the next
        var photoTab = function(i) {
            chrome.tabs.update(tabArray[i].id, {active:true}, function() {
                chrome.tabs.captureVisibleTab(windowId, {format:"png"}, function(dataUrl) {
                    // add data URL to array
                    dataUrlArray.push({tabId:tabArray[i].id, dataUrl:dataUrl});

                    // switch to the next tab if there is one
                    if(tabArray[i+1] != undefined) {
                        photoTab(i+1);
                    }
                    else {
                        // if no more tabs, return to the original tab and fire callback
                        chrome.tabs.update(currentTab.id, {active:true}, function() {
                            callbackWithDataUrlArray(dataUrlArray);
                        });
                    }
                });
            });
        }
        photoTab(0);
    });
}

// get all tabs in the current window
captureWindowTabs(chrome.windows.WINDOW_ID_CURRENT, function(dataArray) {
    for(var i = 0; i < dataArray.length; ++i) {
        alert(dataArray[i].dataUrl); // log to the background page or popup
    }
});