text:
Q: Fill inputs by clicking on div - jQuery I wanna fill a form automatically by clicking on a div which has all the contents required for the form.
My div -

Sahar Raj

Address.

City

State

Pin

9876543210

Form -
<input class="required" type="text" name="name" />
<textarea name="address" class="required"></textarea>
<input class="required" type="text" name="city" />
<select name="state">
    <option value="0">State1</option>
    <option value="1">State2</option>
</select>
<input class="required" type="text" name="pin" />
<input class="required" type="text" name="phone" />

Any idea how to achieve this? Thanks

A: Try this:
$(document).ready(function () {
    $(".ab").on("click", function () {
        $(".ab ul >li").each(function (x, value) {
            var text = $(this).html();

            var dom = $("input,textarea,select").get(x);
            $(dom).val(text);
        });
    })
});

JSFIDDLE DEMO

A: You can use a mix of  map and each methods to get it working.
Remember that the order is important to get it working. If you have haphazard order, you can use the data-* attributes to store the related field info and then populate it.
$(function () {
    $('div.ab').click(function() {
        var data = $('.ab li').map(function () {
            return this.innerHTML;
            // or return $(this).text();
        }).get();

        $('input').each(function (i) {
            this.value = data[i];
            // or  $(this).val(data[i]);
        });
    });
});

Check Fiddle
UPDATE
I have used data-* attributes to establish a relationship between the elements as they are no more of the same kind. This will be mapped to the name attribute of the field. Also encased the fields in a container as that makes them easier to select.
HTML

Sahar Raj

Address.

City

State2

Pin

9876543210

    <input class="required" type="text" name="name" />
    <textarea name="address" class="required"></textarea>
    <input class="required" type="text" name="city" />
    <select name="state">
        <option value="0">State1</option>
        <option value="1">State2</option>
    </select>
    <input class="required" type="text" name="pin" />
    <input class="required" type="text" name="phone" />

JS
$(function () {
    $('div.ab').click(function () {
        $('.container').children().each(function() {
             // Get the corresponding key value from li.
             var $this =  $(this),
                 key = $this.attr('name');
             // Find the li with that key
            var txt = $('.ab li[data-key="'+ key +'"]').text();

            $this.val(txt);
        });
    });
});

Check Data Fiddle

A: I'm guessing your inputs are all in a form and that the ul is always in the right order.
If that is true you can use:
$(function(){
    $('div.ab').on('click',function(){
        $('form input').each(function(index){
            $(this).val($('div.ab ul li:eq(' + index + ')').html());
        });
    });
});

A: You can add id for every
 and bind the click, for example the name:
HTML:

Sahar Raj

jQuery:
$('.ab').on('click', function(){
    $('input[name="name"]').val($('#name').html());
});

A: You can use this
$('div ul li').click(function () {
    var divIndex = $(this).index();
    var divText = $(this).text();
    $('input').each(function () {
        if ($(this).index() == divIndex) {
            $(this).prop('value', divText);
        }
    });
});

On the click of one
 it will read its index position and take its value/text. Then look for the <input> with same index and give the value/text to it.
The best would be to have data-  attributes on both input and li, to avoid problems if you mix up the order how they are.
DEMO HERE

A: var counter = 0;
$("#clickme").click(function() {
   $("#list li").each(function() {
       var text = $(this).text();
       $("input:eq(" + counter + ")").val(text);
       counter++;
    });
});

http://jsfiddle.net/PgYjH/1/


text:
Q: c clock() in different OS i need a 60HZ timer (16.6 ms trigger once)
it work well in windows(mingw gcc) but not in liunx(gcc)
can anyone help me abust this? THX
#include <stdio.h>
#include <time.h>t
#define PRE_MS CLOCKS_PER_SEC / 1000
int main()
{
    clock_t pre = clock();
    int cnt = 0;
    printf("CLOCKS_PER_SEC = %d\n", CLOCKS_PER_SEC);
    while (1)
    {
        clock_t diff = clock() - pre;
        if (diff > 16 * PRE_MS)
        {
            cnt++;
            if (cnt > 60)
            {
                printf("%d\n", (int)pre);
                cnt = 0;
            }
            pre += diff;
        }
    }
}

*

*printf pre 1s in windows

CLOCKS_PER_SEC = 1000
1020
2058
3095
4132
5169
6206
7243
8280
9317

*

*printf pre 2s in linux

CLOCKS_PER_SEC = 1000000
1875000
3781250
5687500
7593750
9500000
11406250
13312500
15218750

A: First a misconception: 60 Hz is not 17 operations per second but 60.
Second the period check is reading clock() twice and discarding any time interval for printf() to be called. AFAIK the CLOCKS_PER_SEC is larger on Linux than Windows systems, so there is more chance that you are 'throwing away' clock ticks. Read the clock() once, for example:
#include <stdio.h>
#include <time.h>

int main(void)
{
    unsigned long long tickcount = 0;
    clock_t baseticks = clock();
    while (tickcount < 180) {           // for 3 seconds
        tickcount++;
        clock_t nexttick = (clock_t) (baseticks + tickcount * CLOCKS_PER_SEC / 60);
        while(clock() < nexttick) {}    // wait
        printf("Tick %llu\n", tickcount);
    }
    return 0;
}

The code works from the total elapsed time, so any intervals that are not an exact number of clock ticks are averaged out (instead of a cumulative rounding-off error).
At some point the value from clock() will overflow/wrap, so a real implementation that runs for any length of time will have to take care of this.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Is it possible to Integrate 2 applications with different OAuth2 grant-types? Im trying to link AWS Alexa with a backend application(SugarCRM 9.0) which handles OAuth2.0 but different grant-type (password and refresh) and AWS Alexa Requirements are authorization code grant type or implicit grant type.Is there a way to get around this?
I'm not sure if setting up a AWS manage active directory to integrate sugar's user with Alexa, because that will generate infrastructure to a solution that can probably be simplified.I used AWS SSO as an approach to link these service since AWS SSO enables you to makes it easy to centrally manage access to multiple business applications (but not between them)...

A: Probably not the answer you want.
You'll likely need to create a middleware service that has people do the Login with Amazon login, and a Sugar CRM login, so you can reference the unique customer ID Login with Amazon creates for them (which will be the same in your skill and middleware if you use the same app ID / security profile) with the access tokens you retrieve for them from SugarCRM.


text:
Q: Enumerate Activity Intents and start as necessary I would like to create some custom "intent chooser" just like the Intent.createChooser(intent). thing.
So I need first to enumerate all activities which match the given intent which provides optional data, like EXTRA_TEXT or EXTRA_STREAM. See the comment's in the code for the actual problem. Basically, they are
1) The returned intents often are enumerated, but null (not usable)
2) The passed-in intent(constructor) data is not adopted, so the new intent is started without any extras/flags/etc.
public class IntentChooserDialog extends Dialog implements OnItemClickListener {

    private ListView mListView;
    private ResolveInfo[] mResolveInfos;
    private Bundle mIntentBundle;
    private Activity mActivity;

    public IntentChooserDialog(Activity activity, Intent intent, int theme) {
        super(activity, theme);
        setContentView(R.layout.dlg_intentchooser);

        mIntentBundle = intent.getExtras();
        mActivity = activity;

        mListView = (ListView) findViewById(R.id.dlg_intentchooser_list);
        mListView.setOnItemClickListener(this);

        enumerateApps(activity, intent);

    }

    private void enumerateApps(Context context, Intent intent) {
        final PackageManager packageManager = context.getPackageManager();
        final List<ResolveInfo> entries = packageManager.queryIntentActivities(intent, 0);
        mResolveInfos = entries.toArray(new ResolveInfo[] {});

        ArrayList<String> appNames = new ArrayList<String>(entries.size());

        final int entriesSize = entries.size();
        for (int i = 0; i < entriesSize; ++i) {
            // We only add an item if it's executable
            final Intent launchIntent = packageManager.getLaunchIntentForPackage(mResolveInfos[i].activityInfo.packageName);
            if (launchIntent != null) {
                final String appName = mResolveInfos[i].activityInfo.applicationInfo.loadLabel(packageManager).toString();
                appNames.add(appName);
            }
        }

        final ArrayAdapter<String> adapter = new ArrayAdapter<String>(context, R.layout.dlg_intentchooser_list_item, appNames);
        mListView.setAdapter(adapter);
    }
rride
    public void onItemClick(AdapterView<?> adapter, View view, int position, long id) {
        final PackageManager packageManager = getContext().getPackageManager();
        final Intent intent = packageManager.getLaunchIntentForPackage(mResolveInfos[position].activityInfo.packageName);

        // intent often is still null! -> NullPointerException; but why, Im testing it when adding them into the mResolveInfo
                // I need to provide ALL information passed to the intent we get in the constructor. So things like "addFlags" and "setType" etc. must be passed too somehow!
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtras(mIntentBundle); // extras are not added, as the intents are opened as if no extras were added. The "foreign" apps are just opened as if I opened them in the Launcher.

        getContext().startActivity(intent);

    }

}

The in the constructor passed in Intent is as any other Intent passed to Intent.createChooser could be, so
for example:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
        shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        shareIntent.setType("text/plain");
        shareIntent.putExtra(Intent.EXTRA_SUBJECT, mActivity.getString(R.string.action_openin_extraSubject));
        shareIntent.putExtra(Intent.EXTRA_TEXT, mActivity.getString(R.string.action_openin_extraText));
        shareIntent.setType("image/*");
        shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + fileName));

 new IntentChooserDialog(this, shareIntent, 0).show();


text:
Q: How to count states in SUSY multiplets? There is an easy proof of the structure of multiplet that I don't reproduce   here (it can be found in Bertolini, Lecture on Supersymmetry, pp.40-41 for the massless case and p.47 for the massive one). Here, I am referring to the massless case, to avoid useless complication.
In this proof the author constructs a Clifford algebra starting with the susy charges $Q^I_1$ and $\bar{Q}^I_{\dot{1}}$, so he has $\mathcal{N}$ creation operators and $\mathcal{N}$ destruction ones.
He argues that the states made by the application of $k$ destruction operators are $\binom{\mathcal{N}}{k}$, because of complete antisymmetry due to the algebra of anticommutation of creation operators, and here is my doubt:

*

*I understood perfectly well why there are no more than $\binom{\mathcal{N}}{k}$: because I can create new states only with the application of creation operators and they anticommute.

*I didn't understand why they can't be fewer: maybe I can find that two different (inequivalent under permutation) strings of creation operators (whose number is fixed by the helicity of the state) generate the same state (e.g.: two susy charges are represented as exactly the same operator)

The author doesn't consider this case, and I'm inclined to think that this cannot happen, but I don't understand why.

