问:
How can i add an extra column to an existing table which has data without losing it
I am using Laravel 5.5 and i would like to add an extra column to an existing table called users.

The problem is that php artisan migrate doesn't add the extra column.

1) Is it possible since table is not empty?

2) Why the below code block doesn't work?

By running php artisan make:migration update_users_column --table=users a file is created :

```<code>use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class UpdateUsersColumn extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->boolean('email_sent_to_user', true);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::table('users', function (Blueprint $table) {
//            //
//        });
    }
}
</code>```

After running php artisan migrate the migrations table is updated but users table is not updated.

答: The code block is working alright. The problem was with the procedure of transfering files from my local computer to the server(not correct permissions so the file was not actually uploaded after my edits).</p>

Body:
I am using Laravel 5.5 and i would like to add an extra column to an existing table called users.

The problem is that php artisan migrate doesn't add the extra column.

1) Is it possible since table is not empty?

2) Why the below code block doesn't work?

By running php artisan make:migration update_users_column --table=users a file is created :

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class UpdateUsersColumn extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->boolean('email_sent_to_user', true);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::table('users', function (Blueprint $table) {
//            //
//        });
    }
}

After running php artisan migrate the migrations table is updated but users table is not updated.


来源: stackexchange

问:
Advanced Excel Sumif (may require VBA)
I have a list of grocery orders where I am trying to sum up the total avocado purchases only for grocery orders where limes are also purchased. I know this is possible with pivot tables and helper columns, but is there a clean, repeatable formula or VBA to solve this problem?

The spreadsheet below shows an example of what I am trying to do, and I want the green cells summed up ideally without creating a helper column as I need to repeat the process many times.

答:
=SUMPRODUCT(E5:E15*((B5:B15)="Avocado")*(ISNUMBER(MATCH((A5:A15)&"Lime",(A5:A15)&(B5:B15),0))))

Sums the range with totals and multplies by two Booleans (True=1,False=0). First is if the row is Avocado and the other is if the Bill # concatenated with Limes can be found using MATCH().

If both of these equate to true then you get VALUE * 1 * 1 to sum which is the result you want.

If either is false you instead get VALUE * 0 * 1 which will give 0 for either result.

ContentLicense: CC BY-SA 3.0

Title: Advanced Excel Sumif (may require VBA)


问:
how to get openseamarks_data ( bouys,beacons,fisheries,oil rigs,harbours etc) to render in geoserver?
I have been trying to render and display seamarks in any format in geoserver, but have not been able to get the source data to upload.I have browsed into websites like Mapzen,Geofabrick,Gebco ,openstreetmaps etc.The site that helped me was https://extract.bbbike.org/ , http://wiki.openstreetmap.org/wiki/Seamarks/Seamark_Objects and http://www.openseamap.org/index.php?id=kartendownload&L=1,but I am unable to download source data for seamarks like bouys,beacons,ports etc to render in Geoserver.
Would anyone help me out in showing where would I get the data with these seamaks attributes in it?
particularly around INDIAN waters (Arabian sea,Indian Ocean & Bay Of Bengal)</p>

答:
Either download raw OSM data and filter it, e.g. using osmium-tool. Or use Overpass API to download only seamarks. Either way, you have to search for the seamark:type tag.

Here is an example at overpass turbo (a frontend for Overpass API).


问:
Calculate percentage of a grouping column in SSRS
Calculate percentage of  "TotalFound, NotFound"
I need to calculate the percentage of the subgroup "compare".

答:
I found an answer for the (unclear) question I've tried ask above. SSRS calculates percentage group only when you total column is inside the same group. This way you can call the total as an expression in your percentage column to do calculate %. But if the Percentage is outside your X/Y group you need to mention the group name like =((Fields!Total.Value,"X")*100/sum(Fields!Total.Value,"X"))&"%"

Thanks,
Kavin


问:
I have arrays stored in a json object, I send them using ajax call to the server side, how to access the data?

```<code>$scope.addQunatity = function(){

    var url="../php/mainPageFacture.php";

    // store data from user in the js arrays
    var quan_cls_crt=[$("#quan_cls_crt").val(),$("#quan_cls_crt2").val()];
    var quan_piece=[$("#quan_piece").val(),$("#quan_piece2").val()];
    var itemName=[$("#designList").val(),$("#designList2").val()];
    var dechargementNote=[$("#dechargementNote").val(),$("#dechargementNote2").val()];
    var itemIds=[78,75];

    var func="addQunatity";

    var data = {"function": func,
                "quan_cls_crt":quan_cls_crt,
                "itemId":itemIds,
                "dechargementNote":dechargementNote,
                "quan_piece":quan_piece};
    data = JSON.stringify(data);

    var options = {
            type : "get",
            url : url,
            data: {data:data},
            dataType: 'json',
            async : false,
            cache : false,
            success : function(response,status) {
                debugger;
                $scope.getAllItemNames();
                alert("success");
            },
            error:function(request,response,error){
                alert("Error: " + error + ". Please contact developer");
            }
        };
        $.ajax(options);
    }
</code>```

Here is my php code that will receive the Json object

```<code>           function addQunatity(){
              $quan_cls_crt = $_GET["quan_cls_crt"];
              $quan_piece = $_GET["quan_piece"];
              $itemId=$_GET['itemId'];
              $dechargementNote=$_GET['dechargementNote'];
            }
</code>```

I expect to receive the json arrays and store them in php variable in order to use the in the query later on, but i have no idea how to access the arrays in the json object

答:
You don't have to stringify the data, just send it as it is - the json data type causes jQuery to JSON-encode it for you. Don't make another object.

```<code>var data = {"function": func,
            "quan_cls_crt":quan_cls_crt,
            "itemId":itemIds,
            "dechargementNote":dechargementNote,
            "quan_piece":quan_piece};

var options = {
        type : "get",
        url : url,
        data: data,
        dataType: 'json',
        async : false,
        cache : false,
        success : function(response,status) {
            debugger;
            $scope.getAllItemNames();
            alert("success");
        },
        error:function(request,response,error){
            alert("Error: " + error + ". Please contact developer");
        }
    };
    $.ajax(options);
}
</code>```

Body:
$scope.addQunatity = function(){

    var url="../php/mainPageFacture.php";

    // store data from user in the js arrays
    var quan_cls_crt=[$("#quan_cls_crt").val(),$("#quan_cls_crt2").val()];
    var quan_piece=[$("#quan_piece").val(),$("#quan_piece2").val()];
    var itemName=[$("#designList").val(),$("#designList2").val()];
    var dechargementNote=[$("#dechargementNote").val(),$("#dechargementNote2").val()];
    var itemIds=[78,75];

    var func="addQunatity";

    var data = {"function": func,
                "quan_cls_crt":quan_cls_crt,
                "itemId":itemIds,
                "dechargementNote":dechargementNote,
                "quan_piece":quan_piece};
    data = JSON.stringify(data);

    var options = {
            type : "get",
            url : url,
            data: {data:data},
            dataType: 'json',
            async : false,
            cache : false,
            success : function(response,status) {
                debugger;
                $scope.getAllItemNames();
                alert("success");
            },
            error:function(request,response,error){
                alert("Error: " + error + ". Please contact developer");
            }
        };
        $.ajax(options);
    }

Here is my php code that will receive the Json object

           function addQunatity(){
              $quan_cls_crt = $_GET["quan_cls_crt"];
              $quan_piece = $_GET["quan_piece"];
              $itemId=$_GET['itemId'];
              $dechargementNote=$_GET['dechargementNote'];
            }

I expect to receive the json arrays and store them in php variable in order to use the in the query later on, but i have no idea how to access the arrays in the json object

Body:
You don't have to stringify the data, just send it as it is - the json data type causes jQuery to JSON-encode it for you. Don't make another object.

var data = {"function": func,
            "quan_cls_crt":quan_cls_crt,
            "itemId":itemIds,
            "dechargementNote":dechargementNote,
            "quan_piece":quan_piece};

var options = {
        type : "get",
        url : url,
        data: data,
        dataType: 'json',
        async : false,
        cache : false,
        success : function(response,status) {
            debugger;
            $scope.getAllItemNames();
            alert("success");
        },
        error:function(request,response,error){
            alert("Error: " + error + ". Please contact developer");
        }
    };
    $.ajax(options);
}


问:
How to set nodes layouts in AsyncDisplayKit
I am trying to set layouts for the nodes in AsyncDisplayKit for a userProfile setting but not getting the desired result.

I have a userProfile image

userName label

setting button

posts, comments and likes button
I want to set all the nodes in horizontal and vertical alignment

Here is my code in layoutSpecThatFits method

```<code>override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {

    photoNode.style.preferredSize = CGSize(width: ImageSize, height: ImageSize)
    settingButton.style.preferredSize = CGSize(width: 100, height: 50)
    label.style.preferredSize = CGSize(width: 100, height: 50)
    editbutton.style.preferredSize = CGSize(width: 120, height: 40)

    settingButton.style.alignSelf = .stretch
    let layout = ASStackLayoutSpec.horizontal()
    layout.alignItems = .center
    layout.justifyContent = .spaceAround
    layout.spacing = 10

    layout.children = [photoNode,settingButton]
   let settingButtonStackLocation = ASStackLayoutSpec(direction: .vertical,
                                        spacing: 15,
                                        justifyContent: .center,
                                        alignItems: .center,
                                        children: [layout,label,editbutton])
    settingButtonStackLocation.style.flexShrink = 1.0
    settingButtonStackLocation.style.flexGrow = 1.0

  let insets = UIEdgeInsets(top: 50, left: 30, bottom: 0, right: 30)
    let inset =  ASInsetLayoutSpec(insets: insets, child: settingButtonStackLocation)

    let horizontalButtonsStack = ASStackLayoutSpec.horizontal()
    horizontalButtonsStack.children = [postsButton,bucketButton,likesButton]
    horizontalButtonsStack.spacing = 20
    let verticalStack = ASStackLayoutSpec.vertical()
    verticalStack.children = [inset,horizontalButtonsStack]
    verticalStack.spacing = 10
    let buttonInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
    let buttonWithInsets = ASInsetLayoutSpec(insets: buttonInsets, child: verticalStack)

    let horizontalFollowersStack = ASStackLayoutSpec.horizontal()
    horizontalFollowersStack.children = [followersButton,followingButton]
    horizontalFollowersStack.spacing = 10
    let verticalFollowers = ASStackLayoutSpec.vertical()
    verticalFollowers.children = [buttonWithInsets,horizontalFollowersStack]
    verticalFollowers.spacing = 10
    verticalFollowers.alignItems = .center

    let followersInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
    let followersWithInsets = ASInsetLayoutSpec(insets: followersInsets, child: verticalFollowers)

    return followersWithInsets
 }
</code>```

答:
I think i found solution for you:

```<code>    [containerViewNode setLayoutSpecBlock:^ASLayoutSpec *(__kindof ASDisplayNode *node, ASSizeRange constrainedSize) {
        avatarImage.style.preferredSize = CGSizeMake(35, 35);
        settingsIcon.style.preferredSize = CGSizeMake(15, 15);
        ASCenterLayoutSpec *avatarCenterSpec = [[ASCenterLayoutSpec alloc] initWithHorizontalPosition:ASRelativeLayoutSpecPositionCenter verticalPosition:ASRelativeLayoutSpecPositionCenter sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:avatarImage];
        avatarCenterSpec.style.flexBasis = ASDimensionMakeWithPoints(100);
        ASRelativeLayoutSpec *gearSpec = [[ASRelativeLayoutSpec alloc] initWithHorizontalPosition:ASRelativeLayoutSpecPositionEnd verticalPosition:ASRelativeLayoutSpecPositionStart sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:settingsIcon];
        ASOverlayLayoutSpec *overlayLayoutSpec = [ASOverlayLayoutSpec overlayLayoutSpecWithChild:avatarCenterSpec overlay:gearSpec];
        ASStackLayoutSpec *mainSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical spacing:0 justifyContent:ASStackLayoutJustifyContentCenter alignItems:ASStackLayoutAlignItemsStretch children:@[overlayLayoutSpec, textNodeStub]];
        return mainSpec;
    }];
</code>```

Look at on ASOverlayLayoutSpec how it works with ASRelativeLayoutSpec. Example project i share on github.

Body:
I am trying to set layouts for the nodes in AsyncDisplayKit for a userProfile setting but not getting the desired result.

I have a userProfile image

userName label

setting button

posts, comments and likes button
I want to set all the nodes in horizontal and vertical alignment

Here is my code in layoutSpecThatFits method

override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {

    photoNode.style.preferredSize = CGSize(width: ImageSize, height: ImageSize)
    settingButton.style.preferredSize = CGSize(width: 100, height: 50)
    label.style.preferredSize = CGSize(width: 100, height: 50)
    editbutton.style.preferredSize = CGSize(width: 120, height: 40)

    settingButton.style.alignSelf = .stretch
    let layout = ASStackLayoutSpec.horizontal()
    layout.alignItems = .center
    layout.justifyContent = .spaceAround
    layout.spacing = 10

    layout.children = [photoNode,settingButton]
   let settingButtonStackLocation = ASStackLayoutSpec(direction: .vertical,
                                        spacing: 15,
                                        justifyContent: .center,
                                        alignItems: .center,
                                        children: [layout,label,editbutton])
    settingButtonStackLocation.style.flexShrink = 1.0
    settingButtonStackLocation.style.flexGrow = 1.0

  let insets = UIEdgeInsets(top: 50, left: 30, bottom: 0, right: 30)
    let inset =  ASInsetLayoutSpec(insets: insets, child: settingButtonStackLocation)

    let horizontalButtonsStack = ASStackLayoutSpec.horizontal()
    horizontalButtonsStack.children = [postsButton,bucketButton,likesButton]
    horizontalButtonsStack.spacing = 20
    let verticalStack = ASStackLayoutSpec.vertical()
    verticalStack.children = [inset,horizontalButtonsStack]
    verticalStack.spacing = 10
    let buttonInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
    let buttonWithInsets = ASInsetLayoutSpec(insets: buttonInsets, child: verticalStack)

    let horizontalFollowersStack = ASStackLayoutSpec.horizontal()
    horizontalFollowersStack.children = [followersButton,followingButton]
    horizontalFollowersStack.spacing = 10
    let verticalFollowers = ASStackLayoutSpec.vertical()
    verticalFollowers.children = [buttonWithInsets,horizontalFollowersStack]
    verticalFollowers.spacing = 10
    verticalFollowers.alignItems = .center

    let followersInsets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
    let followersWithInsets = ASInsetLayoutSpec(insets: followersInsets, child: verticalFollowers)

    return followersWithInsets
 }

Body:
I think i found solution for you:

    [containerViewNode setLayoutSpecBlock:^ASLayoutSpec *(__kindof ASDisplayNode *node, ASSizeRange constrainedSize) {
        avatarImage.style.preferredSize = CGSizeMake(35, 35);
        settingsIcon.style.preferredSize = CGSizeMake(15, 15);
        ASCenterLayoutSpec *avatarCenterSpec = [[ASCenterLayoutSpec alloc] initWithHorizontalPosition:ASRelativeLayoutSpecPositionCenter verticalPosition:ASRelativeLayoutSpecPositionCenter sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:avatarImage];
        avatarCenterSpec.style.flexBasis = ASDimensionMakeWithPoints(100);
        ASRelativeLayoutSpec *gearSpec = [[ASRelativeLayoutSpec alloc] initWithHorizontalPosition:ASRelativeLayoutSpecPositionEnd verticalPosition:ASRelativeLayoutSpecPositionStart sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:settingsIcon];
        ASOverlayLayoutSpec *overlayLayoutSpec = [ASOverlayLayoutSpec overlayLayoutSpecWithChild:avatarCenterSpec overlay:gearSpec];
        ASStackLayoutSpec *mainSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical spacing:0 justifyContent:ASStackLayoutJustifyContentCenter alignItems:ASStackLayoutAlignItemsStretch children:@[overlayLayoutSpec, textNodeStub]];
        return mainSpec;
    }];

Look at on ASOverlayLayoutSpec how it works with ASRelativeLayoutSpec. Example project i share on github.


问:
Truncate Text using ellipsis keeping the caret always at the end
I want to make this button text to truncate without hiding the caret.

When text is long it hides the caret.
I want to keep the caret at the end and truncate the text only.

This is my code

     Sample Text