A: It's not clear in your question what you expect to conceivably happen; so what, exactly, you failed to understand.
From the N -oscillator algebra (3.10) it is evident that the state of k  creation operators $a^\dagger_a   ...a^\dagger_b | \lambda_0\rangle $ is unique for each k-tuple (a,...,b) of distinct integer labels. All such states have helicity $\lambda_0 + k/2$, but they cannot be the same.
Take N=5, k=2 for specificity.  If you are asking why no two of the 10 states of helicity $\lambda_0 +1$ can be the same, imagine two such, say
$ a^\dagger_1 a^\dagger_2 | \lambda_0\rangle$ and  $ a^\dagger_3 a^\dagger_4 | \lambda_0\rangle$ for the sake of argument. The first state is annihilated by $a_3$, but the second is not, since this operation yields $a^\dagger_4| \lambda_0\rangle$, a state of helicity $\lambda_0 + 1/2$.


text:
Q: Has many through: How to Add record and fill fields in join table I have these models:
class Item < ActiveRecord::Base
  has_many :users, through: :user_items
  has_many :user_items
end

class User < ActiveRecord::Base
  has_many :items, through: :user_items
  has_many :user_items
end

class UserItem < ActiveRecord::Base
  belongs_to :user
  belongs_to :item
end

create_table "user_items", force: :cascade do |t|
  t.integer  "user_id",
  t.integer  "item_id",
  t.integer  "amount"
end

I'd like to know the best ways to add an item to a user an also set an amount in the join table.
I was doing something like this:
user = User.first
item = Item.first
UserItems.create(user: user, item: item, amount: 5)

but I don't like it so much, and sometimes it doesn't work properly, because if I run
user.items   #=> []

I get empty array, it seems like it doesn't get the new changes in DB.
So, is there an easy way to do that? something intuitive like this would be perfect:
user.user_items << item, amount: 4

Ok, so I did this way and it worked:
user.user_items.create!(item: item, amount: 5)

But This way it didn't:
user.user_items << item, amount: 4

Now it's more elegant. But I still have the problem about the caching request. If I run user.items. it is still empty. Any idea? I tried with inverse_of and nothing. I would like to avoid reload or some methods like this. I would like to do in a transparent way, if it is possible

A: You can do this like :
user = User.first
item = Item.first
user.user_items.create!(item_id: item.id, amount: 5)

or:
user.items.push(items)

A: Try this
user.user_items.push(item: item, amount: 5)

Or if you want to reflect items without pushing new values try this
UserItem.create(user: user, item: item, amount: 5)
user.reload
user.items # this will reflect newly loaded values now


text:
Q: Feeding input to a program with Perl? I am not sure how to put this question. I am trying to write a Perl program which invokes a child program (a Fortran program) so child program goes to stdin to get yes/no.
Is there a way Perl can give that option, without letting child goes to STDIN?
Because of my poor programming vocabulary, I couldn't get an answer from Google.

A: You can start a progam with its input coming from a pipe like so:
open my $ftn_input, '|-', $fortran_program
    or die "Couldn't start $fortran_program: $!";
if ($yes) {
    print $ftn_input "Yes\n";
}
else {
    print $ftn_input "No\n";
}
close($ftn_input) # waits for fortran program to complete
    or die "Program failed; error $!, wait status $?\n";


text:
Q: How to use hosted application pool identity I have a WCF RESTful service, it is hosted on IIS 7. I am using webHttpBinding binding with the WCF service.
This service is having a application pool for which I specified a custom account identity(I specified user name & password)
Anonymous access is enabled for the WCF service.
From inside the WCF service code I want to make a HttpWebRequest to another server. But I want to use the same context (identity) under which my application pool is running.
How can I achieve it, do I need to use impersonation for this? or is there any better way for it.
Annu

A: Simply set the UseDefaultCredentials property of the HttpWebRequest to true.

A: Depends on if the other service supports Windows Authentication. If it does then you can either
 request.UseDefaultCredentials = true;

or
 request.Credentials = CredentialCache.DefaultNetworkCredentials;


text:
Q: passing function template prototype as argument I am trying to pass a templated function to another, like this:
template<typename T = bool>
void fun() {}

template<typename F>
void higher_order_fun( const F & f) {
    f();
}

int main () {
    //higher_order_fun(fun<>); //works
    higher_order_fun(fun);
}

In gcc10.2 I am able to pass fun (a template prototype) in the same way
as the specified type fun<>.
Note that this does not work if I don't have the default template parameter T=bool.
In Clang11 this doesn't work.
See https://godbolt.org/z/9WfMdc.
What is going on here?

A: All standard references below refer to N4659: March 2017 post-Kona working draft/C++17 DIS.

This is arguably a GCC bug (/extension feature), although I have not been able to find a ticket for it.
As per [temp.names]/1, you may refer to a template specialization by means of a template-id. The grammar for the latter does not allow omission of the the angle brackets <>, even if the template-argument-list within it may be empty (opt):

A template specialization can be referred to by a template-id:
simple-template-id:
  template-name < template-argument-list_opt >

template-id:
  simple-template-id
  operator-function-id < template-argument-list_opt >
  literal-operator-id < template-argument-list_opt >

In your case, you want to refer to the specialization fun<bool> of the function template fun, which is the same specialization you can refer to by making use of the default template argument for the single type template argument of fun, namely as fun<>. You cannot, however, refer to the fun<bool> specialization only by specifying fun; the latter does not refer to a specialization, and thus, your program is ill-formed.

A: You need to specify what is T when you pass fun because you need an instantiation of that parameter to build that function. Compiler needs to infer T somehow.
Compiler assumes that T is of class bool with fun or fun<>, but you cannot get rid of the default template parameter or it will not be able to deduce it.


text:
Q: Jquery Mobile - Getting an ajax result issue Trying to do a simple web app with jquery mobile. I have put together a simple log in form with ajax results to be displayed. Problem is my ajax is not getting a result even when I alert out to see if the URL is valid. Is there something special I need to do using jquery mobile?
Any thoughts/answers much appreciated!
Here is the HTML code:

Log in

                <form action="mobilelogin.php" method="post">
                  Email: <input type="text" name="email" id="useremail">
                  Password:  <input type="password" name="password" id="userpassword">
                <input type="submit" value="Enter">
                </form>

Chris Sherwood Design 2012

Js file:
$(document).ready(function() {

  $('form').submit(function() {
  var emailchecker = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
  var email = $("#useremail").val();
  var userpassword = $("#userpassword").val();
  var checklength = userpassword.length;

  if(email == ""){
    alert('Please fill in email field');
     return false;
  }else if(userpassword == ""){
    alert('Please fill in password field');
     return false;
  }else if((!emailchecker.test(email))){
    alert('Please use a valid email');
     return false;
  }else if(checklength < 6 || checklength > 6){
    alert('Password must be six characters');
     return false;
  }else{
  var datastring = $(this).serialize();
  alert(datastring);
  return false;
        $.ajax({
        type: "POST",
        url: "mobilelogin.php",
        data: datastring,
        success: function(data){
        $("#loginresult").html(data);
        }
        });

  }

  });

PHP
<?php
echo 'nothing special here...';
?>

A: From your code:
return false;
    $.ajax({
    type: "POST",
    url: "mobilelogin.php",
    data: datastring,
    success: function(data){
    $("#loginresult").html(data);
    }
    });

You are returning false before the ajax request.
EDIT (assumed it was a simple mistake, have added more explanation)
You will need to either move that return false; to below the ajax() call, or use the event object like so:
$('form').submit(function(e) {
    e.preventDefault();

The problem with just using return false; is that if there is an error in something before it it will not stop the default action. So if your ajax request errors it will miss the return false; and start loading the action page.


text:
Q: Позиционирование фиксированного блока после прокрутки страницы Есть один блок, который можно увидеть не сразу, лишь после  прокрутки страницы. Нужно сделать так, чтобы после появления этого блока он стал "fixed".
.block{
    margin-top:30%;
    width:40%;
    float:right;
    position:fixed;
    z-index: 10;
}

A: Что-то вроде такого jQuery (http://jsfiddle.net/5n5MA/2/)
var fixmeTop = $('.fixme').offset().top;

$(window).scroll(function() {

  var currentScroll = $(window).scrollTop();
  if (currentScroll >= fixmeTop) {
    $('.fixme').css({
        position: 'fixed',
        top: '0',
        left: '0'
    });
  } else {
    $('.fixme').css({
        position: 'static'
    });
  }

});

по мотивам


text:
Q: OkHttpClient with followRedirects(false) returns response with body=null I'm using retrofit for http requests, when I start a post request, response is coming from another url and got 500 error code than I set followRedirects to false, for preventing redirection, but now I got response, where response body is null and rawResponse contains this message code=302 message=Found. I tried same request using Postman and works fine.
This is my retrofit interface Factory class
 class Factory {
    final static OkHttpClient.Builder httpClient = new OkHttpClient.Builder()
            .followRedirects(false)
            .followSslRedirects(false);

    private Retrofit retrofit = new Retrofit.Builder()
            .baseUrl(BASE_URL)
            .client(httpClient.build())
            .addConverterFactory(GsonConverterFactory.create())
            .build();

    private static NetworkApi.Factory serverApi;
    private static HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();

    public static NetworkApi getApi() {
        if (BuildConfig.DEBUG){
            interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);

            httpClient.addInterceptor(new Interceptor() {
                @Override
                public Response intercept(Chain chain) throws IOException {
                    Request.Builder builder = chain.request().newBuilder()
                            .addHeader("Content-Type", "application/json");
                    return chain.proceed(builder.build());
                }
            });

            httpClient.interceptors().add(interceptor);
        }
        if (serverApi == null){
            serverApi = new NetworkApi.Factory();
        }
        return serverApi.retrofit.create(NetworkApi.class);
    }
}

retrofit library version is 2.1.0


text:
Q: Why doesn't this method print its text? (java) here's the method:
public static int chooseStrat ()
{
    String[] strats = new String[1] ;
    strats[0] = "0 - Blob" ;
    int n ;
    boolean a = false ;
    while (a == false) ;
    {
        System.out.println ("Which strategy should the AI use?(#)") ;
        printArrayS (strats) ;
        n = getInt () ;
        System.out.println ("you selected "+n+"."+" are you sure you want the computer to use the "+ strats[n]+ " ?(Y/N)") ;
        String c = getIns () ;
        while ((((!(   (c.equals ("y")) || (c.equals ("Y"))   )) && (!( (c.equals ("n")) ||  (c.equals ("N")) ) ) ))) ;
        {
            System.out.println ("try again") ;
            c = getIns () ;
        }
        if ( (c.equals ("Y")) || (c.equals ("y")) )
            a = true ;
    }
    return n ;
}

When i run this it never prints "Which strategy should the AI use?(#)" it just tries to get an entry from the keyboard. why does it do this?

A: while () *;* does not do what you want, remove the semicolon.
By the way, any decent java compiler warns you about that, did you read what it told you?

A: while (a == false) ;

That's an infinite loop right there. Remove the ; for starters


text:
Q: How to fix this error: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder? When running my maven plugin executing its goal "install" I get the the error that tells me that the "staticloggerbinder" has not been found.
I have gone through every post here in stackoverflow in which they were talking about this error ( very very common apparently ).  What they suggest in their majority is to put as a dependency what follows:
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.5.0</version>
    </dependency>

I will paste here the mvn dependency:tree  just so you see how my classpath:
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.5.0:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.5.0:compile
[INFO] |  \- log4j:log4j:jar:1.2.13:compile
[INFO] +- com.mulesoft.muleesb:mule-core-ee:jar:3.7.3:provided
[INFO] |  +- org.mule:mule-core:jar:3.7.3:compile
[INFO] |  |  +- org.mule.extensions:mule-extensions-api:jar:1.0.0-alpha-1:compile
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] |  |  +- com.github.stephenc.eaio-uuid:uuid:jar:3.4.0:compile
[INFO] |  |  |  \- com.github.stephenc.eaio-grabbag:grabbag:jar:1.8.1:compile
[INFO] |  |  +- commons-cli:commons-cli:jar:1.2:compile
[INFO] |  |  +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  |  +- commons-io:commons-io:jar:2.4:compile
[INFO] |  |  +- commons-lang:commons-lang:jar:2.4:compile
[INFO] |  |  +- commons-pool:commons-pool:jar:1.6:compile
[INFO] |  |  +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] |  |  +- org.apache.geronimo.specs:geronimo-j2ee-connector_1.5_spec:jar:2.0.0:compile
[INFO] |  |  +- javax.inject:javax.inject:jar:1:compile
[INFO] |  |  +- com.lmax:disruptor:jar:3.3.0:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-api:jar:2.1:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-core:jar:2.1:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.1:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-1.2-api:jar:2.1:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-jcl:jar:2.1:compile
[INFO] |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.7:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-jul:jar:2.1:compile
[INFO] |  |  +- asm:asm:jar:3.1:compile
[INFO] |  |  +- asm:asm-commons:jar:3.1:compile
[INFO] |  |  |  \- asm:asm-tree:jar:3.1:compile
[INFO] |  |  +- org.mule.mvel:mule-mvel2:jar:2.1.9-MULE-008:compile
[INFO] |  |  +- org.jgrapht:jgrapht-jdk1.5:jar:0.7.3:compile
[INFO] |  |  \- com.google.guava:guava:jar:18.0:compile
[INFO] |  +- com.mulesoft.licm:licm:jar:1.1.5:provided
[INFO] |  |  +- de.schlichtherle:truelicense:jar:1.29:provided
[INFO] |  |  +- de.schlichtherle:truexml:jar:1.29:provided
[INFO] |  |  +- opensymphony:propertyset:jar:1.3:provided
[INFO] |  |  \- opensymphony:oscore:jar:2.2.4:provided
[INFO] |  \- org.aspectj:aspectjrt:jar:1.7.3:provided
[INFO] +- com.mulesoft.muleesb.modules:mule-module-spring-config-ee:jar:3.7.3:provided
[INFO] |  +- com.mulesoft.muleesb.modules:mule-module-multi-tx-ee:jar:3.7.3:provided
[INFO] |  +- com.mulesoft.muleesb.modules:mule-module-xa-tx-ee:jar:3.7.3:provided
[INFO] |  +- com.mulesoft.muleesb.modules:mule-module-cache-ee:jar:3.7.3:provided
[INFO] |  \- org.springframework:spring-context:jar:4.1.6.RELEASE:provided
[INFO] |     +- org.springframework:spring-core:jar:4.1.6.RELEASE:provided
[INFO] |     \- org.springframework:spring-expression:jar:4.1.6.RELEASE:provided
[INFO] +- org.mule.transports:mule-transport-file:jar:3.7.3:provided
[INFO] +- org.mule.transports:mule-transport-http:jar:3.7.3:provided
[INFO] |  +- org.mule.transports:mule-transport-ssl:jar:3.7.3:provided
[INFO] |  |  \- org.mule.transports:mule-transport-tcp:jar:3.7.3:provided
[INFO] |  +- commons-codec:commons-codec:jar:1.9:compile
[INFO] |  +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] |  +- org.apache.tomcat:coyote:jar:6.0.44:provided
[INFO] |  |  \- org.apache.tomcat:juli:jar:6.0.44:provided
[INFO] |  +- org.samba.jcifs:jcifs:jar:1.3.3:provided
[INFO] |  +- joda-time:joda-time:jar:2.5:compile
[INFO] |  \- org.mule.modules:mule-module-http:jar:3.7.3:provided
[INFO] |     +- org.apache.geronimo.specs:geronimo-servlet_3.0_spec:jar:1.0:provided
[INFO] |     +- org.glassfish.grizzly:grizzly-framework:jar:2.3.21:provided
[INFO] |     +- org.glassfish.grizzly:grizzly-http-server:jar:2.3.21:provided
[INFO] |     |  \- org.glassfish.grizzly:grizzly-http:jar:2.3.21:provided
[INFO] |     +- org.glassfish.grizzly:connection-pool:jar:2.3.21:provided
[INFO] |     +- com.ning:async-http-client:jar:1.9.31:provided
[INFO] |     \- org.glassfish.grizzly:grizzly-websockets:jar:2.3.21:provided
[INFO] +- com.mulesoft.muleesb.transports:mule-transport-jdbc-ee:jar:3.7.3:provided
[INFO] |  +- org.mule.transports:mule-transport-jdbc:jar:3.7.3:provided
[INFO] |  +- net.sf.flatpack:flatpack:jar:3.1.1:provided
[INFO] |  +- org.jdom:jdom:jar:1.1.3:provided
[INFO] |  \- dom4j:dom4j:jar:1.6.1:provided
[INFO] +- com.mulesoft.muleesb.transports:mule-transport-jms-ee:jar:3.7.3:provided
[INFO] |  \- org.mule.transports:mule-transport-jms:jar:3.7.3:provided
[INFO] |     +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:provided
[INFO] |     \- org.springframework:spring-jms:jar:4.1.6.RELEASE:provided
[INFO] |        +- org.springframework:spring-messaging:jar:4.1.6.RELEASE:provided
[INFO] |        \- org.springframework:spring-tx:jar:4.1.6.RELEASE:provided
[INFO] +- org.mule.transports:mule-transport-vm:jar:3.7.3:provided
[INFO] +- org.mule.modules:mule-module-scripting:jar:3.7.3:provided
[INFO] |  +- org.springframework:spring-aop:jar:4.1.6.RELEASE:provided
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:provided
[INFO] |  +- org.mule.modules:mule-module-builders:jar:3.7.3:provided
[INFO] |  |  \- org.springframework:spring-web:jar:4.1.6.RELEASE:provided
[INFO] |  +- org.codehaus.groovy:groovy-all:jar:indy:2.4.4:provided
[INFO] |  +- org.python:jython-standalone:jar:2.7.0:provided
[INFO] |  +- javax.script:js-engine:jar:jdk14:1.1:provided
[INFO] |  +- org.mozilla:rhino:jar:1.7R4:provided
[INFO] |  +- org.jruby:jruby-core:jar:1.7.4:provided
[INFO] |  |  +- org.jruby:jruby-stdlib:jar:1.7.4:provided
[INFO] |  |  +- org.jruby.joni:joni:jar:2.0.0:provided
[INFO] |  |  +- com.github.jnr:jnr-netdb:jar:1.1.2:provided
[INFO] |  |  +- com.github.jnr:jnr-enxio:jar:0.4:provided
[INFO] |  |  +- com.github.jnr:jnr-unixsocket:jar:0.3:provided
[INFO] |  |  +- com.github.jnr:jnr-posix:jar:2.5.2:provided
[INFO] |  |  +- org.jruby.extras:bytelist:jar:1.0.10:provided
[INFO] |  |  +- com.github.jnr:jnr-constants:jar:0.8.4:provided
[INFO] |  |  +- org.jruby.jcodings:jcodings:jar:1.0.10:provided
[INFO] |  |  +- com.github.jnr:jffi:jar:1.2.5:provided
[INFO] |  |  +- org.yaml:snakeyaml:jar:1.11:provided
[INFO] |  |  +- jline:jline:jar:2.7:provided
[INFO] |  |  +- com.jcraft:jzlib:jar:1.1.2:provided
[INFO] |  |  +- com.headius:invokebinder:jar:1.2:provided
[INFO] |  |  \- com.github.jnr:jnr-ffi:jar:1.0.4:provided
[INFO] |  |     +- com.github.jnr:jffi:jar:native:1.3.0-SNAPSHOT:provided (version selected from constraint [1.2.1,1.3.0))
[INFO] |  |     \- com.github.jnr:jnr-x86asm:jar:1.0.2:provided (version selected from constraint [1.0.2,))
[INFO] |  \- javax.script:jruby-engine:jar:jdk14:1.1:provided
[INFO] +- org.mule.modules:mule-module-xml:jar:3.7.3:provided
[INFO] |  +- commons-jxpath:commons-jxpath:jar:1.3:provided
[INFO] |  +- com.thoughtworks.xstream:xstream:jar:1.4.7:provided
[INFO] |  |  \- xmlpull:xmlpull:jar:1.1.3.1:provided
[INFO] |  +- xpp3:xpp3_min:jar:1.1.3.4.O:provided
[INFO] |  +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:provided
[INFO] |  +- jaxen:jaxen:jar:1.1.1:provided
[INFO] |  |  \- jdom:jdom:jar:1.0:provided
[INFO] |  +- net.java.dev.stax-utils:stax-utils:jar:20080702:provided
[INFO] |  +- net.sf.saxon:Saxon-HE:jar:9.6.0-1:provided
[INFO] |  +- net.sf.saxon:Saxon-HE:jar:xqj:9.6.0-1:provided
[INFO] |  \- javax.xml.xquery:xqj-api:jar:1.0:provided
[INFO] +- org.mule.tests:mule-tests-functional:jar:3.7.3:test
[INFO] |  +- org.mule.modules:mule-module-extensions-support:jar:3.7.3:provided
[INFO] |  |  \- org.mule.extensions:mule-extensions-annotations:jar:1.0.0-alpha-1:provided
[INFO] |  +- org.springframework:spring-beans:jar:4.1.6.RELEASE:provided
[INFO] |  +- junit:junit:jar:4.11:test
[INFO] |  +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] |  |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] |  +- commons-net:commons-net:jar:2.2:test
[INFO] |  +- org.apache.ftpserver:ftpserver-core:jar:1.0.6:test
[INFO] |  |  \- org.apache.mina:mina-core:jar:2.0.4:test
[INFO] |  +- org.apache.ftpserver:ftplet-api:jar:1.0.6:test
[INFO] |  +- org.apache.sshd:sshd-core:jar:0.6.0:test
[INFO] |  +- org.bouncycastle:bcprov-jdk15on:jar:1.50:compile
[INFO] |  +- commons-dbutils:commons-dbutils:jar:1.2:provided
[INFO] |  +- org.reflections:reflections:jar:0.9.9:compile
[INFO] |  +- org.mule:mule-core:test-jar:tests:3.7.3:test
[INFO] |  \- org.mockito:mockito-core:jar:1.9.5:test
[INFO] |     \- org.objenesis:objenesis:jar:1.0:provided
[INFO] +- com.sybase.jdbc4.utils:jconn4:jar:7.07_SP133_Build_27244:compile
[INFO] +- org.mule.modules:mule-module-sfdc:jar:7.2.0:compile
[INFO] |  +- com.force.api:force-wsc:jar:36.2.0-hf1:compile
[INFO] |  +- com.force.api:force-metadata-api:jar:36.0.0-hf1:compile
[INFO] |  +- com.force.api:force-partner-api:jar:36.0.0:compile
[INFO] |  +- org.cometd.java:cometd-java-client:jar:3.0.9:compile
[INFO] |  |  +- org.cometd.java:bayeux-api:jar:3.0.9:compile
[INFO] |  |  +- org.cometd.java:cometd-java-common:jar:3.0.9:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-util-ajax:jar:9.2.14.v20151106:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-util:jar:9.2.14.v20151106:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-io:jar:9.2.14.v20151106:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-http:jar:9.2.14.v20151106:compile
[INFO] |  |  \- org.eclipse.jetty:jetty-client:jar:9.2.14.v20151106:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.2.2:compile
[INFO] |  +- com.intellij:annotations:jar:12.0:compile
[INFO] |  +- org.opensaml:opensaml:jar:2.6.4:compile
[INFO] |  |  +- org.opensaml:openws:jar:1.5.4:compile
[INFO] |  |  |  \- org.opensaml:xmltooling:jar:1.4.4:compile
[INFO] |  |  |     \- ca.juliusdavies:not-yet-commons-ssl:jar:0.3.9:compile
[INFO] |  |  +- org.apache.velocity:velocity:jar:1.7:compile
[INFO] |  |  +- org.owasp.esapi:esapi:jar:2.0.1:compile
[INFO] |  |  \- org.apache.santuario:xmlsec:jar:1.5.7:compile
[INFO] |  +- com.mule.wsdlinvoker:dynamic-wsdl-invoker:jar:2.1.6:compile
[INFO] |  |  +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] |  |  \- org.apache.xmlbeans:xmlbeans:jar:2.4.0:compile
[INFO] |  |     \- stax:stax-api:jar:1.0.1:compile
[INFO] |  +- org.antlr:antlr4:jar:4.5.1:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5:compile
[INFO] |  |  \- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[INFO] |  \- org.mule.tools.devkit:mule-devkit-shade:jar:3.9.0:compile
[INFO] +- org.mule.modules:mule-module-db:jar:3.7.3:provided
[INFO] |  +- com.mchange:c3p0:jar:0.9.5:provided
[INFO] |  |  \- com.mchange:mchange-commons-java:jar:0.2.9:provided
[INFO] |  +- com.experlog:xapool:jar:1.5.0:provided
[INFO] |  \- org.mule.common:mule-common:jar:3.7.3:compile
[INFO] |     +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |     +- org.json:json:jar:20140107:compile
[INFO] |     +- com.fasterxml.jackson.core:jackson-core:jar:2.4.3:compile
[INFO] |     \- org.antlr:antlr-runtime:jar:3.5:compile
[INFO] |        \- org.antlr:stringtemplate:jar:3.2.1:compile
[INFO] +- com.mulesoft.muleesb.modules:mule-module-batch-ee:jar:3.7.3:provided
[INFO] |  \- com.mulesoft.muleesb.modules:mule-module-kryo-serializer-ee:jar:3.7.3:provided
[INFO] |     +- com.esotericsoftware:kryo-shaded:jar:3.0.1:provided
[INFO] |     |  \- com.esotericsoftware:minlog:jar:1.3.0:provided
[INFO] |     \- de.javakaffee:kryo-serializers:jar:0.29:provided
[INFO] +- org.mule.modules:mule-module-spring-config:jar:3.7.3:provided
[INFO] |  \- org.mule.modules:mule-module-annotations:jar:3.7.3:provided
[INFO] |     \- cglib:cglib-nodep:jar:2.2:provided
[INFO] +- com.mulesoft.weave:mule-plugin-weave_2.11:jar:3.7.3:provided
[INFO] |  +- org.scala-lang:scala-library:jar:2.11.5:provided
[INFO] |  \- com.mulesoft.weave:core_2.11:jar:1.0.3:provided
[INFO] |     +- org.spire-math:spire_2.11:jar:0.9.0:provided
[INFO] |     |  +- org.spire-math:spire-macros_2.11:jar:0.9.0:provided
[INFO] |     |  +- org.scala-lang:scala-reflect:jar:2.11.4:provided
[INFO] |     |  \- org.typelevel:machinist_2.11:jar:0.3.0:provided
[INFO] |     +- org.parboiled:parboiled_2.11:jar:2.1.0:provided
[INFO] |     |  \- com.chuusai:shapeless_2.11:jar:2.1.0:provided
[INFO] |     +- io.spray:spray-json_2.11:jar:1.3.1:provided
[INFO] |     +- org.threeten:threetenbp:jar:1.2:provided
[INFO] |     \- com.fasterxml.woodstox:woodstox-core:jar:5.0.1:provided
[INFO] \- org.mule.modules:mule-module-json:jar:3.7.3:provided
[INFO]    +- org.mule.modules:mule-module-validation:jar:3.7.3:provided
[INFO]    |  +- commons-validator:commons-validator:jar:1.4.0:provided
[INFO]    |  |  \- commons-digester:commons-digester:jar:1.8:provided
[INFO]    |  \- org.mule.modules:mule-module-extensions-spring-support:jar:3.7.3:provided
[INFO]    +- org.codehaus.jackson:jackson-core-asl:jar:1.9.11:provided
[INFO]    +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.11:provided
[INFO]    +- org.codehaus.jackson:jackson-xc:jar:1.9.11:provided
[INFO]    +- de.odysseus.staxon:staxon:jar:1.2:provided
[INFO]    +- org.codehaus.woodstox:stax2-api:jar:3.1.4:provided
[INFO]    +- javax.mail:mail:jar:1.4.3:provided
[INFO]    +- com.github.fge:json-schema-validator:jar:2.2.5:provided
[INFO]    |  +- com.github.fge:json-schema-core:jar:1.2.4:provided
[INFO]    |  |  +- com.github.fge:uri-template:jar:0.9:provided
[INFO]    |  |  |  \- com.github.fge:msg-simple:jar:1.1:provided
[INFO]    |  |  |     \- com.github.fge:btf:jar:1.2:provided
[INFO]    |  |  \- com.github.fge:jackson-coreutils:jar:1.8:provided
[INFO]    |  +- com.googlecode.libphonenumber:libphonenumber:jar:6.0:provided
[INFO]    |  +- javax.mail:mailapi:jar:1.4.3:provided
[INFO]    |  \- net.sf.jopt-simple:jopt-simple:jar:4.6:provided
[INFO]    \- com.fasterxml.jackson.core:jackson-databind:jar:2.4.3:compile
[INFO]       \- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.0:compile