.btn-default {
    background-color: #F0F0F0;
    border-color: #cccccc;
    max-width: 16em;
    overflow: hidden;
    text-overflow: ellipsis;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<button id="L1.900Level" class="btn btn btn-default dropdown-toggle dropdown-toggle btn-xl-toggle" type="button" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true"><span> short text </span><span class="caret"></span></button>

<button id="L1.900Level" class="btn btn btn-default dropdown-toggle dropdown-toggle btn-xl-toggle" type="button" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true"><span> loooooooooooooooooooooooong text </span><span class="caret"></span></button></code>```

答:
@NOTE this solution is for bootstrap 4 where icon is not added by .caret but from :after selector nonetheless same logic may work on older versions as well.
For this to work you need an additional span tag.

HTML

```<code><button class="btn w-100 dropdown-toggle">
    <span>Alle Termine</span>
</button>
</code>```

CSS

```<code>.dropdown-toggle {
    span {
           white-space: nowrap;
           text-overflow: ellipsis;
           overflow: hidden;
           display: inline-block;
           max-width: calc(100% - 5px); // prevents icon from touching right border
           vertical-align: middle;
     }
}
</code>```

Notice button should have a certain width. In my case button gets 100% width of the parent container but you may have another width in your case.

This worked well on my end. I hope it helps other people as well!

Body:
I want to make this button text to truncate without hiding the caret.

When text is long it hides the caret.
I want to keep the caret at the end and truncate the text only.

This is my code

     Sample Text

.btn-default {
    background-color: #F0F0F0;
    border-color: #cccccc;
    max-width: 16em;
    overflow: hidden;
    text-overflow: ellipsis;
}

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<button id="L1.900Level" class="btn btn btn-default dropdown-toggle dropdown-toggle btn-xl-toggle" type="button" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true"> short text </button>

<button id="L1.900Level" class="btn btn btn-default dropdown-toggle dropdown-toggle btn-xl-toggle" type="button" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true"> loooooooooooooooooooooooong text </button>

Body:
@NOTE this solution is for bootstrap 4 where icon is not added by .caret but from :after selector nonetheless same logic may work on older versions as well.
For this to work you need an additional span tag.

HTML

<button class="btn w-100 dropdown-toggle">
    <span>Alle Termine</span>
</button>

CSS

.dropdown-toggle {
    span {
           white-space: nowrap;
           text-overflow: ellipsis;
           overflow: hidden;
           display: inline-block;
           max-width: calc(100% - 5px); // prevents icon from touching right border
           vertical-align: middle;
     }
}

Notice button should have a certain width. In my case button gets 100% width of the parent container but you may have another width in your case.

This worked well on my end. I hope it helps other people as well!


问:
Is it possible to call an Objective-C function that returns a value to javascript?
I'd like to use JavaScriptCore / JSContext in an iOS Objective-C webview app to return a value to a javascript function.

For example, in javascript: var retVal = myObjC.returnSomething();

where returnSomething is the Objective-C function. For sake of discussion let's say it returns a string to the javascript function.

I've been able to call Objective-C functions that don't return a value, but haven't been able to find anything that describes how to return a value.

Is this even possible with JavaScriptCore, or am I taking the wrong approach to this? I need the javascript to wait for the return value (synchronous).

答:
As you are expecting, passing data from obj C to JS use stringByEvaluatingJavaScriptFromString  / passing data from JS to Obj C use JSContext

```<code><!-- save as .html and load into UIWebview -->

    <!DOCTYPE html>
    <html>
    <head>
    <script>
    function loadData(x){
    alert(x);
    }
    function myMeg(){
    passDatatoObjC("success");
    }
    </script>
    </head>
    </html>

    function returnSomething(x){
    loadData(x);
    }

    function passDatatoObjC(x){
    passDatatoObjC(x);
    }

    #pragma mark - UIWebview dataource

    -(void)webViewDidFinishLoad:(UIWebView *)webView{

      [self.svgWebMapView   stringByEvaluatingJavaScriptFromString:@"returnSomething(10)"];

      JSContext *context =  [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
    context[@"passDatatoObjC"] = ^(NSString *msg) {
    NSLog(@"%@",msg);

    });
    }
</code>```

Body:
As you are expecting, passing data from obj C to JS use stringByEvaluatingJavaScriptFromString  / passing data from JS to Obj C use JSContext

<!-- save as .html and load into UIWebview -->

    <!DOCTYPE html>
    <html>
    <head>
    <script>
    function loadData(x){
    alert(x);
    }
    function myMeg(){
    passDatatoObjC("success");
    }
    </script>
    </head>
    </html>

    function returnSomething(x){
    loadData(x);
    }

    function passDatatoObjC(x){
    passDatatoObjC(x);
    }

    #pragma mark - UIWebview dataource

    -(void)webViewDidFinishLoad:(UIWebView *)webView{

      [self.svgWebMapView   stringByEvaluatingJavaScriptFromString:@"returnSomething(10)"];

      JSContext *context =  [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
    context[@"passDatatoObjC"] = ^(NSString *msg) {
    NSLog(@"%@",msg);

    });
    }


问:
Drupal 7 db_set_active() in mymodule_init()?
I am trying to change which DB connection to used based on several conditions inside a custom module hook, aptly named mymodule_init()

hook_init() seemed a logical place to put this functionality because it's called so early in the bootstrap game, before any DB queries???

So I have several connections in a pool and which one is used is determined by the module. For the life of I can't get the system to persist the DB - seems to be resetting itself back to 'default' after this hook is executed. Searching the codebase has little effect as well only one or two calls to db_set_active() are made.

ANy ideas? What hook should I override to change the DB connection at runtime before any DB activity has be done???

Cheers,
Alex

答:
Hardly is hook_init "early in the game" and certainly not the first to fire database queries. The bootstrap order is: load configuration, try to serve the page from cache, initialize the database, load variables, load session, page header. The first hook to fire is hook_boot either if the page cache has a hit or in page header -- by then at least the variable init phase have fired a  query either to load the variables from the database (or to retrieve them from cache but you can't rely on cache and the default cache is database anyways). All is not lost, however. You can either put your code right in settings.php or write a small cache handler, something like this:

```<code>class HackyDatabaseCache extends DrupalDatabaseCache {
  function __construct($bin) {
    // your code finding the database here.
    parent::__construct($bin);
  }
}
</code>```

add $conf['cache_backends'][] = 'path/to/hackydatabasecache.inc'; and $conf['cache_class_cache_page'] = 'HackyDatabaseCache'; to your settings.php. This will make sure your code fires before any queries. If you are using memcache or mongodb for caching, then extend that with the same code just change which class is extended.

ContentLicense: CC BY-SA 2.5

Body:
Hardly is hook_init "early in the game" and certainly not the first to fire database queries. The bootstrap order is: load configuration, try to serve the page from cache, initialize the database, load variables, load session, page header. The first hook to fire is hook_boot either if the page cache has a hit or in page header -- by then at least the variable init phase have fired a  query either to load the variables from the database (or to retrieve them from cache but you can't rely on cache and the default cache is database anyways). All is not lost, however. You can either put your code right in settings.php or write a small cache handler, something like this:

class HackyDatabaseCache extends DrupalDatabaseCache {
  function __construct($bin) {
    // your code finding the database here.
    parent::__construct($bin);
  }
}

add $conf['cache_backends'][] = 'path/to/hackydatabasecache.inc'; and $conf['cache_class_cache_page'] = 'HackyDatabaseCache'; to your settings.php. This will make sure your code fires before any queries. If you are using memcache or mongodb for caching, then extend that with the same code just change which class is extended.


问:
Convert Matlab char array to other data type without changing binary data
I have a vector of int16 values that is represented in Matlab as a vector of chars. (reason for this at the end)

Now I just want to convert every two char values from the array to a single int16 value.
When reading binary files, this can be accomplished by the precision parameter of fread() - is there a analogue function for data that is already stored in a vector?

My current workaround:

```<code>% workaround using fread() to convert data type char -> int16
bytes = length(binary);
f = fopen('tmp', 'w+');
fwrite(f, binary);
fseek(f, 0, 'bof');
binary = fread(f, bytes/2, '*int16');
</code>```

Reason that the data is read as char vector: I read a file which contains binary that is encapsuled between some ASCII strings. In order to find the binary data, the strings have to be interpreted, for which I use regexp. Then I get the pure binary part (int16 values in a row) as a (char) string.

答:
Cast the chars to 8-bit numbers (integers), then typecast those to 16-bit integers:

```<code>s = 'abcd'
b = cast(s, 'int8')      % Gives [97 98 99 100]
i = typecast(b, 'int16') % Gives [25185 25699]
</code>```

Note you may want to use unsigned ints (uint16) depending on your use case.

Body:
I have a vector of int16 values that is represented in Matlab as a vector of chars. (reason for this at the end)

Now I just want to convert every two char values from the array to a single int16 value.
When reading binary files, this can be accomplished by the precision parameter of fread() - is there a analogue function for data that is already stored in a vector?

My current workaround:

% workaround using fread() to convert data type char -> int16
bytes = length(binary);
f = fopen('tmp', 'w+');
fwrite(f, binary);
fseek(f, 0, 'bof');
binary = fread(f, bytes/2, '*int16');

Reason that the data is read as char vector: I read a file which contains binary that is encapsuled between some ASCII strings. In order to find the binary data, the strings have to be interpreted, for which I use regexp. Then I get the pure binary part (int16 values in a row) as a (char) string.

Body:
Cast the chars to 8-bit numbers (integers), then typecast those to 16-bit integers:

s = 'abcd'
b = cast(s, 'int8')      % Gives [97 98 99 100]
i = typecast(b, 'int16') % Gives [25185 25699]

Note you may want to use unsigned ints (uint16) depending on your use case.


问:
How to use .net framework from .net core?
I have a .net core xUnit project that references a .net framework project that references Microsoft's Azure Notification Hub API.

It builds, but when try and create a hub, I get the error...

Could not load file or assembly
  'System.Configuration.ConfigurationManager, Version=0.0.0.0,
  Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

Which seems like an odd error to get given that System.Configuration is referenced.

How do I make the Azure referencing project act like a framework 4.7 project?

答:
If you are targeting .NET Core, make sure you've referenced NuGet package System.Configuration.ConfigurationManager.

See related question: Is ConfigurationManager.AppSettings available in .NET Core 2.0?


问:
How can I cycle all the vertex that are connected?
```<code>In JanusGraph I have 4 nodes.
A(name=alice) -> B
B -> C
C -> D
D -> A

I want to get all the cycles from node A.
</code>```

g.V().has('name', 'alice').both().both().cyclicPath().path().by('name')

I can get A->B->A and A->D->A. But I can't get A->B->C->D->A.
I want to get all the path from vertex A to Vertex A.
How can I get it using groovy language?

答:
You are only traversing away from "alice" twice with both().both() therefore your path can only be length 3 which would include the "alice" vertex and the two vertices at each step away from "alice" (i.e. both() is one step and the second both() is the next step). If you want to get do "D" you have add yet another both() so that Gremlin can traverse another set of edges and I would think yet another to get back to "alice" from "D".

Or, you could simply use repeat():

```<code>g.V().has('name', 'alice').
  repeat(both()).emit().times(4).
  cyclicPath().
  path().by('name')
</code>```

Note that I controlled the loop with times(4) to define how many steps away from "alice" I wanted to traverse both(). You could also use until() to control that for a more dynamic way to control loop termination - see repeat() for more information.

Body:
In JanusGraph I have 4 nodes.
A(name=alice) -> B
B -> C
C -> D
D -> A

I want to get all the cycles from node A.

g.V().has('name', 'alice').both().both().cyclicPath().path().by('name')

I can get A->B->A and A->D->A. But I can't get A->B->C->D->A.
I want to get all the path from vertex A to Vertex A.
How can I get it using groovy language?

Body:
You are only traversing away from "alice" twice with both().both() therefore your path can only be length 3 which would include the "alice" vertex and the two vertices at each step away from "alice" (i.e. both() is one step and the second both() is the next step). If you want to get do "D" you have add yet another both() so that Gremlin can traverse another set of edges and I would think yet another to get back to "alice" from "D".

Or, you could simply use repeat():

g.V().has('name', 'alice').
  repeat(both()).emit().times(4).
  cyclicPath().
  path().by('name')

Note that I controlled the loop with times(4) to define how many steps away from "alice" I wanted to traverse both(). You could also use until() to control that for a more dynamic way to control loop termination - see repeat() for more information.


问:
Add onClickListener in a Map CustomView
I created a Custom view to show a map in others fragments or activities.
But I want to get a simple click in frame, like google maps app does.
Anyone could help me?

There's custom view:

```<code>public class MapView extends FrameLayout {

  private Subject<GoogleMap> mapSubject;

  private static final float MAP_ZOOM_LEVEL_STATIC = 12.0f;

  private Circle mCircle;

  public MapView(@NonNull Context context) {
    super(context);
    init(context, null);
  }

  public MapView(@NonNull Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
    init(context, attrs);
  }

  public MapView(@NonNull Context context, @Nullable AttributeSet attrs,
             @AttrRes int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(context, attrs);
  }

  private void init(Context context, AttributeSet attrs) {
    SupportMapFragment mapFragment = SupportMapFragment.newInstance();

    if (!isInEditMode()) {
      FragmentTransaction fragmentTransaction =((AppCompatActivity)context)
        .getSupportFragmentManager().beginTransaction();
      fragmentTransaction.add(getId(), mapFragment);
      fragmentTransaction.commit();

      mapSubject = BehaviorSubject.create();
      Observable.create((ObservableOnSubscribe<GoogleMap>) e -> mapFragment.getMapAsync(e::onNext))
       .subscribe(mapSubject);
      mapSubject.subscribe(googleMap -> mCircle = googleMap.addCircle(new
      CircleOptions().center(new LatLng(0.0f, 0.0f)).radius(0)));
    }
  }

  /**
   * Update position and create a new Circle and move camera to new position
   *
   * @param location The location to be updated.
   */
  public void updatePosition(LatLng location) {
    mapSubject.subscribe(googleMap -> {
      mCircle.remove();
      mCircle = googleMap.addCircle(new
        CircleOptions().center(location).radius(15)
        .strokeWidth(10)
        .strokeColor(Color.RED)
        .fillColor(Color.RED));

      googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location,
        MAP_ZOOM_LEVEL_STATIC));
      });
  }

  /**
   * This method is responsible to add a polyline in google maps
   *
   * @param results array with directions
   */
  public void addPolyline(DirectionsResult results) {
    if(results != null) {
      mapSubject.subscribe(googleMap -> {
        List<LatLng> decodedPath =
          PolyUtil.decode(results.routes[0]
          .overviewPolyline
          .getEncodedPath());

        googleMap.addPolyline(new
          PolylineOptions()
            .addAll(decodedPath)
            .width(10)
            .color(Color.RED)
            .geodesic(true));

        updatePosition(decodedPath.get(0));
      });
    }
  }
}
</code>```

That's how I use in xml:

```<code><com.name.of.package.custom_view.MapView
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
</code>```

Thats how I'm trying to identify click (without success, because in debugger didn't pass here):

```<code>MapView mapView = (MapView)findViewById(R.id.mapView)
mapView.setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View view) {
    toogle(view);
    Toast.makeText(mContext, "Map clicked!", Toast.LENGTH_SHORT).show();
  }
});
</code>```

答:
Searching about, I find a way to verify simple click in maps.

Create an function in MapView.java

```<code>/**
* This method is responsible to add a MapClickListener to handle simple clicks in map.
*
* @param mapClickListener class that will handle simple click
*/
public void setOnMapClick(GoogleMap.OnMapClickListener mapClickListener) {
  mapSubject.subscribe(googleMap -> googleMap.setOnMapClickListener(mapClickListener));
}
</code>```

After that, set an listener when you use mapView, for example:

```<code>mapView.setOnMapClick(this);
</code>```

PS.: To put this you need to implement GoogleMap.OnMapClickListener in you activity/fragment that you are using mapView.

After implement, put override method in your fragment/activity:

```<code>@Override
public void onMapClick(LatLng latLng) {
  if (Logger.DEBUG) Log.d(TAG, "onMapClick");
  // Do something
}
</code>```

Title: Add onClickListener in a Map CustomView

Body:
I created a Custom view to show a map in others fragments or activities.
But I want to get a simple click in frame, like google maps app does.
Anyone could help me?

There's custom view:

public class MapView extends FrameLayout {

  private Subject<GoogleMap> mapSubject;

  private static final float MAP_ZOOM_LEVEL_STATIC = 12.0f;

  private Circle mCircle;

  public MapView(@NonNull Context context) {
    super(context);
    init(context, null);
  }

  public MapView(@NonNull Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
    init(context, attrs);
  }

  public MapView(@NonNull Context context, @Nullable AttributeSet attrs,
             @AttrRes int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(context, attrs);
  }

  private void init(Context context, AttributeSet attrs) {
    SupportMapFragment mapFragment = SupportMapFragment.newInstance();

    if (!isInEditMode()) {
      FragmentTransaction fragmentTransaction =((AppCompatActivity)context)
        .getSupportFragmentManager().beginTransaction();
      fragmentTransaction.add(getId(), mapFragment);
      fragmentTransaction.commit();

      mapSubject = BehaviorSubject.create();
      Observable.create((ObservableOnSubscribe<GoogleMap>) e -> mapFragment.getMapAsync(e::onNext))
       .subscribe(mapSubject);
      mapSubject.subscribe(googleMap -> mCircle = googleMap.addCircle(new
      CircleOptions().center(new LatLng(0.0f, 0.0f)).radius(0)));
    }
  }

  /**
   * Update position and create a new Circle and move camera to new position
   *
   * @param location The location to be updated.
   */
  public void updatePosition(LatLng location) {
    mapSubject.subscribe(googleMap -> {
      mCircle.remove();
      mCircle = googleMap.addCircle(new
        CircleOptions().center(location).radius(15)
        .strokeWidth(10)
        .strokeColor(Color.RED)
        .fillColor(Color.RED));

      googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location,
        MAP_ZOOM_LEVEL_STATIC));
      });
  }

  /**
   * This method is responsible to add a polyline in google maps
   *
   * @param results array with directions
   */
  public void addPolyline(DirectionsResult results) {
    if(results != null) {
      mapSubject.subscribe(googleMap -> {
        List<LatLng> decodedPath =
          PolyUtil.decode(results.routes[0]
          .overviewPolyline
          .getEncodedPath());

        googleMap.addPolyline(new
          PolylineOptions()
            .addAll(decodedPath)
            .width(10)
            .color(Color.RED)
            .geodesic(true));

        updatePosition(decodedPath.get(0));
      });
    }
  }
}