I don´t know if you guys will require of my pom.xml, but if so please don´t hesitate to ask me for it.
Cheers
Edit:
POM.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>...</groupId>
    <artifactId>...</artifactId>
    <version>6.0.0</version>
    <packaging>mule</packaging>
    <name>...</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <mule.version>3.7.3</mule.version>
        <mule.tools.version>1.2</mule.tools.version>

        <muleApiUrl>...</muleApiUrl>
        <username>...</username>
        <password>....</password>
        <serverGroup>Development</serverGroup>
    </properties>

    <build>
        <plugins>

<plugin>
    <groupId>com.github.nicholasastuart</groupId>
    <artifactId>mule-mmc-rest-plugin</artifactId>
    <version>1.2.2</version>
    <executions>
        <execution>
            <id>mule-deploy</id>
            <phase>install</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
            <configuration>
                <muleApiUrl>${muleApiUrl}</muleApiUrl>
                <name>${artifactId}</name>
                <username>${username}</username>
                <password>${password}</password>
                <appDirectory>${project.basedir}/src/main/app</appDirectory>
                <finalName>${artifactId}-${version}</finalName>
                <version>${version}</version>
                <serverGroup>${serverGroup}</serverGroup>

            </configuration>
        </execution>
    </executions>
</plugin>

            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-app-maven-plugin</artifactId>
                <version>${mule.tools.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <copyToAppsDirectory>true</copyToAppsDirectory>
                <inclusions>
                        <inclusion>
                            <groupId>org.mule.modules</groupId>
                            <artifactId>mule-module-apikit</artifactId>
                        </inclusion>
                    </inclusions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>add-resource</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/main/app/</directory>
                                </resource>
                                <resource>
                                    <directory>mappings/</directory>
                                </resource>
                            <resource>
                                    <directory>src/main/api/</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- Mule Dependencies -->
    <dependencies>

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>1.7.21</version> <!-- Or a property: ${sl4j-api.version} -->
</dependency>

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.5.0</version>
</dependency>

        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb</groupId>
            <artifactId>mule-core-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb.modules</groupId>
            <artifactId>mule-module-spring-config-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Transports -->
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-file</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jdbc-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jms-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-vm</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Modules -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-scripting</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-xml</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- for testing -->
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-functional</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
    <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-apikit</artifactId>
            <version>1.7.4</version>
        </dependency>
    <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
    <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-spring-config</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
    <dependency>
            <groupId>com.mulesoft.weave</groupId>
            <artifactId>mule-plugin-weave_2.11</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
    <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-ws</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
    <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-json</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <repositories>
          <repository>
            <id>Central</id>
            <name>Central</name>
            <url>http://repo1.maven.org/maven2/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-release</id>
            <name>mulesoft release repository</name>
            <layout>default</layout>
            <url>http://repository.mulesoft.org/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>

I am trying to use a maven plugin that allow me to deploy the artifacts that generate in my mule projects.  So, I include that plugin in my projects and the artifact should be deploy into my mule management console.
Maven Mule Rest Plugin

*

*download the repository to my local machine

*'mvn clean package'

*I install the artifact on my .m2 maven repository

*I include the plugin in the project from which I will send the artifact to deploy

*'mvn clean package' in that project + 'mvn mule-mmc-rest:deploy'

*Getting that fancy error I am trying to get rid of by asking in here :)

Edit2:
Building output - Project from which I want to deploy the artifact on my MMC
$ mvn mule-mmc-rest:deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building yeah 6.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> mule-mmc-rest-plugin:1.2.2:deploy (default-cli) > compile @ dos >>>
[INFO]
[INFO] --- mule-app-maven-plugin:1.2:attach-test-resources (default-attach-test-resources) @ dos ---
[INFO] attaching test resource C:\a\git\api-flytetyme-pricing\src\main\app
[INFO]
[INFO] --- build-helper-maven-plugin:1.7:add-resource (add-resource) @ dos ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ dos ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 11 resources
[INFO] Copying 6 resources
[INFO] skip non existing resourceDirectory C:\a\git\api-flytetyme-pricing\mappings
[INFO] Copying 22 resources
[INFO]
[INFO] --- mule-app-maven-plugin:1.2:filter-resources (default-filter-resources) @ dos ---
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ dos ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< mule-mmc-rest-plugin:1.2.2:deploy (default-cli) < compile @ dos <<<
[INFO]
[INFO] --- mule-mmc-rest-plugin:1.2.2:deploy (default-cli) @ dos ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.420 s
[INFO] Finished at: 2016-12-13T10:05:32+00:00
[INFO] Final Memory: 23M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.nicholasastuart:mule-mmc-rest-plugin:1.2.2:deploy (default-cli) on project dos: Execution default-cli of goal com.github.nicholasastuart:mule-mmc-rest-plugin:1.2.2:deploy failed: A required class was missing while executing com.github.nicholasastuart:mule-mmc-rest-plugin:1.2.2:deploy: org/slf4j/impl/StaticLoggerBinder
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.github.nicholasastuart:mule-mmc-rest-plugin:1.2.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/sebastian.xxxxx/.m2/repository/com/github/nicholasastuart/mule-mmc-rest-plugin/1.2.2/mule-mmc-rest-plugin-1.2.2.jar
[ERROR] urls[1] = file:/C:/Users/sebastian.xxxxx/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>uno:dos:6.0.0, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------: org.slf4j.impl.StaticLoggerBinder
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