That's how I use in xml:

<com.name.of.package.custom_view.MapView
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

Thats how I'm trying to identify click (without success, because in debugger didn't pass here):

MapView mapView = (MapView)findViewById(R.id.mapView)
mapView.setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View view) {
    toogle(view);
    Toast.makeText(mContext, "Map clicked!", Toast.LENGTH_SHORT).show();
  }
});

Body:
Searching about, I find a way to verify simple click in maps.

Create an function in MapView.java

/**
* This method is responsible to add a MapClickListener to handle simple clicks in map.
*
* @param mapClickListener class that will handle simple click
*/
public void setOnMapClick(GoogleMap.OnMapClickListener mapClickListener) {
  mapSubject.subscribe(googleMap -> googleMap.setOnMapClickListener(mapClickListener));
}

After that, set an listener when you use mapView, for example:

mapView.setOnMapClick(this);

PS.: To put this you need to implement GoogleMap.OnMapClickListener in you activity/fragment that you are using mapView.

After implement, put override method in your fragment/activity:

@Override
public void onMapClick(LatLng latLng) {
  if (Logger.DEBUG) Log.d(TAG, "onMapClick");
  // Do something
}


问:
Escaping space in string - external command
I'm trying to run an external command (wdsutil.exe) using PowerShell:

```<code>$parsePref = "--%"
$imageName = "Windows 7 Image"

& wdsutil.exe $parsePref "/Add-Image /Name:$($imageName) /FileName:WDSBoot.wim ..."
</code>```