EDIT3:
Ok, seeing that in the plugin dependencies the only slf4j that works is:
<dependency>
        <groupId>com.googlecode.slf4j-maven-plugin-log</groupId>
        <artifactId>slf4j-maven-plugin-log</artifactId>
        <version>1.0.0</version>
    </dependency>

I have opted for including this, and only this dependency in the pom of the project in which I want to make use of this plugin to deploy the artifact and the result is the following:
org.apache.cxf.transport.http.HTTPException
now the error is different :)
I will see how to fix this ...

A: EDIT:
Given the new elements, try the following:
Use the same version for both slf4j-api and slf4j-log4j12 (currently you 1.7.21 and 1.5.0 => use the most recent version for both, currently 1.7.21).
Your plugin does not specify the slf4j dependency in its pom.xml. Maybe the dependency is not properly pulled for this plugin. Try:
<plugin>
    <groupId>com.github.nicholasastuart</groupId>
    <artifactId>mule-mmc-rest-plugin</artifactId>
    <version>1.2.2</version>
    <dependencies>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.21</version>
      </dependency>
   </dependencies>
   ...
   ...
</plugin>

Original answer:
You are using SL4J, you may be missing the SL4J API dependency:
<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>1.7.21</version> <!-- Or a property: ${sl4j-api.version} -->
</dependency>

If your project depends on SL4J, you'll need too dependencies:

*

*SL4J API

*A SL4J binding, such as the one you already use

A: After a couple of ups and downs with this plugin I found the way of making it work. So we just have to call the plugin on our project by pasting the following script:
    <plugin>
       <groupId>xxxxxxxx/groupId>
   <artifactId>xxxxxxxx</artifactId>
   <version>1.0.0</version>
   <dependencies>
      <dependency>
         <groupId>com.googlecode.slf4j-maven-plugin-log</groupId>
         <artifactId>slf4j-maven-plugin-log</artifactId>
         <version>1.0.0</version>
      </dependency>
      <dependency>
         <groupId>org.codehaus.jackson</groupId>
         <artifactId>jackson-mapper-asl</artifactId>
         <version>1.9.13</version>
      </dependency>
      <dependency>
         <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-frontend-jaxrs</artifactId>
         <version>2.7.7</version>
      </dependency>
   </dependencies>
   <executions>
      <execution>
         <id>mule-deploy</id>
         <phase>install</phase>
         <goals>
            <goal>deploy</goal>
         </goals>
         <configuration>
            <muleApiUrl>${muleApiUrl}</muleApiUrl>
            <username>${username}</username>
            <password>${password}</password>
            <appDirectory>${project.basedir}/src/main/app</appDirectory>
            <finalName>${project.artifactId}-${project.version}</finalName>
            <version>${version}</version>
            <name>${name}</name>
            <deploymentName>${deploymentName}</deploymentName>
            <serverGroup>${serverGroup}</serverGroup>
         </configuration>
      </execution>
   </executions>
</plugin>

A: <dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.5.0</version>
</dependency>

The dependency is right.I think you should clean your project and build again.


text:
Q: Error running ':ConqueTerm bash' I have installed Conque with vundle using the following line:
Bundle 'Conque-Shell'

However, when I run :ConqueTerm bash I get the folowing error:
Error detected while processing function conque_term#open..conque_term#dependency_check..conque_term#load_python:
line    2:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/Users/snowch/.vim/bundle/Conque-Shell/autoload/conque_term/conque_globals.py'
line    3:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/Users/snowch/.vim/bundle/Conque-Shell/autoload/conque_term/conque.py'
line   10:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/Users/snowch/.vim/bundle/Conque-Shell/autoload/conque_term/conque_screen.py'
line   11:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/Users/snowch/.vim/bundle/Conque-Shell/autoload/conque_term/conque_subprocess.py'
An error occurred: bash

It looks as though conque hasn't fully installed because the files it is looking for don't exist:
snowch$ ls /Users/snowch/.vim/bundle/Conque-Shell/autoload/
conque_term.vim

Any ideas?

A: First issue in the github page is this. So, you need to use this fork:
Bundle 'lrvick/Conque-Shell'

A: In the end, I decided to install without vundle, but still automate the install using:
$ vim 'https://conque.googlecode.com/files/conque_2.3.vmb' -c ':so % | q'

See my other question and answer for more info.


text:
Q: Add Static route to Ubuntu on a Digital Ocean VPS I am trying to add a static route to a remote subnet from a digital ocean vps (ubuntu 14.08) but everytime i run the following command I get the error:
"RTNETLINK answers: Network is unreachable"

my public ip is X.X.X.X and the remote gateway and host is Y.Y.Y.Y and Z.Z.Z.Z respectively.
# ip route add Z.Z.Z.Z via Y.Y.Y.Y

I believe my VPS has a default route setup by digitalocean, but i have been able to setup a VPN network with the remote gateway already I just cannot ping the remote host Z.Z.Z.Z or telnet to a port. I confirmed the VPN is up.

A: I use the route command to add a static route to a specific host or network:
# route add -host <destination IP address> gw <gateway IP address>
# route add <destination IP address> gw <gateway IP address>

A: root@heisenberg:~# service ipsec status
IPsec running  - pluto pid: 1092
pluto pid 1092
1 tunnels up

root@heisenberg:~# ipsec auto status
ipsec auto: warning: obsolete command syntax used
000 using kernel interface: netkey
000 interface lo/lo ::1
000 interface lo/lo 127.0.0.1
000 interface lo/lo 127.0.0.1
000 interface eth0/eth0 104.131.13.155
000 interface eth0/eth0 104.131.13.155
000 %myid = (none)
000 debug none
000
000 virtual_private (%priv):
000 - allowed 6 subnets: 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 25.0.0.0/8, fd00::/8, fe80::/10
000 - disallowed 0 subnets:
000 WARNING: Disallowed subnets in virtual_private= is empty. If you have
000          private address space in internal use, it should be excluded!
000
000 algorithm ESP encrypt: id=2, name=ESP_DES, ivlen=8, keysizemin=64, keysizemax=64
000 algorithm ESP encrypt: id=3, name=ESP_3DES, ivlen=8, keysizemin=192, keysizemax=192
000 algorithm ESP encrypt: id=6, name=ESP_CAST, ivlen=8, keysizemin=40, keysizemax=128
000 algorithm ESP encrypt: id=7, name=ESP_BLOWFISH, ivlen=8, keysizemin=40, keysizemax=448
000 algorithm ESP encrypt: id=11, name=ESP_NULL, ivlen=0, keysizemin=0, keysizemax=0
000 algorithm ESP encrypt: id=12, name=ESP_AES, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=13, name=ESP_AES_CTR, ivlen=8, keysizemin=160, keysizemax=288
000 algorithm ESP encrypt: id=14, name=ESP_AES_CCM_A, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=15, name=ESP_AES_CCM_B, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=16, name=ESP_AES_CCM_C, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=18, name=ESP_AES_GCM_A, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=19, name=ESP_AES_GCM_B, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=20, name=ESP_AES_GCM_C, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=22, name=ESP_CAMELLIA, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=252, name=ESP_SERPENT, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=253, name=ESP_TWOFISH, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP auth attr: id=1, name=AUTH_ALGORITHM_HMAC_MD5, keysizemin=128, keysizemax=128
000 algorithm ESP auth attr: id=2, name=AUTH_ALGORITHM_HMAC_SHA1, keysizemin=160, keysizemax=160
000 algorithm ESP auth attr: id=5, name=AUTH_ALGORITHM_HMAC_SHA2_256, keysizemin=256, keysizemax=256
000 algorithm ESP auth attr: id=6, name=AUTH_ALGORITHM_HMAC_SHA2_384, keysizemin=384, keysizemax=384
000 algorithm ESP auth attr: id=7, name=AUTH_ALGORITHM_HMAC_SHA2_512, keysizemin=512, keysizemax=512
000 algorithm ESP auth attr: id=8, name=AUTH_ALGORITHM_HMAC_RIPEMD, keysizemin=160, keysizemax=160
000 algorithm ESP auth attr: id=9, name=AUTH_ALGORITHM_AES_CBC, keysizemin=128, keysizemax=128
000 algorithm ESP auth attr: id=251, name=AUTH_ALGORITHM_NULL_KAME, keysizemin=0, keysizemax=0
000
000 algorithm IKE encrypt: id=0, name=(null), blocksize=16, keydeflen=131
000 algorithm IKE encrypt: id=5, name=OAKLEY_3DES_CBC, blocksize=8, keydeflen=192
000 algorithm IKE encrypt: id=7, name=OAKLEY_AES_CBC, blocksize=16, keydeflen=128
000 algorithm IKE hash: id=1, name=OAKLEY_MD5, hashsize=16
000 algorithm IKE hash: id=2, name=OAKLEY_SHA1, hashsize=20
000 algorithm IKE hash: id=4, name=OAKLEY_SHA2_256, hashsize=32
000 algorithm IKE hash: id=6, name=OAKLEY_SHA2_512, hashsize=64
000 algorithm IKE dh group: id=2, name=OAKLEY_GROUP_MODP1024, bits=1024
000 algorithm IKE dh group: id=5, name=OAKLEY_GROUP_MODP1536, bits=1536
000 algorithm IKE dh group: id=14, name=OAKLEY_GROUP_MODP2048, bits=2048
000 algorithm IKE dh group: id=15, name=OAKLEY_GROUP_MODP3072, bits=3072
000 algorithm IKE dh group: id=16, name=OAKLEY_GROUP_MODP4096, bits=4096
000 algorithm IKE dh group: id=17, name=OAKLEY_GROUP_MODP6144, bits=6144
000 algorithm IKE dh group: id=18, name=OAKLEY_GROUP_MODP8192, bits=8192
000 algorithm IKE dh group: id=22, name=OAKLEY_GROUP_DH22, bits=1024
000 algorithm IKE dh group: id=23, name=OAKLEY_GROUP_DH23, bits=2048
000 algorithm IKE dh group: id=24, name=OAKLEY_GROUP_DH24, bits=2048
000
000 stats db_ops: {curr_cnt, total_cnt, maxsz} :context={0,5,64} trans={0,5,3072} attrs={0,5,2048}

000
   000 "globacom-vpn":  104.131.13.155/32===104.131.13.155<104.131.13.155>:17/1701---104.131.0.1...41.203.65.124<41.203.65.124>===10.100.108.0/24; erouted; eroute owner: #5
   000 "globacom-vpn":     myip=104.131.13.155; hisip=10.100.108.51;
   000 "globacom-vpn":   ike_life: 86400s; ipsec_life: 3600s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 3
   000 "globacom-vpn":   policy: PSK+ENCRYPT+TUNNEL+UP+IKEv2ALLOW+SAREFTRACK+lKOD+rKOD; prio: 32,24; interface: eth0;
   000 "globacom-vpn":   dpd: action:clear; delay:10; timeout:20;
   000 "globacom-vpn":   newest ISAKMP SA: #4; newest IPsec SA: #5;
   000 "globacom-vpn":   IKE algorithms wanted: AES_CBC(7)_256-SHA1(2)_000-MODP1536(5), AES_CBC(7)_256-SHA1(2)_000-MODP1024(2), AES_CBC(7)_128-SHA1(2)_000-MODP1536(5), AES_CBC(7)_128-SHA1(2)_000-MODP1024(2), 3DES_CBC(5)_000-SHA1(2)_000-MODP1536(5), 3DES_CBC(5)_000-SHA1(2)_000-MODP1024(2); flags=-strict
   000 "globacom-vpn":   IKE algorithms found:  AES_CBC(7)_256-SHA1(2)_160-MODP1536(5)AES_CBC(7)_256-SHA1(2)_160-MODP1024(2)AES_CBC(7)_128-SHA1(2)_160-MODP1536(5)AES_CBC(7)_128-SHA1(2)_160-MODP1024(2)3DES_CBC(5)_192-SHA1(2)_160-MODP1536(5)3DES_CBC(5)_192-SHA1(2)_160-MODP1024(2)
   000 "globacom-vpn":   IKE algorithm newest: 3DES_CBC_192-SHA1-MODP1024
   000 "globacom-vpn":   ESP algorithms wanted: AES(12)_256-SHA1(2)_000, AES(12)_128-SHA1(2)_000, 3DES(3)_000-SHA1(2)_000; flags=-strict
   000 "globacom-vpn":   ESP algorithms loaded: AES(12)_256-SHA1(2)_160, AES(12)_128-SHA1(2)_160, 3DES(3)_192-SHA1(2)_160
   000 "globacom-vpn":   ESP algorithm newest: 3DES_000-HMAC_SHA1; pfsgroup=
   000
   000 #5: "globacom-vpn":500 STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 2048s; newest IPSEC; eroute owner; isakmp#4; idle; import:admin initiate
   000 #5: "globacom-vpn" esp.5afe00ef@41.203.65.124 esp.c719225f@104.131.13.155 tun.0@41.203.65.124 tun.0@104.131.13.155 ref=0 refhim=4294901761
   000 #4: "globacom-vpn":500 STATE_MAIN_I4 (ISAKMP SA established);        EVENT_SA_REPLACE in 85210s; newest ISAKMP; lastdpd=10s(seq in:1782 out:0); idle;     import:admin initiate
   000


text:
Q: Static vs Instance method usage I have a class that has some methods, which I use in code. Their aim is to generate an object and return it for further usage. I can implement it in two ways. The first way - is to make it static, like this:
public static class Builder
{
    public static MyObject BuildMyObject(Settings myEnumSetting, int someParam)
    {
        //Building object
        return MyObject;
    }

    //Other methods
}

Other way - is to make it instance like this:
public class Builder
{
    public MyObject BuildMyObject(Settings myEnumSetting, int someParam)
    {
        //Building object
        return MyObject;
    }

    //Other methods
}

In the first way can create my objects like this:
MyObject obj = Builder.BuildMyObject(Settings.Worker,20);

In the second case I can use it like this:
MyObject obj = new Builder().BuildMyObject(Settings.Worker,20);

Which of these approaches it more efficient for usage?

A:
Which of these approaches it more efficient for usage?

It depends on your requirement, if the sole responsibility of your class is to create an object and return it then the first option with static class is better.

A: Using a static method is more simple. An instance method opens up for an inheritance hierarchy of builders, where you use some kind of dependency inject to select what builder to use.
If the static method works - use it for now. You can always convert the static method to a facade that hides the details of an hierarchy of inherited builder classes later.
By the way: I'd use the name Factory instead of Builder as this is an example of a factory method pattern implementation. Builder is another (more complex) pattern.

A: The concept you describe is called Factory Pattern.
Typically a builder does not use any instance members therefore it should be static.
Instances should be used when there is a cohesion of members (http://en.wikipedia.org/wiki/Cohesion_%28computer_science%29) e.g methods operating on the same set of instance variables (fields) belong together to an instance.

A: If this class just returns a new object then i'll think that the static way is the better one, because you are not storeing data in that class or something else.
So the static way is more efficient than the other. (I'll don't think that it would be useful to create 10 objects of this class for example)
Your class is a factory class / pattern

A: the advantage of a static (factory) class is, that you can keep track of the objects being created in some static property. Depending on your requirements, that might be very useful to have.


text:
Q: optimize jquery prev selector Is there a way to make the selector below better?
Without adding extra classes or id's?
Only select the first item-2 counted from item-5 downwards.
This works, but there has to be an easier way.
$first_previous = $($('li.item-5').prevAll('.item-2')[0]);

list item 1

Unkown number of item-2 will happen

Unkown number of item-2 will happen

list item 2 Only select this one, not the other #2

list item 3

list item 4

list item 5 Start here

it might even occur after the item-5

A: You could try :
$(this).siblings('.item-2').eq(1);

(Where $(this) is a jQuery object containing an element with a class of .item-5)
But you will want to use something like http://jsperf.com/ to find out which way is quicker !
Working example here
Update
Then try this :
$(this).siblings('.item-2').last();

Docs for .last()
OK ... then try :
$(this).prev('.item-2')

Uses.prev()
Update 2
Loop the items and get the first which will be the one you want :
$('.item-5').prevAll().each(function() {
    if ($(this).hasClass('item-2')) {
        alert($(this).text());
        return false; // break early
    }
});

Example here


text:
Q: Working IntelliJ Scala Plugin Tutorial? I'm having some trouble getting the scala plugin to work with IntelliJ IDEA 10.5.1 Community Edition on Mac OSX 10.6.8. I'm following these instructions but whenever I try to run the simple HelloWorld application, I get this error:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Didea.launcher.port=7533 -Didea.launcher.bin.path=/Applications/IntelliJ IDEA 10 CE.app/bin -Dfile.encoding=UTF-8 -classpath /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/dt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/javaws.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jconsole.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management-agent.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/sa-jdi.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/alt-rt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/alt-string.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/charsets.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/classes.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/apple_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/dnsns.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/localedata.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunjce_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunpkcs11.jar:/Users/A482930/IdeaProjects/ScalaPractice/out/production/ScalaPractice:/Users/A482930/scala/lib/scala-library.jar:/Users/A482930/scala/lib/scala-swing.jar:/Users/A482930/scala/lib/scala-dbc.jar:/Applications/IntelliJ IDEA 10 CE.app/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain HelloWorld
Exception in thread "main" java.lang.ClassNotFoundException: HelloWorld
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)

Process finished with exit code 1

I checked the module settings and the compiler library seems to be set up correctly. The version of scala I'm using is the 2.9.0.1 with the IzPack Installer. I've tried both the IDEA plugin listed under available plugins as well as the July 5 2011 nightly here.
Rather then helping me troubleshoot my specific issue, does anyone know of a step by step tutorial that actually works without issues for a configuration similar to mine? I'm ok with using older versions of scala and even IDEA as long as they work.

A: I'm not sure you still need help with this, but I just ran a simple example with Scala 2.9.0.1 and it worked. I've been having tons of issues with the plugin though, so I guess it would help to know the exact steps you followed.
In my case, I did this:

*

*Created Project

*Added Scala Facet in the Project Wizard and added the Scala libs as a global lib (there are a few issues with this, but it should work here)

*Create your HelloWorld example

*Create a new Scala Compilation Server Runner. Add the Classpath of your project

*Run the project

A: A colleague of mine created this some months ago, after having some issues getting started:
 https://github.com/runeflobakk/sbt-idea-scalatest
Guess it is more SBT focused, but maybe you can find some use in it anyway?


text:
Q: Stopping Dreamweaver from putting .GIT folder/files to my production server I'm in the process of teaching myself GIT and using my website to practice. Dreamweaver is my preferred IDE but when I 'PUT' the whole site to my production server it also 'PUT's all the files in the hidden .git directory. I know how to use cloaking for specific file types but is there a way for it to ignore that folder or is my only option to select specific files.

A: Yes, I need to improve my deploy process. But I was able to solve it by:
1. Unhide the .git folder
2. Use Dreamweavers cloaking function.
Maybe one day Adobe will include GITHUB integration.

A: To be a little more specific:
In Dreamweaver, make sure the Files panel is open for the site you are working on. Click the Refresh button (clockwise pointing arrow circle) to make sure your .git folder is displayed. Right-click on the .git folder. Choose Cloaking/Cloak. The folder icon for that folder will show a red slash through it.

A: Because you're already using git locally, you should set up a new remote on a server (with git init --bare) and push to that remote.
To create the link to that remote:
git remote add production user@server.com:pathtogit
To push to that remote
git push production master
You then should have a script that will automate your deployment when the remote receives some changes (using git hooks)
This answer is just the beginning of it, you should try to search a bit for yourself


text:
Q: Silverlight DomainCollectionView in VB.NET Anyone can share the code for the DomainCollectionView in VB.NET?
I have an error, Argument not specified for parameter 'op' of 'Private Sub OnLoadProductPMListCompleted(op As System.ServiceModel.DomainServices.Client.LoadOperation(Of ProductPM))'.
Public Sub New()
    InitializeComponent()
    Dim collectionViewLoader As DomainCollectionViewLoader(Of ProductPM)
    collectionViewLoader = New DomainCollectionViewLoader(Of ProductPM)(Function() Me.LoadProductPMList(), Me.OnLoadProductPMListCompleted)
    ProductCollectionView = New DomainCollectionView(collectionViewLoader, Products)
    ProductCollectionView.Refresh()
    Me.ProductListBox.ItemsSource = ProductCollectionView
End Sub

Public Function LoadProductPMList() As LoadOperation(Of ProductPM)
    Dim qry As EntityQuery(Of ProductPM) = context.GetProductsQuery

    Return context.Load(qry)
End Function

Private Sub OnLoadProductPMListCompleted(op As LoadOperation(Of ProductPM))

    If op.HasError = True Then

    ElseIf op.IsCanceled = False Then
        CType(Products, EntityList(Of ProductPM)).Source = op.Entities
    End If
End Sub

A: Sorry for the late reply, I have been busy.  I've corrected the code, as noted below:
Dim context As ProductPMContext
Dim productCollectionView As DomainCollectionView
Dim products As IEnumerable(Of ProductPM)