Returns the error: An invalid parameter (7) was specified for command /add-image

Changing $imageName to "Windows7Image" works (no spaces..) - but this is not desirable.

How can I handle spaces in the $imageName variable?

答:
Enclose the argument in quotes:</p>

```<code>& wdsutil.exe $parsePref "/Add-Image /Name:""$($imageName)"" /FileName:WDSBoot.wim ..."
</code>```

Body:
I'm trying to run an external command (wdsutil.exe) using PowerShell:

$parsePref = "--%"
$imageName = "Windows 7 Image"

& wdsutil.exe $parsePref "/Add-Image /Name:$($imageName) /FileName:WDSBoot.wim ..."

Returns the error: An invalid parameter (7) was specified for command /add-image

Changing $imageName to "Windows7Image" works (no spaces..) - but this is not desirable.

How can I handle spaces in the $imageName variable?

Body:
Enclose the argument in quotes:

& wdsutil.exe $parsePref "/Add-Image /Name:""$($imageName)"" /FileName:WDSBoot.wim ..."


问:
Copying worksheets from one file to another using VBA macro
I'm new to VBA and just to want create a macro  that copies a worksheet (or sheets) from one file to another file using a simple vba macro each period.

Im sure its easy but as I say, I am new to this world!

Many thanks in advance!

答:
Try this: (You are lucky that i had a template for this :)) Cheers

Below is the code:

```<code>Dim wkb1 As Workbook
Dim sht1 As Worksheet
Dim wkb2 As Workbook
Dim sht2 As Worksheet

Application.ScreenUpdating = False

Set wkb1 = ThisWorkbook
Set wkb2 = Workbooks.Open("B.xlsx")
Set sht1 = wkb1.Sheets("Roll Out Summary")
Set sht2 = wkb2.Sheets("Roll Out Summary")

sht1.Cells.Copy
sht2.Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
wkb2.Close True

Application.ScreenUpdating = True
</code>```

For just range:

```<code>Set sht1 = wkb1.Sheets("Roll Out Summary").Range("A1:B10") ' Define the range
Set sht2 = wkb2.Sheets("Roll Out Summary")

sht1.Cells.Copy
sht2.Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
wkb2.Close True
</code>```

Body:
Try this: (You are lucky that i had a template for this :)) Cheers

Below is the code:

Dim wkb1 As Workbook
Dim sht1 As Worksheet
Dim wkb2 As Workbook
Dim sht2 As Worksheet

Application.ScreenUpdating = False

Set wkb1 = ThisWorkbook
Set wkb2 = Workbooks.Open("B.xlsx")
Set sht1 = wkb1.Sheets("Roll Out Summary")
Set sht2 = wkb2.Sheets("Roll Out Summary")

sht1.Cells.Copy
sht2.Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
wkb2.Close True

Application.ScreenUpdating = True

For just range:

Set sht1 = wkb1.Sheets("Roll Out Summary").Range("A1:B10") ' Define the range
Set sht2 = wkb2.Sheets("Roll Out Summary")

sht1.Cells.Copy
sht2.Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
wkb2.Close True


问:
CSS3 support on browsers
Should I fully learn CSS3 from the W3 "CSS specifications" or is CSS3 not fully supported on browsers yet?

All in the title :)

答: Good overview of CSS3 support among various browsers is e.g. here http://www.findmebyip.com/litmus and here http://www.deepbluesky.com/blog/-/browser-support-for-css3-and-html5_72/</p>

Title: CSS3 support on browsers


问:
Squared characters issue on wkhtmltopdf
I've installed wkhtmltopdf on Centos 5.5. (Since there was library issues, it's been 4 days).
It's partly working now. I said partly because, all pdfs which was created by wkhtmltopdf include squares instead of text?

What can I do? I've searched google, but I couldn't find anything.

Appreciate your help.

答:
I am using CentOS 7 with wkhtmltox 12.4 and found that none of the suggestions thus far fixed my block-text in output PDFs.

For me, the final solution was to install dejavu-sans-fonts.

Title: Squared characters issue on wkhtmltopdf


问:
JEE shared library in WebLogic
I am porting my application to WebLogic as an Enterprise Library so that my EJB and MDB can invoke code in it.

I have chosen a EAR packaging for both say Lib1.ear and Lib2.ear which contains APP-INF/lib directory and have 100's of jars in both. I also have updated the MANIFEST.MF of both to contains Specification-Version and Implementation-Version. Both are deployed successfully and available to be used.

Now I updated my ear which contains my EJB and MDB and added following in weblogic-application.xml;

```<code> <wls:library-ref>
    <wls:library-name>Lib1</wls:library-name>
    <wls:specification-version>18</wls:specification-version>
</wls:library-ref>
<wls:library-ref>
    <wls:library-name>Lib2</wls:library-name>
    <wls:specification-version>18</wls:specification-version>
</wls:library-ref>
</code>```

But when I am deploying my EAR (which constains EJB etc) it fails on the first step complaining that it does not find an interface which is defined and packaged in Lib1.ear shared lib as my one of my EJB implements that. I have enabled debug log but I am unable to find any information from WebLogic which directs me to the right path. All my EJB are initialising with the remote name etc but then I get a single line error in my log followed by a ClassNotfoundException;

```<code><28-Nov-2017 15:26:18,005 o'clock GMT> <Error> <J2EE> <BEA-160228> <AppMerge failed to merge your application. If you are running AppMerge on the command-line, merge again with the -verbose option for more details. See the error message(s) below.>
weblogic.utils.compiler.ToolFailureException: com.xyz.abc.runtime.debugger.DebuggerListener
        at weblogic.application.compiler.FlowDriver.handleStateChangeException(FlowDriver.java:55)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:38)
        at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:168)
        at weblogic.utils.compiler.Tool.run(Tool.java:159)
        at weblogic.utils.compiler.Tool.run(Tool.java:116)
        at weblogic.application.compiler.AppMerge.merge(AppMerge.java:198)
        at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
        at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
        at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
        at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createLazyDeployableObject(WebLogicDeployableObjectFactoryImpl.java:160)
        at weblogic.deploy.api.tools.SessionHelper.inspect(SessionHelper.java:781)
        at com.bea.console.actions.app.install.Flow$2.execute(Flow.java:530)
        at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5690)
        at com.bea.console.actions.app.install.Flow.appSelected(Flow.java:528)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
        at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
        at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
        at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
        at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
        at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java:64)
        at org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptor.wrapAction(ActionInterceptor.java:184)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.invoke(ActionInterceptors.java:50)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java:58)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:87)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116)
        at com.bea.console.internal.ConsolePageFlowRequestProcessor.processActionPerform(ConsolePageFlowRequestProcessor.java:265)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
        at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
        at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
        at com.bea.console.internal.ConsoleActionServlet.process(ConsoleActionServlet.java:262)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
        at com.bea.console.internal.ConsoleActionServlet.doGet(ConsoleActionServlet.java:134)
        at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1199)
        at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1129)
        at com.bea.portlet.adapter.scopedcontent.framework.internal.PageFlowUtilsBeehiveDelegate.strutsLookupInternal(PageFlowUtilsBeehiveDelegate.java:43)
        at com.bea.portlet.adapter.scopedcontent.framework.PageFlowUtils.strutsLookup(PageFlowUtils.java:108)
        at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:707)
        at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:141)
        at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:108)
        at com.bea.portlet.adapter.NetuiActionHandler.raiseScopedAction(NetuiActionHandler.java:111)
        at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:181)
        at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:167)
        at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:225)
        at com.bea.netuix.nf.ControlLifecycle$2.visit(ControlLifecycle.java:180)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:324)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:130)
        at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:399)
        at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
        at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:352)
        at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:184)
        at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:159)
        at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:465)
        at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:291)
        at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:219)
        at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:275)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:64)
        at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:125)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at com.bea.console.internal.ParamFilter.doFilter(ParamFilter.java:38)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
        at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
        at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
        at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
        at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
        at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
        at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
        at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
        at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
        at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
        at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: java.lang.ClassNotFoundException: com.xyz.abc.runtime.debugger.DebuggerListener
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
        at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:473)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at weblogic.utils.classloaders.GenericClassLoader.defineClassInternal(GenericClassLoader.java:1113)
        at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:1046)
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1038)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
        at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:473)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.loadAndAppendOtherLinks(WSEEModuleHelper.java:164)
        at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.processAnnotations(WSEEModuleHelper.java:186)
        at weblogic.wsee.tools.WSEEEJBToolsModuleExtension.processAnnotations(WSEEEJBToolsModuleExtension.java:121)
        at weblogic.wsee.tools.WSEEEJBToolsModuleExtension.merge(WSEEEJBToolsModuleExtension.java:87)
        at weblogic.application.compiler.flow.MergeModuleFlow.compile(MergeModuleFlow.java:44)
        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
        at weblogic.application.compiler.BaseMerger.merge(BaseMerger.java:20)
        at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:75)
        at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:40)
        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
        ... 116 more
</code>```