Public Sub New()
    InitializeComponent()

    context = New ProductPMContext()

    'You need to initialise the products collection
    products = New EntityList(Of ProductPM)(context.ProductPMs)

    Dim collectionViewLoader As DomainCollectionViewLoader(Of ProductPM)

    'Have fixed this line, using AddressOf
    collectionViewLoader = New DomainCollectionViewLoader(Of ProductPM)(AddressOf LoadProductPMList, AddressOf OnLoadProductPMListCompleted)

    productCollectionView = New DomainCollectionView(collectionViewLoader, products)
    productCollectionView.Refresh()

    ProductListBox.ItemsSource = productCollectionView
End Sub

Public Function LoadProductPMList() As LoadOperation(Of ProductPM)
    Return context.Load(context.GetProductsQuery)
End Function

Private Sub OnLoadProductPMListCompleted(ByVal op As LoadOperation(Of ProductPM))
    If op.HasError = True Then

    ElseIf op.IsCanceled = False Then
        CType(products, EntityList(Of ProductPM)).Source = op.Entities
    End If
End Sub

Hope this helps...
Chris


text:
Q: DropDownListFor with ViewBag getting null Controller:
using (ISession session = NHIbernateSession.OpenSession())
    {
      var item = session.Query<CarModel>().ToList();
      ViewBag.Modas = item;
      return View();
    }

View:

                @Html.LabelFor(model => model.Modelis.model_name, new { @class = "control-label col-md-2" })

                    @Html.DropDownListFor(model => model.Modelis.Id, new SelectList(ViewBag.Modas, "Id", "model_name"), "--Select Cars--")

Controller(submition part):
[HttpPost]
public ActionResult Create(Transport item)
{
    try
    {
        using (ISession session = NHIbernateSession.OpenSession())
        {
            using (ITransaction transaction = session.BeginTransaction())
            {
                session.Save(item);
                transaction.Commit();
            }
        }

        return RedirectToAction("Index");
    }
    catch (Exception exception)
    {
        return View();
    }
}

And I get error on submit:
Value cannot be null.
Parameter name: items
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: items
And I don't understand what is wrong

A: With reference to your submitted code, it seems you are using Strongly Typed View of MVC. In this case you should supply model to your view.
You are returning view without supplied or assigning a model. Hence your view has model as null. Please supply the model and check the execution.
using (ISession session = NHIbernateSession.OpenSession())
    {
      var item = session.Query<CarModel>().ToList();
      ViewBag.Modas = item;
      // Either set the model like .... ViewData.Model = new YOUR_MODEL_CLASS();
     // OR return your model by view constructor like.. return View(new YOUR_MODEL_CLASS());
      return View();
    }


text:
Q: How to use ext4 inline_data to store empty directories? How can I use ext4's inline_data feature to store empty directories?
It seems like inline_data works only with small files, or the directories store a lot of data.

A: You need e2fsprogs 1.43 or later, and you need to create a file system with the inline_data feature enabled, and inodes with at least 256 bytes:
mke2fs -t ext4 -O inline_data ...

(if mke2fs complains about the inodes being too small, add -I 256).
Directories will then use inline data transparently, as long as the data they need to store fits inside their inode. debugfs's stat command will show inode data which looks like
Inode: 12   Type: directory    Mode:  0755   Flags: 0x10000000
Generation: 3089239889    Version: 0x00000000:00000002
User:     0   Group:     0   Size: 60
File ACL: 0    Directory ACL: 0
Links: 3   Blockcount: 0
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x5bcb759e:a9872534 -- Sat Oct 20 20:36:14 2018
 atime: 0x5bcb759e:a9872534 -- Sat Oct 20 20:36:14 2018
 mtime: 0x5bcb759e:a9872534 -- Sat Oct 20 20:36:14 2018
crtime: 0x5bcb759e:a9872534 -- Sat Oct 20 20:36:14 2018
Size of extra inode fields: 32
Extended attributes:
  system.data (0)
Inode checksum: 0x68fa51fe
Size of inline data: 60

This is for a directory containing one other directory; as you can see, it stores 60 bytes of inline data and has no extent.


text:
Q: How to Separate Output Data Here is my code:
#-------------------------------------------------------------------------------
# Name:        Mocha Rotoscoping Via Blender
# Purpose:     Make rotoscoping more efficient
#
# Author:      Jeff Owens
#
# Created:     11/07/2011
# Copyright:   (c) jeff.owens 2011
# Licence:     Grasshorse
#-------------------------------------------------------------------------------
#!/usr/bin/env python
import sys
import os
import parser
sys.path.append('Z:\_protomotion\Prog\HelperScripts')
import GetDir
sys.path.append('Z:/Blender_Roto')
filename = 'diving_board.shape4ae'
infile = 'Z:/Blender_Roto/'
#import bpy
#from mathutils import Vector

#below are taken from mocha export
x_width =2048
y_height = 778
z_depth = 0
frame = 20

import re

data_directory = 'Z:/Blender_Roto/' # windows
data_file = 'diving_board.shape4ae'
fullpath = data_directory + data_file

print("====init=====")

file = open(fullpath)
for line in file:
current_line = line

# massive room for optimized code here.

# this assumes the last element of the line containing the words
# "Units Per Second" is the number we are looking for.
# this is a non float number, generally.
if current_line.find("Units Per Second") != -1:
    fps = line_split = float(current_line.split()[-1])
    print("Frames Per Second:", fps)

# source dimensions
if current_line.find("Source Width") != -1:
    source_width = line_split = int(current_line.split()[-1])
    print("Source Width:", source_width)

if current_line.find("Source Height") != -1:
    source_height = line_split = int(current_line.split()[-1])
    print("Source Height:", source_height)

# aspect ratios
if current_line.find("Source Pixel Aspect Ratio") != -1:
    source_px_aspect = line_split = int(current_line.split()[-1])
    print("Source Pixel Aspect Ratio:", source_px_aspect)

if current_line.find("Comp Pixel Aspect Ratio") != -1:
    comp_aspect = line_split = int(current_line.split()[-1])
    print("Comp Pixel Aspect Ratio:", comp_aspect)

# assumption, ae file can contain multiple mocha shapes.
# without knowing the exact format i will limit the script
# to deal with one mocha shape being animated N frames.

# this gathers the shape details, and frame number but does not
# include error checking yet.
if current_line.find("XSpline") != -1:

    # record the frame number.

    frame = re.search("\s*(\d*)\s*XSpline", current_line)
    if frame.group(1) != None:
        frame = frame.group(1)
        print("frame:", frame)

    # pick part the part of the line that deals with geometry
    match = re.search("XSpline\((.+)\)\n", current_line)

    line_to_strip = match.group(1)
    points = re.findall('(\(.*?\))', line_to_strip)
    print(len(points))
    for point in points:
        print(point)

 file.close()

here is the output:
====init=====
Frames Per Second: 24.0
Source Width: 2048
Source Height: 778
Source Pixel Aspect Ratio: 1
Comp Pixel Aspect Ratio: 1
frame: 20
5
(0.793803,0.136326,0,0.5,0)
(0.772345,0.642332,0,0.5,0)
(0.6436,0.597615,0,0.5,0)
(0.70082,0.143387,0,0.5,0.25)
(0.70082,0.112791,0,0.5,0)

I want to figure out how to call out individual points given. For example, how would I have the code just spit out 0.793803, or just spit out 0.136326, etc etc
ADDENDUM
So what I ended up doing was adding this
(point1, point2, point3, point4, point5) = points
print (point1)
#print (point2)
#print (point3)
#print (point4)
#print (point5)

which yielded:
(0.793803,0.136326,0,0.5,0)

But when I tried to parse again and I wrote
(x,y,z,w,s) = p

it came up with the error p is not defined
so then I tried
    (x,y,z,w,s) = point1
which yielded the error too many values to unpack.
Another thing I tried was
for point1 in points
    p1x = (x,)
print (p1x)

which just yielded the first ( rather than the whole X value...
Any solutions?
ADDENDUM PT 2
So what happens is this:
====init=====
Frames Per Second: 24.0
Source Width: 2048
Source Height: 778
Source Pixel Aspect Ratio: 1
Comp Pixel Aspect Ratio: 1
5
frame: 20
(0.793803,0.136326,0,0.5,0)
x: (, y: y0
x: (, y: y0
x: (, y: y0
x: (, y: y0
x: (, y: y0

when I input this
(point1, point2, point3, point4, point5) = points
print (point1)
#print (point2)
#print (point3)
#print (point4)
#print (point5)

for point in points:
    x, y, *data = point
    print(str.format("x: {0}, y: y{1}", x, y))

file.close()

I don't know why it is pulling (, from (0.793803,0.136326,0,0.5,0)
I can tell you that the program thinks that if I put x, y, z, w, s
I want x: '(' y: '0'  z: '.'  w: '7' s: '9'
which I don't,
I want:
x: 0.793803
y: 0.136326
z: 0
w: 0.5
s: 0
Sorry for all the questions, I really appreciate your help

A: The points are tuples, so it's rather simple.
You can unpack them first (where p is a point):
>>> x, y, *data = p
>>> x
0.793803
>>> y
0.136326
>>> data
[0, 0.5, 0]

Or you can index into them:
>>> p[0]
0.793803

Or you can go crazy with string formatting:
>>> str.format("x{0[0]} y{0[1]}", p)
'x0.793803 y0.136326'

Ok, maybe not that last one. I would unpack them first for readability.

My example in context:
for point in points:
    x, y, *data = point
    print(str.format("x: {0}, y: y{1}", x, y))

points is an "iterable" of tuples, each tuple representing a point on the spline, captured into the variable point.


text:
Q: Can't see "Fonts provided by application" in plist in Xcode 5 I am trying to add an external font to my iOS application.
I went to add an entry to the plist file, but when I checked, the section for "Fonts provided by application" isn't present.
Is this feature implemented differently in Xcode 5?
Cheers

A: You should add "Fonts provided by application" in the plist yourself, first by adding a new field, selecting the proper category and adding your font name.
Keep in mind that selection is case sensitive.
1.Create new list by pressing the + symbol

2.Type capital F


text:
Q: How to import module from current non-default directory I'm using Python 2.7. I'm rather new to the python langauge. I have two python modules - "Trailcrest.py" and "Glyph.py", both in the same folder, but not in the Python27 folder.
I need to import "Trailcrest.py" into "Glyph.py", but I am getting the message that "no such module exists".
Additionally, whatever means I use to import the module needs to not be dependent on a solid-state path. This program is cross-platform, and the path can be changed depending on the user's preferences. However, these two modules will always be in the same folder together.
How do I do this?

A: If you have Trailcrest.py and Glyph.py in the same folder, importing one into the other is as simple as:
import Trailcrest
import Glyph

If this does not work, there seems to be something wrong with your Python setup.  You might want to check what's in sys.path.
import sys
print sys.path

A: To elaborate a bit on Ferdinand Beyer's answer, sys.path is a list of file locations that the default module importer checks.  Some, though not all installations of python will add the current directory or the directory of the __main__ module to the path.  To make sure that the paths relative to a given module are importable in that module, do something like this:
import os.path, sys
sys.path.append(os.path.dirname(__file__))

But something like that shouldn't ever make it into a "production" product.  Instead, use something like distutils to install the module's package into the python site-packages directory.

A: This can also be achieved using the environment variable PYTHONPATH which also influences Python's search path. This can be done in a shell script so that the Python files do not need to be altered. If you want it to import from the current working directory use the . notation in bash:
export PYTHONPATH=.
python python_prog.py


text:
Q: Counting for specific characters in a row - SQL I'm looking to see if it's possible to only display results with multiple instances of a single character.  For instance, if I wanted to only show rows that have the "," character in it more than 6 times.
Example:  I, am, trying, to, figure, out, this, query
Would show in the results, but any row with less than 6 ","'s wouldn't show.

A: Here's a way using length and replace to show strings that have , 6 or more times:
select * from mytable where length(mycolumn) - length(replace(mycolumn, ",", "")) >= 6

A: One method uses like:
select t.*
from t
where col like '%,%,%,%,%,%,%';

This should work in any database.


text:
Q: QT5.2.0; Debian Wheezy: QSocketNotifier::type() segfault I have a multithreaded app that uses QThreadPool.  It crashes after a random amount of time (sometimes minutes, sometimes hours...) with a segfault.  I recompiled with debugging symbols and ran through GDB.  Here's the backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7231170 in QSocketNotifier::type() const ()
   from /opt/Qt/5.2.0/gcc_64/lib/libQt5Core.so.5
(gdb) where
#0  0x00007ffff7231170 in QSocketNotifier::type() const ()
   from /opt/Qt/5.2.0/gcc_64/lib/libQt5Core.so.5
#1  0x00007ffff724b732 in ?? () from /opt/Qt/5.2.0/gcc_64/lib/libQt5Core.so.5
#2  0x00007ffff51d713b in g_main_context_check ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff51d75c2 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff51d7744 in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff724c023 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/Qt/5.2.0/gcc_64/lib/libQt5Core.so.5
#6  0x00007ffff71fa2cb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/Qt/5.2.0/gcc_64/lib/libQt5Core.so.5
#7  0x00007ffff71fe33e in QCoreApplication::exec() ()
   from /opt/Qt/5.2.0/gcc_64/lib/libQt5Core.so.5
#8  0x0000000000409bb9 in main (argc=1, argv=<optimized out>) at main.cpp:166

That's the complete backtrace.  It references/mentions basically no code within the app itself; it all appears to be Qt library code causing the fault.   Not sure what source from the app itself to include in this post since GDB does not reference anything within the app itself.  Any ideas?


text:
Q: Intersection of two 4D hyperspheres In 3D, consider a large sphere (radius $d$) with a smaller sphere (radius $r$) centered on the
large sphere's surface.  It's surprising that the large sphere's surface covered by the small
sphere has area $\pi r^2$, exactly, regardless of $d$.
In 2D, there is no simple relationship like this.  The large circle's covered arc length
is $2d\cdot\sin^{-1}{(r/d\cdot\sqrt{(1-r^2/4/d^2)})}$.
What about 4D?  To reiterate, I'd like to know the "3D surface area" covered on a large
sphere by a smaller sphere (centered on the large sphere's surface).  If there is no simple
analytic form, I'd like a first-order correction to the large $d$ limit of $4\pi r^3/3$
(of the large sphere's total $2\pi^2d^3$ surface area).


text:
Q: Creating a pandas dataframe from an unknown number of lists of columns I have limited my requirements to 5 columns and 3 rows for easy explanation. My column header will come to string and my rows will come to a string. I want all the rows to be added to a dataframe. Here is what I have tried
import pandas as pd

Column_Header = "Col1,Col2,Col3,Col4,Col5" # We have upto 500 columns
df = pd.DataFrame(columns=Column_Header.split(","))

#we will get upto 100000 rows from a server response
Row1 = "Val11,Val12,Val13,Val14,Val15"
Row2 = "Val21,Val22,Val23,Val124,Val25"
Row3 = "Val31,Val32,Val33,Val34,Val35"
df_temp = pd.DataFrame(data = Row1.split(",") , columns = Column_Header.split(","))
pd.concat(df,df_temp)
print(pd)

A: The best and fastest is create list of all data by list comprehension and call DataFrame constructor only once:
Column_Header = "Col1,Col2,Col3,Col4,Col5"
Row1 = "Val11,Val12,Val13,Val14,Val15"
Row2 = "Val21,Val22,Val23,Val124,Val25"
Row3 = "Val31,Val32,Val33,Val34,Val35"

rows = [Row1,Row2,Row3]
L = [x.split(',') for x in rows]

print (L)
[['Val11', 'Val12', 'Val13', 'Val14', 'Val15'],
 ['Val21', 'Val22', 'Val23', 'Val124', 'Val25'],
 ['Val31', 'Val32', 'Val33', 'Val34', 'Val35']]

df = pd.DataFrame(data = L , columns = Column_Header.split(","))
print (df)
    Col1   Col2   Col3    Col4   Col5
0  Val11  Val12  Val13   Val14  Val15
1  Val21  Val22  Val23  Val124  Val25
2  Val31  Val32  Val33   Val34  Val35

A: If this is a viable option, it would be simpler to leave all the data munging to pd.read_csv. Convert all your strings to a single multiline string, and pass it through a StringIO buffer to read_csv.
import io
data = '\n'.join([Column_Header, Row1, Row2, Row3])
df = pd.read_csv(io.StringIO(data))
df

    Col1   Col2   Col3    Col4   Col5
0  Val11  Val12  Val13   Val14  Val15
1  Val21  Val22  Val23  Val124  Val25
2  Val31  Val32  Val33   Val34  Val35

If you're on python2.x, the io module is available as the cStringIO module, so you'd have to import it as:
import cStringIO as io


text:
Q: Windows 7 Embedded always runs explorer.exe on boot despite registry being set to run nothing I have my value of Shell in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon set as completely blank, but explorer.exe still runs on boot.
Why would this be?

A: The reason why explorer.exe always runs is because Microsoft has gone out of their way to make sure that a shell runs.  The reason they do this is because a shell provides for the presentation layer (OSI layer 7) of the Windows GUI.  You need to have a shell program if you are going to see a desktop.  If you boot into safe mode with a command prompt explorer probably isn't running then.
There are alternative shell programs you can use instead of explorer.exe, but you must run something.
It is worth mentioning that explorer is not Internet Explorer.  That executable is iexplore.exe.

A: Recently i put a value for a not installed shell in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.
Result was a blank black screen where only CTRL-ALT_DEL is possible.
So i can confirm that you are modifiying the correct key. But i didnt try an empty value.
Are you using the 64bit version of WES7 ?
Sometimes i am accidentally using the 32bit version of regedit and are wondering why my modifications for keys are not working.
Maybe this was your problem too ?

A: You can us a program like AutoRuns to determine where explorer.exe is starting from, provided that you can run it since it is an embedded system.
You can uncheck the explorer.exe entry from within AutoRuns to disable it from starting.
This utility, which has the most comprehensive knowledge of auto-starting locations of any startup monitor, shows you what programs are configured to run during system bootup or login.


text:
Q: Add nf-if condition for custom directive property Below is the example of my custom directives

    <ind-table tmodel="choosenInfo.section1.src" ttype="{{activitedTab}}" clickaction="popup"></ind-table>

How can i put a condition for the property clickaction so that this property could be included only if the value of scope variable contentLength is true. I tried below way.

    <ind-table tmodel="choosenInfo.section1.src" ttype="{{activitedTab}}" ng-if="contentLength" clickaction="popup"></ind-table>

But if the value of contentLength become false then entire section is not displayed. I just want to exclude clickaction property if the value of contentLength is false.

A: Remove the ng-if condition from the custom directive and use the ternary operator as-
clickaction="contentLength > 0 ? popup : '' "


text:
Q: Performing Damage Control on Code Samples for an Interview? While interviewing for a company, I was asked to submit several code samples that highlight my "best" work. I was pinged back with several questions regarding a specific code sample, one of which alluded to a bug.
The code sample was a WCF Web service that uses AES to encrypt an opaque blob. The blob is used by the service to identify all resources for a specific service request. The bug was that the .NET RijndaelManaged class was used with CBC mode, without properly setting the IV. The RijndaelManaged class will autogenerate an appropriate IV during class instantiation, which in the code sample, occurs during first usage of encryption, and is persisted for the life of the ASP .NET Application. Since ASP.NET applications can be restarted for a variety of reasons, it's possible that a these opaque blobs would be "invalidated" from one service call to the next because of a new IV value generated during App startup (the bug).
The question itself was "where is IV set for decryption?"
My response is already to admit that this is a bug; but since they asked for my "best" work, am I SOL on this position for having submitted a sample with a bug? Is there more I can say?
I'm hesitant to outline the situation because I don't want to seem like I'm making an excuse, but the encryption code was turned off while our service was in pre-alpha, and the project was killed before we ever went into production.

A: Everyone writes bugs. Part of your job as a programmer is how you deal with those bugs. I would try outlining the situation, fixing the bug, and resubmitting your code, just like you would at the job. After that, it depends on the company and how they make their hiring decisions. If it were me, however, and you showed initiative and took responsibility by following up on and fixing the bug, I don't know if it would be a deal breaker. In fact, it could turn a negative into a positive.

A: I would basically just state exactly what you said here. Stating your understanding of the bug, why it's a bug, what its effects would be, and its solution is the best way to reassert your competence as a programmer.


text:
Q: Remove all text in between a div without losing text outside of it - jQuery JS I have some text that is stored in a variable like this:

text inside div

outside text here.

I want to remove the entire div and the text in it and save the outside text.

A: Create an element based off the HTML.  Then,
$('.foo', context).remove();

For example:
var text = "
text inside div
\noutside text here.";
var xml = $('<root>' + text + '</root>');
$('.foo', xml).remove();
text = xml.html();

A: You can use after, to insert the inner text after the div, and then remove it:
var $foo = $(".foo");
$foo.after($foo.text()).remove();

Or you could use the replaceWith function, to replace the div element with its inner text content:
$foo.replaceWith($foo.text());


text:
Q: What's the easiest method of changing the drive letter of the active/boot drive in Win 7? I recently bought an SSD to accompany my HDD, and installed a fresh copy of Windows 7 onto it. I then used Drive Manager to change the drive letter of my HDD from C: to E:.
Trouble is, I now have windows installed on my SSD, which is drive letter D:. In order to boot up my computer, I have to go through Windows Boot Manager every time to choose the correct windows installation. I tried changing the boot priority from my HDD to my SSD in my bios, but it didn't boot properly probably because I don't have a C: drive. So that's what I'm trying to do now.
I currently have a win 7 install disc on hand, and I know that I could easily just reinstall windows and change the drive letter in the process, but i've already done it twice for other reasons and I don't want to worry about losing any more files that i've forgotten about and reinstalling programs that don't come with ninite. Is there an easier way of changing my drive letter?

A: So, from the current Windows location (the Windows installation that really works), go to start -> type msconfig.exe -> press Enter. Click Yes if UAC prompts. Go to Boot tab. You can find a list of Windows boot entry, the same as you see during boot. Select the one that works and click on Select as default. Then click on Apply and then Ok. Restart the PC to check.