Am I missing anything?

答:
Just to answer for others so that they can get this done quickly. If shared lib is packaged as WAR can only be referenced by other WAR's not an EAR. So I updated my package to be an EAR. As I stated above all I wanted to share my libs which are POJO's I had to use following structure and my EAR was able to see classes successfully.</p>

```<code>    LIB1.ear
    META-INF
        application.xml
        weblogic-application.xml
        MANIFEST.MF
    APP-INF
        lib
            *.jar (all pojo's here and WebLogic will add these into Application Classpath)
    dummyejb-1.0.0.jar  (just so that I can deploy this ear in server otherwise it won't continue)
</code>```

Title: JEE shared library in WebLogic

Body:
I am porting my application to WebLogic as an Enterprise Library so that my EJB and MDB can invoke code in it.

I have chosen a EAR packaging for both say Lib1.ear and Lib2.ear which contains APP-INF/lib directory and have 100's of jars in both. I also have updated the MANIFEST.MF of both to contains Specification-Version and Implementation-Version. Both are deployed successfully and available to be used.

Now I updated my ear which contains my EJB and MDB and added following in weblogic-application.xml;

 <wls:library-ref>
    <wls:library-name>Lib1</wls:library-name>
    <wls:specification-version>18</wls:specification-version>
</wls:library-ref>
<wls:library-ref>
    <wls:library-name>Lib2</wls:library-name>
    <wls:specification-version>18</wls:specification-version>
</wls:library-ref>

But when I am deploying my EAR (which constains EJB etc) it fails on the first step complaining that it does not find an interface which is defined and packaged in Lib1.ear shared lib as my one of my EJB implements that. I have enabled debug log but I am unable to find any information from WebLogic which directs me to the right path. All my EJB are initialising with the remote name etc but then I get a single line error in my log followed by a ClassNotfoundException;

<28-Nov-2017 15:26:18,005 o'clock GMT> <Error> <J2EE> <BEA-160228> <AppMerge failed to merge your application. If you are running AppMerge on the command-line, merge again with the -verbose option for more details. See the error message(s) below.>
weblogic.utils.compiler.ToolFailureException: com.xyz.abc.runtime.debugger.DebuggerListener
        at weblogic.application.compiler.FlowDriver.handleStateChangeException(FlowDriver.java:55)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:38)
        at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:168)
        at weblogic.utils.compiler.Tool.run(Tool.java:159)
        at weblogic.utils.compiler.Tool.run(Tool.java:116)
        at weblogic.application.compiler.AppMerge.merge(AppMerge.java:198)
        at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
        at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
        at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
        at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createLazyDeployableObject(WebLogicDeployableObjectFactoryImpl.java:160)
        at weblogic.deploy.api.tools.SessionHelper.inspect(SessionHelper.java:781)
        at com.bea.console.actions.app.install.Flow$2.execute(Flow.java:530)
        at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5690)
        at com.bea.console.actions.app.install.Flow.appSelected(Flow.java:528)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
        at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
        at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
        at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
        at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
        at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java:64)
        at org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptor.wrapAction(ActionInterceptor.java:184)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.invoke(ActionInterceptors.java:50)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors$WrapActionInterceptorChain.continueChain(ActionInterceptors.java:58)
        at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:87)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116)
        at com.bea.console.internal.ConsolePageFlowRequestProcessor.processActionPerform(ConsolePageFlowRequestProcessor.java:265)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)
        at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
        at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
        at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
        at com.bea.console.internal.ConsoleActionServlet.process(ConsoleActionServlet.java:262)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
        at com.bea.console.internal.ConsoleActionServlet.doGet(ConsoleActionServlet.java:134)
        at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1199)
        at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1129)
        at com.bea.portlet.adapter.scopedcontent.framework.internal.PageFlowUtilsBeehiveDelegate.strutsLookupInternal(PageFlowUtilsBeehiveDelegate.java:43)
        at com.bea.portlet.adapter.scopedcontent.framework.PageFlowUtils.strutsLookup(PageFlowUtils.java:108)
        at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:707)
        at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.processActionInternal(ScopedContentCommonSupport.java:141)
        at com.bea.portlet.adapter.scopedcontent.PageFlowStubImpl.processAction(PageFlowStubImpl.java:108)
        at com.bea.portlet.adapter.NetuiActionHandler.raiseScopedAction(NetuiActionHandler.java:111)
        at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:181)
        at com.bea.netuix.servlets.controls.content.NetuiContent.raiseScopedAction(NetuiContent.java:167)
        at com.bea.netuix.servlets.controls.content.NetuiContent.handlePostbackData(NetuiContent.java:225)
        at com.bea.netuix.nf.ControlLifecycle$2.visit(ControlLifecycle.java:180)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:324)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walkRecursive(ControlTreeWalker.java:334)
        at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:130)
        at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:399)
        at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
        at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:352)
        at com.bea.netuix.nf.Lifecycle.runInbound(Lifecycle.java:184)
        at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:159)
        at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:465)
        at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:291)
        at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:219)
        at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:275)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:64)
        at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:125)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at com.bea.console.internal.ParamFilter.doFilter(ParamFilter.java:38)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
        at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
        at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
        at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
        at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
        at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
        at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
        at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
        at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
        at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
        at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: java.lang.ClassNotFoundException: com.xyz.abc.runtime.debugger.DebuggerListener
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
        at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:473)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at weblogic.utils.classloaders.GenericClassLoader.defineClassInternal(GenericClassLoader.java:1113)
        at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:1046)
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1038)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
        at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:473)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.loadAndAppendOtherLinks(WSEEModuleHelper.java:164)
        at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.processAnnotations(WSEEModuleHelper.java:186)
        at weblogic.wsee.tools.WSEEEJBToolsModuleExtension.processAnnotations(WSEEEJBToolsModuleExtension.java:121)
        at weblogic.wsee.tools.WSEEEJBToolsModuleExtension.merge(WSEEEJBToolsModuleExtension.java:87)
        at weblogic.application.compiler.flow.MergeModuleFlow.compile(MergeModuleFlow.java:44)
        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
        at weblogic.application.compiler.BaseMerger.merge(BaseMerger.java:20)
        at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:75)
        at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:40)
        at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
        at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
        ... 116 more

Am I missing anything?

Body:
Just to answer for others so that they can get this done quickly. If shared lib is packaged as WAR can only be referenced by other WAR's not an EAR. So I updated my package to be an EAR. As I stated above all I wanted to share my libs which are POJO's I had to use following structure and my EAR was able to see classes successfully.

    LIB1.ear
    META-INF
        application.xml
        weblogic-application.xml
        MANIFEST.MF
    APP-INF
        lib
            *.jar (all pojo's here and WebLogic will add these into Application Classpath)
    dummyejb-1.0.0.jar  (just so that I can deploy this ear in server otherwise it won't continue)


问:
Excel - Conditional Formatting not detecting String with html tags at the beginning
Good day, I'm running this conditional formatting code in excel to find duplicate value. Row with same value will be highlighted with Red in column 1

```<code>=COUNTIFS($A:$A,$A1,$B:$B,$B1,$C:$C,$C1,$D:$D,$D1,$E:$E,$E1)>1
</code>```

and it is correct with below result

But, with data that consist html tag, it is not functioning very well. Refer image below. Row 8 should be not indicate as duplicate as the value in column E is differ

答:
I think you'll need to avoid COUNTIFS, try this version

=AND($A1<>"",SUM(0+($A$1:$A$100&"-"&$B$1:$B$100&"-"&$C$1:$C$100&"-"&D$1:$D$100&"-"&$E$1:$E$100=$A1&"-"&$B1&"-"&$C1&"-"&$D1&"-"&$E1))>1)

I recommend a restricted range for efficiency - I used 100 rows, expand as required

Body:
Good day, I'm running this conditional formatting code in excel to find duplicate value. Row with same value will be highlighted with Red in column 1

=COUNTIFS($A:$A,$A1,$B:$B,$B1,$C:$C,$C1,$D:$D,$D1,$E:$E,$E1)>1

and it is correct with below result

But, with data that consist html tag, it is not functioning very well. Refer image below. Row 8 should be not indicate as duplicate as the value in column E is differ


问:
input and button, same css, different heights
I am having same css properties, yet the button and input fields are different fields

.input-con {
  position: relative;
}

.input-con>* {
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  padding: 10px;
  border: 0;
  background-color: #ddd;
  color: #444;
  outline: 0;
  cursor: pointer;
  font-size: 15px;
  box-sizing: border-box;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="input-con">
  <input type="text" />
  <button>Search</button>
</div></code>```

pen - https://codepen.io/digitalzoomstudio/pen/LOoVYK

How could I achieve same heights without forcing height property ?

答: Yes indeed Flexbox is the way to go, but if you're curious as why you're getting this behavior CSS Tricks has a good article https://css-tricks.com/fighting-the-space-between-inline-block-elements/ </p>

Body:
I am having same css properties, yet the button and input fields are different fields

.input-con {
  position: relative;
}

.input-con>* {
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  padding: 10px;
  border: 0;
  background-color: #ddd;
  color: #444;
  outline: 0;
  cursor: pointer;
  font-size: 15px;
  box-sizing: border-box;
}

  <input type="text" />
  <button>Search</button>

pen - https://codepen.io/digitalzoomstudio/pen/LOoVYK

How could I achieve same heights without forcing height property ?


问:
How to get text response directly on Dialogflow?
I'm trying to get a direct text response from dialogflow. I do get an answer from the example code on github, but thats not user-friendly at all. How can I get the "Speech-Only" response?

```<code>import os.path
import sys

try:
    import apiai
except ImportError:
    sys.path.append(
        os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
    )
    import apiai

CLIENT_ACCESS_TOKEN = 'YOUR_ACCESS_TOKEN'

def main():
    ai = apiai.ApiAI(CLIENT_ACCESS_TOKEN)

    request = ai.text_request()

    request.lang = 'de'  # optional, default value equal 'en'

    request.session_id = "<SESSION ID, UNIQUE FOR EACH USER>"

    request.query = "Hello"

    response = request.getresponse()

    print (response.read())

if __name__ == '__main__':
    main()
</code>```

I just expect a a simple result. A plain hello text.

What I get instead = b'{\n  "id": "306fd06a-d9e6-4c2e-8c05-98ff7fc0ecd5",\n  "timestamp": "2017-12-05T22:18:15.563Z",\n  "lang": "en",\n  "result": {\n    "source": "agent",\n    "resolvedQuery": "hi",\n    "action": "input.welcome",\n    "actionIncomplete": false,\n    "parameters": {},\n    "contexts": [],\n    "metadata": {\n      "intentId": "8406ea3a-a0c9-4470-829f-aba0ce2da2e5",\n      "webhookUsed": "false",\n      "webhookForSlotFillingUsed": "false",\n      "intentName": "Default Welcome Intent"\n    },\n    "fulfillment": {\n      "speech": "Hi there!",\n      "messages": [\n        {\n          "type": 0,\n          "speech": "Hi there!"\n        }\n      ]\n    },\n    "score": 1.0\n  },\n  "alternateResult": {\n    "source": "domains",\n    "resolvedQuery": "hi",\n    "action": "smalltalk.greetings.hello",\n    "actionIncomplete": false,\n    "parameters": {},\n    "contexts": [],\n    "metadata": {},\n    "fulfillment": {\n      "speech": "Hey!",\n      "source": "agent"\n    },\n    "score": 1.0\n  },\n  "status": {\n    "code": 200,\n    "errorType": "success",\n    "webhookTimedOut": false\n  },\n  "sessionId": "mr.9000"\n}'

答:
Just try like this to get the message:

```<code>response = json.loads(request.getresponse().read().decode('utf-8'))
message = response['result']['fulfillment']['speech']
print (message)
</code>```

Don't forget to add

```<code>import json
</code>```

at the beginning. If you haven't installed it yet, install it. You'll have to if you want to deal with json in python.
Tell me if it works

Body:
I'm trying to get a direct text response from dialogflow. I do get an answer from the example code on github, but thats not user-friendly at all. How can I get the "Speech-Only" response?

import os.path
import sys

try:
    import apiai
except ImportError:
    sys.path.append(
        os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
    )
    import apiai

CLIENT_ACCESS_TOKEN = 'YOUR_ACCESS_TOKEN'

def main():
    ai = apiai.ApiAI(CLIENT_ACCESS_TOKEN)

    request = ai.text_request()

    request.lang = 'de'  # optional, default value equal 'en'

    request.session_id = "<SESSION ID, UNIQUE FOR EACH USER>"

    request.query = "Hello"

    response = request.getresponse()

    print (response.read())

if __name__ == '__main__':
    main()

I just expect a a simple result. A plain hello text.

What I get instead = b'{\n  "id": "306fd06a-d9e6-4c2e-8c05-98ff7fc0ecd5",\n  "timestamp": "2017-12-05T22:18:15.563Z",\n  "lang": "en",\n  "result": {\n    "source": "agent",\n    "resolvedQuery": "hi",\n    "action": "input.welcome",\n    "actionIncomplete": false,\n    "parameters": {},\n    "contexts": [],\n    "metadata": {\n      "intentId": "8406ea3a-a0c9-4470-829f-aba0ce2da2e5",\n      "webhookUsed": "false",\n      "webhookForSlotFillingUsed": "false",\n      "intentName": "Default Welcome Intent"\n    },\n    "fulfillment": {\n      "speech": "Hi there!",\n      "messages": [\n        {\n          "type": 0,\n          "speech": "Hi there!"\n        }\n      ]\n    },\n    "score": 1.0\n  },\n  "alternateResult": {\n    "source": "domains",\n    "resolvedQuery": "hi",\n    "action": "smalltalk.greetings.hello",\n    "actionIncomplete": false,\n    "parameters": {},\n    "contexts": [],\n    "metadata": {},\n    "fulfillment": {\n      "speech": "Hey!",\n      "source": "agent"\n    },\n    "score": 1.0\n  },\n  "status": {\n    "code": 200,\n    "errorType": "success",\n    "webhookTimedOut": false\n  },\n  "sessionId": "mr.9000"\n}'

Body:
Just try like this to get the message:

response = json.loads(request.getresponse().read().decode('utf-8'))
message = response['result']['fulfillment']['speech']
print (message)

Don't forget to add

import json

at the beginning. If you haven't installed it yet, install it. You'll have to if you want to deal with json in python.
Tell me if it works


问:
jQuery post request interrupted: Only half of post parameters arrive
I have a noticed a strange phenomenon in my LAMP environment.

Over the frontend I execute an AJAX post request with jQuery like this:

```<code>$.post('save.php', {data1: d1, data2: d2, [...],  dataN: dN})
</code>```

The variables d1 to dN are collected from the website (e.g. from text inputs, textareas, checkboxes, etc.) with jQuery beforehand.

The file save.php takes the post parameters data1 to dataN and saves them in the database in one query.

The request takes about 500ms and works without problems unless I change pages (e.g. by clicking a link) during the request.

Normally, I would expect the request to be aborted and ignored (which would be fine) but (and this is the strange behaviour) the request seems to be completed but only with part of the data transmitted and thus saved.

That means for example, that the php script saves only data1 to data5 and sets data6 to dataN to empty.

The problem seems to be caused by the AJAX request already (not the php script) since fields $_POST['data6'] to $_POST['dataN'] are not set in php in this scenario.

So my questions:

Why does this happen (is this expected behaviour)?

How can I avoid it?

Update

The problem is neither jQuery nor php solely. jQuery collects the values correctly and tries to post them to php. I just validated it - it works.
The php script on the other hand handles everything it gets as expected - it just does not receive the whole request.

So the problem must be the interrupted request itself. Unlike I'd expect it does not abort or fail, it still transmits all the data until the cut off.

Then php gets this post data and starts handling it - obviously missing some information.

Update 2

I fixed the problem by adding a parameter eof after dataN and checking if it was set in php. This way I can be sure the whole request was transmitted.

Nevertheless this does not fix the source of the problem which I still don't understand.

Any help anyone?

答:
Why does this happen (is this expected behaviour)?

Was also looking for the cause of this strange behaviour when some variables from post were missing and came to this question where the very similar behaviour is explained with the slow connection of the web client sending a POST request with multipart/form-data.

Here goes the mentioned question:

I am facing a problem when a remote web client with slow connection
  fails to send complete POST request with multipart/form-data content
  but PHP still uses partially received data to populate $_POST array.
  As a result one value in $_POST array can be incomplete and more
  values can be missing.

See How to check for incomplete POST request in PHP

How can I avoid it?

There you can find the recommended solution, as well. Nevertheless, the same solution was already proposed by you.

You can add field <input type="hidden" name="complete"> (for example)
  as the last parameter. in PHP check firstly whether this parameter was
  sent from client. if this parameter sent - you can be sure that you
  got the entire data.

Body:
I have a noticed a strange phenomenon in my LAMP environment.

Over the frontend I execute an AJAX post request with jQuery like this:

$.post('save.php', {data1: d1, data2: d2, [...],  dataN: dN})

The variables d1 to dN are collected from the website (e.g. from text inputs, textareas, checkboxes, etc.) with jQuery beforehand.

The file save.php takes the post parameters data1 to dataN and saves them in the database in one query.

The request takes about 500ms and works without problems unless I change pages (e.g. by clicking a link) during the request.

Normally, I would expect the request to be aborted and ignored (which would be fine) but (and this is the strange behaviour) the request seems to be completed but only with part of the data transmitted and thus saved.

That means for example, that the php script saves only data1 to data5 and sets data6 to dataN to empty.

The problem seems to be caused by the AJAX request already (not the php script) since fields $_POST['data6'] to $_POST['dataN'] are not set in php in this scenario.

So my questions:

Why does this happen (is this expected behaviour)?

How can I avoid it?

Update

The problem is neither jQuery nor php solely. jQuery collects the values correctly and tries to post them to php. I just validated it - it works.
The php script on the other hand handles everything it gets as expected - it just does not receive the whole request.

So the problem must be the interrupted request itself. Unlike I'd expect it does not abort or fail, it still transmits all the data until the cut off.

Then php gets this post data and starts handling it - obviously missing some information.

Update 2

I fixed the problem by adding a parameter eof after dataN and checking if it was set in php. This way I can be sure the whole request was transmitted.

Nevertheless this does not fix the source of the problem which I still don't understand.

Any help anyone?


问:
Command to get the sql query of a BigQuery view
We have a created a large number of views in BigQuery using standardSql. Now we need to see for the correctness of these created views.

Is there a bq command to get the sql query with which these views have been created in BigQuery?

This command will prevent manual effort of checking for the correctness of these views

答:
You can also use the --format=prettyjson flag (instead of --view) so you can easily get the query content when running a script, for example:

bq show --format=prettyjson <project>:<dataset>.<view>


问:
How can I just get the last record in the java.util.List using subList() or any other method?
Say I have a list of elements whose size is 100. Now I only want the 100th record in the list and the rest of all records from 1-99 should be removed from the list.

I have tried the below piece of code but no change in list size as I see it.

//Output list.size() returns 100

```<code>list.subList(list.size()-1, list.size());
</code>```

//Output list.size() returns 100 after subList() called...

How can I get just the last record in the java.util.List using subList() or using any other methods available in Java?

答:
To get just last record without changing list you could use:

```<code>element = list.get(list.size()-1);
</code>```

this will work for any list, most effective for ArrayList implementation.

Body:
Say I have a list of elements whose size is 100. Now I only want the 100th record in the list and the rest of all records from 1-99 should be removed from the list.

I have tried the below piece of code but no change in list size as I see it.

//Output list.size() returns 100

list.subList(list.size()-1, list.size());

//Output list.size() returns 100 after subList() called...

How can I get just the last record in the java.util.List using subList() or using any other methods available in Java?

Body:
To get just last record without changing list you could use:

element = list.get(list.size()-1);

this will work for any list, most effective for ArrayList implementation.


问:
Xcode tables refresh on button click
I have a table which is populated with JSON. It works as a calendar. When the date is clicked, the table below should be populated with the events for that day.

These populate the tables after the data has been found but only does it once.

```<code>func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return(GlobalVar.TodaysEvents.count)

}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    let cell = tableView.dequeueReusableCell(withIdentifier: "eventCell", for: indexPath) as! WhitelistTableViewCell

    cell.startTime.adjustsFontSizeToFitWidth = true

    print(GlobalVar.TodaysEventsTimes[indexPath.row])

    cell.startTime.text = (GlobalVar.TodaysEventsTimes[indexPath.row] as! String)
    cell.Summary.text = GlobalVar.TodaysEvents[indexPath.row] as? String

    return(cell)
}
</code>```

I have seen other posts like this and they use:

```<code>self.tableView.reload()
</code>```

However, when i try this, it doesn't recognise "tableView" and simply doesn't work.

Any advice would be appreciated, thanks in advance

答: I don't know where you are reload the tableview but i think you reload the table view at different thread. That's why please reload the table view after inserting the data in array. </p>

Title: Xcode tables refresh on button click

Body:
I have a table which is populated with JSON. It works as a calendar. When the date is clicked, the table below should be populated with the events for that day.

These populate the tables after the data has been found but only does it once.

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return(GlobalVar.TodaysEvents.count)

}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    let cell = tableView.dequeueReusableCell(withIdentifier: "eventCell", for: indexPath) as! WhitelistTableViewCell

    cell.startTime.adjustsFontSizeToFitWidth = true

    print(GlobalVar.TodaysEventsTimes[indexPath.row])

    cell.startTime.text = (GlobalVar.TodaysEventsTimes[indexPath.row] as! String)
    cell.Summary.text = GlobalVar.TodaysEvents[indexPath.row] as? String

    return(cell)
}

I have seen other posts like this and they use:

self.tableView.reload()

However, when i try this, it doesn't recognise "tableView" and simply doesn't work.

Any advice would be appreciated, thanks in advance


问:
Parsing specific parts of output
Basically, I have this script that updates wifi firmware on jailbroken devices (iOS). I need to check the output of this:

```<code>/usr/libexec/wifiFirmwareLoader -f
</code>```

This outputs me the file path to the correct files needed for the rest of the script, but I don't want the whole path, I only want the name of the file at the end of the path. How could I go about parsing this?

If you need an example, this is what the output looks like.

```<code>RESOLVED /usr/share/firmware/wifi/C748383-A3/hans.trx
</code>```

I would only want to store hans.trx in a variable.

答:
You can use regexes in grep:

```<code>echo "RESOLVED /usr/share/firmware/wifi/C748383-A3/hans.trx" | grep -Eo "[^/]+$"
</code>```

-E uses extended regexes. You could also use -P for perl regexes

-o only shows the matched output

[^/] matches everything that is not a /, the + makes it at least 1 character and the $ requires it to be at the end of the line

If this matches more lines that you would need, you could use postive lookahead (?=something) or positive lookbehind something\K to make the regex more strict (will need -P). Or in some cases I like to double grep (first grep for lines containing something, then get the part from the line you want)

Your final script could look something like this:

```<code>OUTPUT=$(/usr/libexec/wifiFirmwareLoader -f)
FILENAMES=$(echo "${OUTPUT}" | grep -Eo "[^/]+$")
echo "${FILENAMES}"
</code>```

Title: Parsing specific parts of output

Body:
Basically, I have this script that updates wifi firmware on jailbroken devices (iOS). I need to check the output of this:

/usr/libexec/wifiFirmwareLoader -f

This outputs me the file path to the correct files needed for the rest of the script, but I don't want the whole path, I only want the name of the file at the end of the path. How could I go about parsing this?

If you need an example, this is what the output looks like.

RESOLVED /usr/share/firmware/wifi/C748383-A3/hans.trx

I would only want to store hans.trx in a variable.

Body:
You can use regexes in grep:

echo "RESOLVED /usr/share/firmware/wifi/C748383-A3/hans.trx" | grep -Eo "[^/]+$"

-E uses extended regexes. You could also use -P for perl regexes

-o only shows the matched output

[^/] matches everything that is not a /, the + makes it at least 1 character and the $ requires it to be at the end of the line

If this matches more lines that you would need, you could use postive lookahead (?=something) or positive lookbehind something\K to make the regex more strict (will need -P). Or in some cases I like to double grep (first grep for lines containing something, then get the part from the line you want)

Your final script could look something like this:

OUTPUT=$(/usr/libexec/wifiFirmwareLoader -f)
FILENAMES=$(echo "${OUTPUT}" | grep -Eo "[^/]+$")
echo "${FILENAMES}"