text:
Q: ng-repeat within directive will not update when adding or modifying objects to the existing collection I've got a treeview which contains objects with nested arrays that I am trying to populate.
A working plunker may be found here.
Here is a breakdown of how the code is structured and what I have tried thus far.
Within my treeview.html view I am loading the treeview directive I have created:
I currently have two just to test the bindings. The second one will not populate until the incident checkbox has been checked.

Tree View Sameple

Treeview 1

    <tree src="tree.treeData" iobj="object" filter="tree.getAggregateInfo(object, isSelected)"></tree>

Treeview 2 once object has been updated

    <tree src="tree.treeData2" iobj="object" filter="tree.getAggregateInfo(object, isSelected)"></tree>

javascript object data

{{tree.treeData}}

The bottom binding is just showing the output of the js file. Wihtin the treeview when you click on the incident checkbox I am simulating a new nested collection being retrieved that should be inserted as a child element under the incident node of the tree.
Here is the code used in the treeviewController.js
(function () {

    angular.module('app')
           .controller('treeviewController', ['$log', '$scope', '$timeout', treeviewController]);
    function treeviewController($log, $scope, $timeout) {

        var vm = this;
       //storage container for last node selected in tree
        vm.lastNodeSelected = '';

        vm.treeData2 = {};//test container to reflect object once updated
        //original data not an arry but an object holding an array
        vm.treeData =
            {
                "children": [
                  {
                      "name": "Document Type",
                      "children": [
                        {
                            "name": "Incident",
                            "documentType": "Document Type",
                            "aggregateUponField": "_ocommon.documenttype",
                            "parent": "",
                            "count": 2950,
                            "children": null
                        },
                        {
                            "name": "Some Event",
                            "documentType": "Document Type",
                            "aggregateUponField": "_ocommon.documenttype",
                            "parent": "",
                            "count": 2736,
                            "children": [{
                                        "name": "Some Event Date",
                                        "children": [
                                                    {
                                                    "name": "2008",
                                                    "documentType": "Incident Date",
                                                    "aggregateUponField": "dateincidentstart",
                                                    "parent": "",
                                                    "count": 451,
                                                    "children": null
                                                    },
                                                    {
                                                    "name": "2009",
                                                    "documentType": "Incident Date",
                                                    "aggregateUponField": "dateincidentstart",
                                                    "parent": "",
                                                    "count": 407,
                                                   "children": null
                                                   },
                                                   {
                                                   "name": "2010",
                                                   "documentType": "Incident Date",
                                                   "aggregateUponField": "dateincidentstart",
                                                   "parent": "",
                                                   "count": 426,
                                                   "children": null
                                                   }
                                                  ]
                                       }]
                        }
                      ]
                  }
                ]
            };

        //aggregate data to be nested under incident
        vm.newChildData = [
              {
                  "name": "Incident Date",
                  "children": [
                    {
                        "name": "2008",
                        "documentType": "Incident Date",
                        "aggregateUponField": "dateincidentstart",
                        "parent": "",
                        "count": 451,
                        "children": null
                    },
                    {
                        "name": "2009",
                        "documentType": "Incident Date",
                        "aggregateUponField": "dateincidentstart",
                        "parent": "",
                        "count": 407,
                        "children": null
                    },
                    {
                        "name": "2010",
                        "documentType": "Incident Date",
                        "aggregateUponField": "dateincidentstart",
                        "parent": "",
                        "count": 426,
                        "children": null
                    }
                  ]
              }

        ];

        var loadData = function () {
            //stip out array
            var children = vm.treeData.children;
            //search array for matching parent
            $log.info(vm.lastNodeSelected);
            var cnt = children.length;
            for (var i = 0; i < cnt; i++) {
                if (children[i].children) {
                    var innerCnt = children[i].children.length;
                    for (var c = 0; c < innerCnt; c++) {
                        if (children[i].children[c].name === vm.lastNodeSelected) {
                            children[i].children[c].children = vm.newChildData;

                        }
                    }
                }
            }

            //wrap back in object and assign to ngModel
            vm.updatedList = { children };
            // $log.info(updatedList);

            vm.treeData2 = vm.updatedList;
            $timeout(function() {
                $scope.$apply(function() {
                    vm.treeData = vm.updatedList;
                })} , 0);
        }

        vm.getAggregateInfo = function (node) {

            vm.lastNodeSelected = node.name;
            loadData();
           // $log.info(vm.lastNodeSelected);
        };

    }

})();

Following is the treeview directive.
angular.module('app')
    .directive('tree', function () {
        return {
            restrict: 'E',
            replace: true,
            scope: {
                t: '=src',
                filter: '&'
            },
            template: '
<branch ng-repeat="c in t.children track by $index"  src="c" filter="filter({ object: object, isSelected: isSelected })"></branch>
'

        };
    });

angular.module('app')
.directive('branch', function ($compile) {

    return {
        restrict: 'E',
        replace: true,
        scope: {
            b: '=src',
            filter: '&',
            checked: '=ngModel'
        },

        template: '
<input type="checkbox" ng-click="innerCall()" ng-model="b.$$hashKey" ng-change="stateChanged(b.$$hashKey)"  />{{ b.name }}   ({{ b.count }})
',
        link: function (scope, element, attrs) {

            var clicked = '';
            var hasChildren = angular.isArray(scope.b.children);
            scope.visible = hasChildren;
            if (hasChildren) {
                element.append('<tree src="b" filter="filter({ object: object, isSelected: isSelected })"></tree>');
                $compile(element.contents())(scope);
            }
            element.on('click', function (event) {
                event.stopPropagation();
                if (hasChildren) {
                    element.toggleClass('collapsed');
                }
            });
            scope.stateChanged = function (b) {
                clicked = b;
            };

            scope.innerCall = function () {
                scope.filter({ object: scope.b, isSelected: clicked });
            };
        }
    };
});

What I am seeing is when I click on the incident check box the javascript object does update. You can see this in the output as well as the second treeview that gets bound once the check box is selected.
I suspect the issue is related to the $digest cycle of the event and the tree is not being notified to actually update. I've tried as you can see in the controller using a $scope.$apply() wrapped in a timeout but this has not worked to update the original tree.
Doing additive actions like a .push() to the array updates however trying to insert a new object into an existing array does not seem to work.
Any suggestions on how to get the tree to update and reflect the child objects?

A: Here's a slightly modified Plunker to highlight (and partially fix) the problem.
I added the following lines to the link function in the branchdirective:
scope.$watch('b', function (newvalue, oldvalue) {
    if (!oldvalue.children && newvalue.children) {
        scope.visible = true;
        element.append('<tree src="b" filter="filter({ object: object, isSelected: isSelected })"></tree>');
        $compile(element.contents())(scope);
     }
}, true);

The linkfunction is not called again, when the tree structure gets updated. Thus, if there are new children to be added, those will not get compiled for Angular.


text:
Q: Eclipse Feature Deployment into other Applications I've generated an eclipse rcp plug-in project based on the vogella.com tutorial: http://www.vogella.com/tutorials/EclipseRCP/article.html#e4_plugin.  I've then created a "Feature Project" that provides the created plug-in as part of it's delivery.  The feature is then exported to an archive file and installed into eclipse (restarted after install).
I've created a new workspace, with a new "Eclipse 4 Application".  I've changed the "Product configuration is based on: " to use features.  And then try to add the feature that was exported into this new project, and cannot find it in the list of features available.  I can find the plug-in that's in the feature (I'm able to create a new plug-in, and add the plug-in that's in the feature as a dependency).  I've also gone to the installation details window (from help->about) to determine if the feature is listed there.  My feature is listed under "Installed software", and the plugin is listed under "Plug-ins", but the feature is not listed under the "Features" tab.
What am I missing in the configuration of the feature that will allow me to export this feature to other developers without them having to build a new feature based on the plug-ins?

A: This ended up being a permission issue.  The eclipse installation was owned by 'Administrator', so the plugins for the feature were being installed into the workspace/.metadata/.plugins directory.  There appears to be no way to install features into this directory, and therefore they were not a part of the eclipse system.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Blackberry error _camConfigHandle is invalid I am making the qr-code reader app,on button click i have opened the camera view.
  Then depend on their result it will navigate to next screen but second time when i open the screen it gives me the error CamController:get res failed: _camConfigHandle is invalid.
EDITED:
  I have try this code for remove the scanner and move to next screen
 UiApplication.getUiApplication().invokeLater(new Runnable() {
                            public void run() {
                                try {
                                    _scanner.getPlayer().stop();

                                } catch (MediaException e) {
                                    e.printStackTrace();
                                }
                                _scanner.getPlayer().close();
                                System.out.println("closeScan");
                                _scanner.getPlayer().deallocate();
                                System.out.println("deallocateScan");
                                System.out.println("deleteAllScan");
                                UiApplication.getUiApplication().popScreen(_barcodeScreen);
                            }
                        });

and this is my code to scan
 private void scanBarcode() {

        if (_barcodeScreen == null) {
            Hashtable hints = new Hashtable();
            Vector formats = new Vector();
            formats.addElement(BarcodeFormat.QR_CODE);
            hints.put(DecodeHintType.POSSIBLE_FORMATS, formats);
            hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
            BarcodeDecoder decoder = new BarcodeDecoder(hints);
            try {
                _scanner = new BarcodeScanner(decoder, new MyBarcodeDecoderListener());
                _barcodeScreen = new MyBarcodeScannerViewScreen(_scanner);

            } catch (Exception e) {
             System.out.println("error="+e.toString());
                return;
            }
        }

        try {
            _scanner.startScan();
            UiApplication.getUiApplication().pushScreen(_barcodeScreen);
        } catch (Exception e) {
             System.out.println("error1="+e.toString());
        }

    }

Thanks in Advance.

A: Are you closing the camera properly? please use the following method and adapt it to do similar things to close the camera properly
//close the scanner
public void closeScanner()
{
if (this.player != null) {
  try {
    this.player.stop();
  } catch (MediaException e) {
      //handle exception
    Log.Error("Exception stopping player: " + e);
  }
  //de allocate and close player
  this.player.deallocate();
  this.player.close();
}
}


text:
Q: Spring security or LDAP server to rule password policy? I have a application that use Jpa Hibernate,Spring Data, Spring security, but I want more control over password rules and users, for example, password expiration time, session time, inactive session time, etc.
Spring security can do all these tasks automated?
Other possibility is to use LDAP, to control password policy, but I already have users defined in my application and I can't see how LDAP server can read my users to apply the polices, or the users have to be in the LDAP server to authenticate in my application?
I installed apacheds server to test.
I need to know if I'm using the right approach to solve this problem.

A: If you use the LDAP password policy it will apply to existing users next time they change their passwords, and you can force them to do that.
Session inactive/expiry time has nothing to do with password policies as implemented in LDAP.


text:
Q: Is there an algorithm/process for finding all modular forms of a given level and weight? Given a congruence subgroup $\Gamma<SL_2(\mathbb{Z})$, and a weight $k$, we have the space $M_k(\Gamma)$ of modular forms for $\Gamma$ of weight $k$. In every example I've seen, one is able to produce a basis of this space via known constructions, pushing/pulling from other modular curves, Eisenstein series, taking products, etc.
My question is whether there is a precise theorem stating that one is guaranteed to find generators of $M_k(\Gamma)$ via these processes (or other, explicit methods), or whether there may be forms which can't be found in this way?
If there is a cleaner statement, I'm happy to restrict to $\Gamma_0(N)$, $\Gamma(N)$ and $\Gamma_1(N)$ rather than an arbitrary congruence subgroup. Any references would also be much appreciated.

A: The method of modular symbols (described in William Stein's book) typically works very well in practice.
Another technique that one can use is the Eichler-Selberg trace formula (and variants for generic level), which can be used to explicitly compute a single "trace form" of given weight, level, and nebentypus. Applying various Hecke operators to the trace form will give a spanning basis for the space of modular forms, which can then be diagonalized by the Hecke algebra (but not, interestingly just using the Hecke operators) to get an eigenbasis.
More generally, when we computed classical modular forms for the LMDFB, we used techniques described in our paper Computing classical modular forms. This paper also summarizes various useful theorems in both the modular symbol approach and the trace formula approach.


text:
Q: Simplify the probability of events Given three exhaustive events $X, Y$ and $Z$, $X$ and $Y$ are mutually exclusive, and $X$ and $Z$ are independent. If $P(X) = m, P(Y) = n$ and $P(z) = m$, express the following in terms of $m$ and $n$: $P(Z|X\cup Y)$
I'm not sure how to simplify this except using the fundamentals of conditional probability:
$$P(Z|X\cup Y) = \frac{P(Z \cap (X \cup Y))}{P(X \cup Y)}$$
I also know that $P(X\cup Y) = P(X) + P(Y) = m + n$.
Any assistance is much appreciated.

A: $P(Z\cap(X \cup Y))=P((Z\cap X)\cup (Z \cap Y)) = P(Z \cap X) + P(Z \cap Y)$ because $X$ and $Y$ are mutually exclusive.
$P(Z \cap X) + P(Z \cap Y) = P(Z)P(X) + P(Z \cap Y) = m^2 + P(Z \cap Y)$ as $X$ and $Z$ are independent.
$P(Z \cap Y)=P(Z \cap \bar{X})$, as $X$, $Y$, and $Z$ are exhaustive. But $P(Z \cap \bar{X})=P(Z)P(\bar{X})=m(1-m)$ as $Z$ and $X$ (and therefore $\bar{X}$) are independent.
So, $P(Z|X \cup Y) = \frac{m^2 + m(1-m)}{m + n}=\frac{m}{m+n}$.


text:
Q: What does => (equals greater than) mean in Fortran? I'm looking through some old Fortran 90 code and have come across the => symbol:
var => item

It looks like it's being used for some sort of assignment.
Searching Google for "arrow symbol Fortran" or "equals greater than symbol Fortran" gives me no related material.

A: => appears in six contexts as a syntactic element in modern Fortran, many, but not all, related to pointers: pointer assignment; pointer initialization; procedure (pointer) declaration; type-bound procedure declaration; association; renaming.  There is close connection between most of these.  Loosely, in many => can be viewed as providing an alternative temporary or permanent means of referencing another entity.   In none, however, is => acting as an operator.1
Pointer assignment
Pointer assignment is one of the traditional appearances of =>, appearing in Fortran 90.  It is used to associate a pointer with a target, and is explained in another answer.
Use association renaming
Renaming of entities use associated involves the element => and is the other appearance in Fortran 90/95 code.  Such use statements are like
use mod_a, c=>a
use mod_b, only : cc => bb

Following such a use statement the module entities a and bb are known by the local names c and cc.
Pointer initialization
Pointer initialization is much like pointer assignment where => appears.  Pointer initialization defines the initial pointer association of the pointer.  We see this in statements such as
real, target :: a
real, pointer :: b=>a
real, pointer :: c=>NULL()

With this explicit initializtion, the pointer b here is initially associated with a and the pointer c is initially unassociated.  These two forms are helpful in modern Fortran in that in Fortran 90 a pointer always starts life initially of undefined association status.  Here we know that b and c have defined pointer association status, and we can use ASSOCIATED.
For derived type components such syntax gives default initialization.
Procedure declaration
Much as with explicit/default initialization for data objects => features in defining the initial association of a procedure pointer.
procedure(proc_interface), pointer :: proc1 => donkey
procedure(proc_interface), pointer :: proc2 => null()

Here, proc1 is again initially associated with the procedure donkey and we can have such things as
call proc1(...)

much as we could when proc1 is pointer assigned with donkey outside the declaration statement.  proc2 is, as expected, initially not associated.
As with data object components of derived types => can feature in setting the initial association of a derived type's procedure pointer component:
type a
  procedure(proc_interface), pointer :: proc => donkey
end type a

Type-bound procedure declaration
Conceptually related to the above is the use of => in declaring type-bound procedures.
type a
 contains
  procedure :: proc => donkey
  generic :: assignment(=) => type_a_eq
end type a

Here in the type a proc is a binding name so that b%proc (for b an entity of type a) is a procedure reference.  We also, through type_a_eq, have defined assignment with entities of type a on the left-hand side.
Association
=> appears in four association contexts.  The associate, change team, select type and select rank constructs associate a name with a selector.
From Fortran 2003 we have
associate (a => 1+2)
  ... ! In this block we have an entity named a
end associate

and
class(*) b   ! b is unlimited polymorphic
select type (a => b)
  type is (real)
    ... ! a is a non-polymorphic real here
end select

Introduced in Fortran 2018 we have
dimension(..) b  ! b is assumed rank
select rank (a => b)
  rank (1)
    ... ! a is a rank-1 array here
end select

and
change team (team_value, a[*] => b)
... ! In this block we have a coarray named a
end team

These associations differ from pointers.  a in the associate block needn't be (and in the example above isn't) a variable.

[1]  The concept of operator is precisely defined in the Fortran language, such as in 3.2.4 of the Fortran 2008 specification.  Unlike many other languages, assignment (with =) itself is not an operation, but a statement.  In C-like languages we can have (a=b) as an expression returning a result: this is not the case in Fortran.  The same holds for pointer assignment in Fortran.  The other cases above are wholly distinct from this idea of assignment.  In Fortran, even = appearing in initialization is not the same thing as assignment.  => cannot be viewed as having one effect.

A: Surprisingly, searching "equals arrow symbol Fortran" yields some results.
"=>" is commonly referred to as the pointer assignment operator.
(Though it is not truly an operator as it returns no value.)
It is used to associate a chosen reference name with a target:
reference => target

The above can be read as "reference refers to target"
Most often this reference occurs in the form of a pointer. In this case you could say "reference points to target". This is a helpful way to remember what this operator does as its literal appearance is of an arrow pointing from reference to target.
Further Uses
Additional uses including making local aliases for various items such as module components, procedures, and even arbitrary expressions. For a full explanation of all of these uses see this answer.
Pointer assignment vs. Traditional Assignment (=)
Here's a quick example from the above link that illustrates how pointer assignment differs from classic assignment ("="). Basically this shows that once a target has been established, the pointer is treated as that target for basic statements.
pt => x ! pt points to x

y = pt ! y equals x

pt => y ! pt points to y

pt = 17 ! y equals 17

Other Resources:
General documentation on Fortran pointers


text:
Q: How to return the most recent channel entry/comment date? To be honest I'm not expecting an answer to this question. While it sounds simple, I think it's probably quite involved.
For a given channel I want to return one date/time - it will be either the latest channel entry date or the most recent comment date, whichever is the most recent date/time.
Cheers
Lee

A: Use the Stats Module here to return the required data
http://expressionengine.com/user_guide/modules/statistics/index.html#variables
{exp:stats}
            Last Comment Date : {last_comment_date format="%m/%d/%Y %h:%i %a"}
            Last Entry Date : {last_entry_date format="%m/%d/%Y %h:%i %a"}
    {/exp:stats}

A: You can try using the IfElse plugin to make sure you don't output the IfElse conditional.

A: You can use the Statistics Module (as John said) but the following code will output either the comment or entry data like you requested:
{exp:stats}
  {if last_comment_date > last_entry_date}
    {!-- Comment is more recent --}
    {last_comment_date format="..."}
  {if:else}
    {!-- Entry is more recent --}
    {last_entry_date format="..."}
  {/if}
{/exp:stats}


text:
Q: s3 images not loading after copying it from one bucket to another of same account I have copied images from one bucket to another and now i am unable to access images. Error shows
AccessDenied message.
I have verified file exists in bucket but unable to access it. If i remove same image and upload it again then it is working.
Please suggest any reason if anything i missed during copying bucket data from one to another.
Link which was working with old bucket and now not accessible with new bucket
https://abc.s3.amazonaws.com/uploads/profile/image/16923/client_thumb_CINDERELLA_12

A: Copy (or whatever put action) in S3 is by default private because that's the deault ACL behavior, see here. This is why you get access denied even though the source file has public access enabled. Therefore you need to specify the ACL to public-read during the copy, in your case (cli sample):
aws s3 cp s3://mySourceBucket/test.txt s3://myDestinationBucket/test.txt --acl public-read

Note that according to AWS, if you use --acl, your IAM policy must include the S3:PutObjectAcl action.

--acl (string) Sets the ACL for the object when the command is performed. If you use this parameter you must have the "s3:PutObjectAcl" permission included in the list of actions for your IAM policy. Only accepts values of private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control and log-delivery-write. See Canned ACL for details

A: You are trying to access the public URL for the S3 object and it works only if you open the bucket publically. You have to set your new bucket publically accessible and ALSO set the bucket policy such as:
{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"PublicRead",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::examplebucket/*"]
    }
  ]
}

where the examplebucket is the name for the bucket.


text:
Q: In Lotus Notes how can you change the date format? In Lotus Notes 8.5 how can you change the date format? I don't like 27/3/2013 and would like Wednesday 3, 2013 or the like.

A: Notes doesn't seem to provide a way for an ordinary user to do this. This article describes how to do it with Domino Designer.
The format isn't fixed as a search turned up various posts with different date formats. Some users suggested that changing the Windows Regional Settings will change what Notes shows. I tried this and it didn't have any effect.

A: In Windows 10, choose 'Additional date, time, regional settings';  choose 'change date, time or number formats; under 'Language Preferences' 'Long Date' ignore the dropdown options.  Manually type d mmmm yyyy.

A: I had the same issue and I just changed my computer clock settings and it automatically updated the format in my lotus notes ;)

A: Go to your computer setting

*

*Time & Language

*Region (on the left side of the screen)

*Regional format

*Choose Recommended [English (United States)]

*27/3/2013 changed to 3/27/2013

you can select different regional format as you prefer


text:
Q: Likert data and Likert scales - ordinal or interval? I was reading up on the use of Likert scales and how to analyse data. I found this bit of text confusing:

To properly analyze Likert data, one must understand the measurement scale represented by
each. Numbers assigned to Likert-type items express a "greater than" relationship; however,
how much greater is not implied. Because of these conditions, Likert-type items fall into the
ordinal measurement scale. Descriptive statistics recommended for ordinal measurement scale
items include a mode or median for central tendency and frequencies for variability. Additional
analysis procedures appropriate for ordinal scale items include the chi-square measure of
association, Kendall Tau B, and Kendall Tau C.

Likert scale data, on the other hand, are analyzed at the interval measurement scale. Likert
scale items are created by calculating a composite score (sum or mean) from four or more type
Likert-type items; therefore, the composite score for Likert scales should be analyzed at the
interval measurement scale. Descriptive statistics recommended for interval scale items include
the mean for central tendency and standard deviations for variability. Additional data analysis
procedures appropriate for interval scale items would include the Pearson's r, t-test, ANOVA,
and regression procedures

Why is it that when we take a mean of several ordinal items we can suddenly treat it as interval data?


text:
Q: Use Axios(Mock) in test environment I'm trying to integrate axios into my test environment. So far, however, I get the error below when starting the test. I use React testing library with Jest
table.test.js:
import { expect, jest, test } from "@jest/globals";
import { fireEvent, render, screen } from "@testing-library/react";
import axios from "axios";
import "@testing-library/jest-dom";

jest.mock("axios", () => ({
 __esModule: true,
 default: {
 get: () => ({
   data: { id: 1, name: "Ben" },
  }),
 },
}));

Cannot find module 'axios' from 'src/components/Table/table.test.js'

dependencies
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",

A: You could use the axios-mock-adapter NPM package for this instead of making your own axios mock: https://github.com/ctimmerm/axios-mock-adapter


text:
Q: python Cmd module autocompletion error in nested interpreters I'm trying to create a debug console for the main console I'm writing using Cmd module.
The debug console should have all the main console attributes and ontop some more extentions used for debug and advanced users.
The best answer to fir my needs was the second answer of the following post:
object inheritance and nested cmd
My implementation currently looks like this:
class MainConsole(cmd.Cmd):
    def __init__(self):
       cmd.Cmd.__init__(self)

    def do_something(self, line):
       print "do something!"
       return

    def do_something2(self, line):
       print "do something2!"
       return

class SubConsole1(cmd.Cmd):
    def __init__(self, maincon):
        cmd.Cmd.__init__(self)
        self.maincon = maincon
        self.register_main_console_methods()

    def register_main_console_methods(self):
        main_names = self.maincon.get_names()
        for name in main_names:
            if (name[:3] == 'do_') or (name[:5] == 'help_') or (name[:9] == 'complete_'):
                self.__dict__[name] = getattr(self.maincon, name)

Observation:
When I hit "help", I indeed see all the upper console methods and I'm able to invoke them.
Problem:
The autocompletion of the actual commands is not available.
The expected behaviour of the shell when hitting "some" and tab would be to autocomplete it to "something". This doesn't happen.
When I tried to debug the issue, I found out that self.get_names() method which is used by the self.completenames() function returns the list of methods before the registration.
So what's actually happening is that the newly added methods are "removed" from the nested console, although I can invoke them.
I'd love some insights on that.
Thanks!

A: You can solve your problem by extending get_names method
import cmd

class MainConsole(cmd.Cmd):
    def __init__(self,console_id):
       cmd.Cmd.__init__(self)
       self.console_id = console_id
    def do_something(self, line):
       print "do something!",self.console_id
       return

    def do_something2(self, line):
       print "do something2!",self.console_id
       return

class SubConsole1(cmd.Cmd):

    def __init__(self, maincon):
        cmd.Cmd.__init__(self)
        self.maincon = maincon
        self.register_main_console_methods()

    def do_super_commands(self,line):
        print "do supercommand",self.maincon

    def register_main_console_methods(self):
        main_names = dir(self.maincon)
        for name in main_names:
            for prefix in 'do_','help_','complete_', :
                if name.startswith(prefix) and name not in dir(self):
                    self.__dict__[name] = getattr(self.maincon, name)

    def get_names(self):
        result = cmd.Cmd.get_names(self)
        result+=self.maincon.get_names()
        return result

SubConsole1(MainConsole("mainconsole")).cmdloop()

it is not guaranteed to work on subsequence version of python as it is undocumented behavior of python 2.7
EDIT: replacing the subclassing method by mainconsole as a member as required in comment
EDIT 2: don't replace the existing methods in SubConsole to keep method as do_help


text:
Q: Importing live streaming Eclipse project in Android Studio Well, I did quite a lot study on importing eclipse project to android studio with libraries.But, could not find a solution for my problem. I had started a project of live streaming in eclipse last year and want to move it to android studio.I tried it with lot of different ideas but yet not could fix it. I have used libstreaming library previously and want to use the same again. Please suggest me what I need to do for it.I get this error.
Error:Execution failed for task ':libstreaming:processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/developer/Desktop/android-sdk-linux/24.0.0/aapt'' finished with non-zero exit value 2


text:
Q: Why Eclipse does not recognize JavaFX, Even after adding JavaFx user libararies? All Added Libraries in Eclipse
I am using everything with latest version. Still all those red warnings dont go away. You should check image up. Thanks.

A: All videos and tutorials recommanded adding JavaFX as user libraries to Classpath. This does not work at all. Adding JavaFX User library under Modulepath only worked. I done everything correctly but adding user libraries under class did not solve the problem. My problem is now solved. Please feel free to comment or suggest if anything I did wrong.
Image of added libaries and problem solved no red errors showing.


text:
Q: Running WinForms Apps in DotNet Framework Container Is it at all possible to run apps that use winforms in Windows docker containers? All of our software heavily relies on winforms, however it is possible to run all of these tools without interacting with the GUI. I attempted to debug the launcher from inside the container and I noticed the application stopped at the Run function for the WindowsFormsApplicationBase base class.
using Microsoft.VisualBasic.ApplicationServices;

namespace Program
{
   static class Program
   {
      [STAThread]
      static void Main(string[] args)
      {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);

         MyApp myApp = new MyApp();
         myApp.Run(args);
      }
   }

   class MyApp : WindowsFormsApplicationBase
}

Call Stack
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData)  Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context)    Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) Unknown
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() Unknown
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()    Unknown
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(string[] commandLine)   Unknown
MyApp.exe!MyApp.Program.Main(string[] args) Line 49 C#

A: Winforms do work in the dotnet/framework/sdk image. This was tested by creating a simple winforms app that created an empty text file on form showing and form closing since Windows Applications can't use Console.WriteLine().
namespace TestGUI_DockerApp
{
   public partial class Form1 : Form
   {
      private int i = 0;

      private void ExitTimerTick(object sender, EventArgs e)
      {
         i++;

         if (i > 4)
         {
            Close();
         }
      }

      protected override void OnFormClosed(FormClosedEventArgs e)
      {
         DateTime dateTime = DateTime.Now;

         string filename = $".\\{dateTime:yyyy_MM_dd_HH_mm_ss_fff}.txt";
         File.Create($".\\{filename}");

         base.OnFormClosed(e);
      }

      private void Form1_Shown(object sender, EventArgs e)
      {
         exitTimer.Enabled = true;

         DateTime dateTime = DateTime.Now;

         string filename = $".\\{dateTime:yyyy_MM_dd_HH_mm_ss_fff}.txt";
         File.Create($".\\{filename}");
      }
   }
}

I saw two different text files being created and the process closed shortly after that.
The error I was seeing in my original post was due to an unhandled exception being thrown somewhere else in the code. Since it was unhadled, the program was waiting for me to acknowledge it before closing. Since I couldn't acknowledge it, it appeared to be hanging.


text:
Q: unable to update interface props using useEffect in function component
*

*I'm trying to update channelInfo which is coming as props. Below is the interface in which it is coming from.
export interface GridChannelCellProps extends FocusViewInjectedProps {
  channel?: channelTile;
  channelInfo: GridGuideV5Channel | undefined;
  listItemIndex?: number;
  testID?: string;
  backgroundColor?: string;
  fastScroll?: boolean

*I saved channelInfo in a new constant.
  const [channelDetails, setChannelDetails] = useState(channelInfo);

*Now I'm passing channelInfo to useEffect as a second parameter to update it.
useEffect(() => {
  setShowAltText(!channel?.image?.url);
  setChannelDetails(channelInfo => channelInfo);
}, [channel, channelInfo]);

I'm not able to see any update in the UI, as I'm rendering A LIKE BUTTON component based on values in channelInfo .

*Meanwhile this is working on page reload, but I need to update the button without a reload.

A: In the following statement:
setChannelDetails(channelInfo => channelInfo);

You are setting the current state value of channelDetails to its previous value. Thus, keeping the same value and not making any update.
This is explained in the "Functional updates" section of the useState hook documentation:

If the new state is computed using the previous state, you can pass a function to setState. The function will receive the previous value, and return an updated value.

You should rather do the following, which would set the state value of channelDetails to the value of channelInfo that is received as a prop:
setChannelDetails(channelInfo);


text:
Q: need help in MediaPlayer class I've recently trying to build a simple android project. It will play a sound when the user click a button. When it was successfully compiled, the sound won't come off. I think it is the source code, but I don't know where the mistakes are
Here is my source code :
package com.jason.shootemup;

import java.util.Random;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

public class game extends Activity implements OnClickListener {

View shoot, reload;
int bullet = 5;
public static final Random r = new Random();

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gun);

shoot = findViewById (R.id.shoot);
reload = findViewById (R.id.reload);
reload.setVisibility(2);
shoot.setOnClickListener (this);
shoot.setOnClickListener (this);
}

@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.shoot :
            shoot_sequence ();
            break;
        case R.id.reload :
            Toast.makeText(this, "Reload !!", 10);
            reload_sequence();
            break;
    }
    // TODO Auto-generated method stub

}

private void shoot_sequence() {
    if (bullet > 0) {
        play_shoot_sound ();
        Toast.makeText(this, bullet+" left !!", 10);
        bullet = bullet - 1;
    }
    else {
        reload.setVisibility(0);
        shoot.setVisibility(2);
    }
    // TODO Auto-generated method stub
}

private void play_shoot_sound() {
    MediaPlayer mp = MediaPlayer.create(this, R.raw.shoot);
    mp.start();
    mp.stop();
    mp.release();
    // TODO Auto-generated method stub
}

private void reload_sequence() {
    play_reload_sound();
    bullet = r.nextInt(4) + 1;
    reload.setVisibility(2);
    shoot.setVisibility(0);
    // TODO Auto-generated method stub
}

private void play_reload_sound() {
    MediaPlayer mp = MediaPlayer.create(this, R.raw.reload);
    mp.start();
    mp.stop();
    mp.release();
    // TODO Auto-generated method stub
}
}

Let me know the mistakes... THX for the help

A: hi jason you r stopping and releasing as soon as the player is started. So stop it once it is completed. hopefully this code will help you
final MediaPlayer mPlayer=MediaPlayer.create(getBaseContext(), R.raw.reload);
    mPlayer.setOnCompletionListener(new OnCompletionListener() {

        @Override
        public void onCompletion(MediaPlayer mp) {
            //new Toast(getBaseContext());

            mPlayer.release();
            mPlayer = null;

        }
    });


text:
Q: Curly Braces in C and C++ Why does this Compile:
int main()
{
    {}
}

But this does not:
    {}

int main()
{
}

A: Because code defined in a global scope is not allowed in C. Remember, in C, every line of code but variable declaration/initialization must lie within a function.
If you are inside a function you can have all {} blocks you want.

A: First case, you're defining a block inside a function, which is allowed (it limits visibility).
Second case, you're defining an anonymous block, which is not allowed (it needs to be predeceded by a function definition, otherwise, the compiler will never know when it will have to execute it)

A: Because the only things that may appear at the top level of a translation unit are declarations or function definitions; compound statements (empty or not) may not appear at that level.

A: {} is a do-nothing statement (specifically in the C grammar it is an empty compound-statement). You can put statements in functions. You can't put statements elsewhere.
I suppose the reason the standard doesn't forbid an empty statement in your first example is that although it's pointless, it does no harm, and introducing rules for when braces are allowed to be empty would complicate the grammar for no benefit.
And, to be pedantic, I suppose I should point out that neither does the grammar define any other construct at file scope, of which {} is a valid instance, and that's why the second one is invalid.


text:
Q: Boostrap Mobile View Image Resize I have an issue when ever I am viewing the website in Mobile view its really stretched out I want it to stay on the screen. As you can see the image is really stretched out here: Mobile version
I want to be in the screen like the desktop version.

/*navbar colour*/
.navbar-default {
  background-color: #177f5e;
  border-color: #ffffff;
}
.navbar-default .navbar-brand {
  color: #ffffff;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
  color: #000000;
}
.navbar-default .navbar-text {
  color: #ffffff;
}
.navbar-default .navbar-nav > li > a {
  color: #ffffff;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: #000000;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
  color: #000000;
  background-color: #ffffff;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  color: #000000;
  background-color: #ffffff;
}
.navbar-default .navbar-toggle {
  border-color: #ffffff;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
  background-color: #ffffff;
}
.navbar-default .navbar-toggle .icon-bar {
  background-color: #ffffff;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
  border-color: #ffffff;
}
.navbar-default .navbar-link {
  color: #ffffff;
}
.navbar-default .navbar-link:hover {
  color: #000000;
}

@media (max-width: 767px) {
  .navbar-default .navbar-nav .open .dropdown-menu > li > a {
    color: #ffffff;
  }
  .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
  .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
    color: #000000;
  }
  .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
    color: #000000;
    background-color: #ffffff;
  }
}

/*whitespace*/
.navbar {
    position: relative;
    min-height: 50px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.navbar {
    margin-bottom: 0px;
}

/*bildspel*/
.carousel {
    height: 1000px;
  margin-bottom: 70px;
}
.carousel-caption {
  z-index: 10;
}
.carousel .item {
  height: 1000px;
  background-color: #777;
}
.carousel-inner > .item > img {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 100%;
  height: 1000px;
}
/*textstorlek.*/
.carousel-caption p {
  margin-bottom: 20px;
  font-size: 21px;
  line-height: 1.4;
}

.carousel-caption i {
  margin-bottom: 20px;
  font-size: 21px;
  line-height: 1.4;
}
/*Mer utrymme mellan bilderna.*/
.featurette-divider {
  margin: 80px 0;
}

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!DOCTYPE html>

    <meta charset="UTF-8">

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/custom-style-sheet.css" rel="stylesheet">

    <meta content="width=device-width, initial-scale=1" name="viewport">

    <meta content="add text." name="description">
    <meta name="keywords" content="Screen Brodyr i Kristianstad AB, Kristianstad, Skåne, brodyr, reklam, marknadsföring, kläder, design">
    <meta name="author" content="Screen Brodyr i Kristianstad AB">
    <title>Screen Brodyr i Kristianstad AB</title>

                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                        Toggle navigation

                    </button>
                    Screen Brodyr i Kristianstad AB

Om oss

Textiltryck

Värmetransfer

Brodyr

Digitaltryck

Tampotryck

Kontakt

Välkommen till Screen Brodyr i Kristianstad AB!

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

Text Dummy 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

Text Dummy 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

                Previous

                Next

A: Try this:
.carousel {
  margin-bottom: 70px;
}

.carousel-inner > .item > img {
  width:100%;
}

A: New changes are remove height from .carousel and add this height to  .carousel .item {height: 100vh; } and on .carousel-inner > .item > img {height: 100vh !important;}

remove your image class bootstrap has a default class "img-responsive" and set the css like this hope this will work
.carousel-inner > .item > img {
 min-width:100%;
 height:auto;
}

    /*navbar colour*/
    .navbar-default {
      background-color: #177f5e;
      border-color: #ffffff;
    }
    .navbar-default .navbar-brand {
      color: #ffffff;
    }
    .navbar-default .navbar-brand:hover,
    .navbar-default .navbar-brand:focus {
      color: #000000;
    }
    .navbar-default .navbar-text {
      color: #ffffff;
    }
    .navbar-default .navbar-nav > li > a {
      color: #ffffff;
    }
    .navbar-default .navbar-nav > li > a:hover,
    .navbar-default .navbar-nav > li > a:focus {
      color: #000000;
    }
    .navbar-default .navbar-nav > .active > a,
    .navbar-default .navbar-nav > .active > a:hover,
    .navbar-default .navbar-nav > .active > a:focus {
      color: #000000;
      background-color: #ffffff;
    }
    .navbar-default .navbar-nav > .open > a,
    .navbar-default .navbar-nav > .open > a:hover,
    .navbar-default .navbar-nav > .open > a:focus {
      color: #000000;
      background-color: #ffffff;
    }
    .navbar-default .navbar-toggle {
      border-color: #ffffff;
    }
    .navbar-default .navbar-toggle:hover,
    .navbar-default .navbar-toggle:focus {
      background-color: #ffffff;
    }
    .navbar-default .navbar-toggle .icon-bar {
      background-color: #ffffff;
    }
    .navbar-default .navbar-collapse,
    .navbar-default .navbar-form {
      border-color: #ffffff;
    }
    .navbar-default .navbar-link {
      color: #ffffff;
    }
    .navbar-default .navbar-link:hover {
      color: #000000;
    }

    @media (max-width: 767px) {
      .navbar-default .navbar-nav .open .dropdown-menu > li > a {
        color: #ffffff;
      }
      .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
      .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
        color: #000000;
      }
      .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
      .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
      .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
        color: #000000;
        background-color: #ffffff;
      }
    }

    /*whitespace*/
    .navbar {
        position: relative;
        min-height: 50px;
        margin-bottom: 20px;
        border: 1px solid transparent;
    }
    .navbar {
        margin-bottom: 0px;
    }

    /*bildspel*/
    .carousel {

      margin-bottom: 70px;
    }
    .carousel-caption {
      z-index: 10;
    }
    .carousel .item {
      height:100vh;

      background-color: #777;
    }
    .carousel-inner > .item > img {
      position: absolute;
      top: 0;
      left: 0;
      min-width: 100%;
      height: 100vh !important;
    }
    /*textstorlek.*/
    .carousel-caption p {
      margin-bottom: 20px;
      font-size: 21px;
      line-height: 1.4;
    }

    .carousel-caption i {
      margin-bottom: 20px;
      font-size: 21px;
      line-height: 1.4;
    }
    /*Mer utrymme mellan bilderna.*/
    .featurette-divider {
      margin: 80px 0;
    }

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

    <!DOCTYPE html>

        <meta charset="UTF-8">

        <link href="css/bootstrap.min.css" rel="stylesheet">

        <link href="css/custom-style-sheet.css" rel="stylesheet">

        <meta content="width=device-width, initial-scale=1" name="viewport">

        <meta content="add text." name="description">
        <meta name="keywords" content="Screen Brodyr i Kristianstad AB, Kristianstad, Skåne, brodyr, reklam, marknadsföring, kläder, design">
        <meta name="author" content="Screen Brodyr i Kristianstad AB">
        <title>Screen Brodyr i Kristianstad AB</title>

                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                            Toggle navigation

                        </button>
                        Screen Brodyr i Kristianstad AB

Om oss

Textiltryck

Värmetransfer

Brodyr

Digitaltryck

Tampotryck

Kontakt

Välkommen till Screen Brodyr i Kristianstad AB!

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

Text Dummy 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

Text Dummy 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

                    Previous

                    Next


text:
Q: This field cannot be summarized in crystal report errors I was be able to output a crystal report and this is about accounting logic.
some of the column appear in my crystal report is eg.
accountname debit credit

cash..........1000...300
I want the column debit minus column credit (1000-300)
if the result is positive (+) then 700 will appear in that debit column
If the result is negative (-) then the value appear in credit column and i wan to remove the negative sign. So above value 1000 and 300 is not what i wan to show and debit or credit will be 0 eg
accountname debit credit

cash...........700......0
Above case is ok so far and now i end up like this
In crystal report formula editor i have @creditbalance, and inside it has formula:
if Sum ({Entries.Debit}, {Entries.AccountName})>Sum ({Entries.Credit}, {Entries.AccountName}) then
formula= Sum ({Entries.Debit}, {Entries.AccountName})-Sum ({Entries.Credit}, {Entries.AccountName})
end if
So it can give me as i wanted to show (the 700 and 0 part)
The problem is i create another formula
@TotalDebitBalance
Sum ({@DebitBalance})
It error said "This field cannot be summarized", Then how to sum up the value i get from @debitBalance.
Note: @TotalDebitBalance i plan to put it at report footer section where all grant total usually placed there, where @debitbalance i put it at Group Header section.

A: *

*Right click the report.

*Insert.

*Summary Fields.

*Select the formula you have done on the field and change from max to sum

*Change Location to Group Footer

*Do the same again and this time select the Report Footer

You will have two fields, one for the group footer and other for report footer, hope this helps.

A: It doesn't say but I'm assuming the report is grouped by {Entries.AccountName}.  In addition to Waqar's solution, I'd replace the formula with something easier.
{@DebitBalance}
IF {Entries.Debit} > {Entries.Credit} THEN
   {Entries.Debit} - {Entries.Credit}
ELSE
   0

{@CreditBalance}
IF {Entries.Debit} < {Entries.Credit} THEN
   ABS({Entries.Debit} - {Entries.Credit})
ELSE
   0

In the details section, replace the {Entries.Debit} and {Entries.Credit} with {@DebitBalance} and {@CreditBalance} repectively.  This will give you the
cash...........700......0
Then do as Waqar mentioned to summarize the formula.  It's easier to use the Group... and Summary... features than to do it manually in the formulas.


text:
Q: Android onGestureListener and onTouchListner I am working in android. I have some functionality which is to be done on these following methods:-
1. MotionEvent.ACTION_DOWN
2. MotionEvent.ACTION_UP
3. MotionEvent.ACTION_MOVE

and i also want to do fling() on that image.
For above requirement i implemented onGestureListener and onTouchListener in my application, but these are not working properly. onTouchListener is working but onGestureListener is not working. When i remove onTouchListner code then onGestureListener is working correctly.
So please suggest me what should i do for this. I want to implement these four methods in my application.
1. MotionEvent.ACTION_DOWN
2. MotionEvent.ACTION_UP
3. MotionEvent.ACTION_MOVE
4. onFling

A: You can acheive this by implementing the OnGestureListener from your activity overriding the below methods
// For touch
public boolean onSingleTapUp(MotionEvent event) { return false; }

// For Fling
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
        float velocityY) {
    return false;
}

Hope this helps.

EDIT 1: Detailed explanation:
1> implement the OnGestureListener from your activity
public class MyActivity implements OnGestureListener

2> create an instance of GestureDetector:
private GestureDetector gestureScanner;

And at onCreate:
// Avoid a deprecated constructor
// (http://developer.android.com/reference/android/view/GestureDetector.html)
gestureScanner = new GestureDetector(this, this);

3> Override the below methods:
@Override
public boolean onTouchEvent(MotionEvent event) {
    return gestureScanner.onTouchEvent(event);
}

@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
        float velocityY) {
    /* on scroll to the next page in story */

    if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE
            && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
        // ...
    }
    /* on scroll to the previous page in story */
    else if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE
            && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
        // ...
    }

    return false;
}

@Override
public boolean onSingleTapUp(MotionEvent event) {
    return false;
}

EDIT 2: For handling Move
Override the onScroll method have a look at the details here

A: Just as a word of advice coming from a fellow Android developer who has chased down the primrose path of the swipe or fling event... When writing a listener or trying to implement the OnGestureListener class be sure to have import android.view.GestureDetector.OnGestureListener in your imports.
Otherwise the OnGesturListener will be using a GestureOverlayView's imports and that's not  what it seems you are looking for. Those are helpful especially when trying to implement gesture captures using the Gestures application and importing the saved gestures and creating a Gestures Library for your application during run time to then "predict" what the user is doing by running some fancy algorithm in the background and seeing who deviates the least from the user's input. Which turns out to be an array of locations that came in from the OS as the dragged their little stubby fingers across the flat screen... It's a different approach than just trying to capture a fling, or long press. Which seems as what the users are looking for above and not some fancy multi-press gesture capture, which this approach makes very simple. This technique is also very helpful in video games and giving possibly a "backdoor" to any people out there who like to develop games. Or in the 9-5 world, to put a Support or Admin backdoor into your mobile application to hide some settings or logs from everyday users. In which one can also use the above intended techniques but then you have to get an array of points, or locations across the screen and it gets tedious for any non-math people or self taught developers. Hope I contributed or helped anyone. No one mentioned this to me when I was learning this and I never found it in any of the several books I have read about Android also.


text:
Q: How to send emails with nodemailer and dreamhost (on Node.js server) I can't find any helpful posts specific to sending emails from dreamhost using nodemailer. I did find a dreamhost article for sending emails via PHP so maybe that can help point us in the right direction...
Either way here's my mailer.ts file:
import { createTransport, getTestMessageUrl } from "nodemailer";

import { frontendURL } from "./urls";

var transport = createTransport({
  host: "smtp.dreamhost.com",
  port: 465,
  auth: {
    user: encodeURIComponent(process.env.PROD_MAIL_USER),
    pass: encodeURIComponent(process.env.PROD_MAIL_PASS),
  },
  secure: true,
});

function generateHTML(resetToken: string) {
    return `

Hello from HaBits

          Your Password Reset Token is here!

          Reset your password.

HaBits ✅

    `;
}

export interface MailResponse {
  accepted?: string[] | null;
  rejected?: null[] | null;
  envelopeTime: number;
  messageTime: number;
  messageSize: number;
  response: string;
  envelope: Envelope;
  messageId: string;
}

export interface Envelope {
  from: string;
  to?: string[] | null;
}

export async function sendPasswordResetEmail(
  resetToken: string,
  to: string
): Promise<void> {
  // email the user a token
  const info = await transport.sendMail({
    to,
    from: process.env.PROD_MAIL_USER,
    subject: "✅ HaBits – password reset token",
    html: generateHTML(resetToken),
  });
}

Error response in production:
{
    "errors": [
        {
            "message": "Invalid login: 535 5.7.8 Error: authentication failed: ",
            "locations": [
                {
                    "line": 2,
                    "column": 3
                }
            ],
            "path": [
                "sendUserPasswordResetLink"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "exception": {
                    "code": "EAUTH",
                    "response": "535 5.7.8 Error: authentication failed: ",
                    "responseCode": 535,
                    "command": "AUTH PLAIN",
                    "stacktrace": [
                        "Error: Invalid login: 535 5.7.8 Error: authentication failed: ",
                        "    at SMTPConnection._formatError (/workspace/backend/node_modules/nodemailer/lib/smtp-connection/index.js:784:19)",
                        "    at SMTPConnection._actionAUTHComplete (/workspace/backend/node_modules/nodemailer/lib/smtp-connection/index.js:1536:34)",
                        "    at SMTPConnection.<anonymous> (/workspace/backend/node_modules/nodemailer/lib/smtp-connection/index.js:540:26)",
                        "    at SMTPConnection._processResponse (/workspace/backend/node_modules/nodemailer/lib/smtp-connection/index.js:947:20)",
                        "    at SMTPConnection._onData (/workspace/backend/node_modules/nodemailer/lib/smtp-connection/index.js:749:14)",
                        "    at TLSSocket.SMTPConnection._onSocketData (/workspace/backend/node_modules/nodemailer/lib/smtp-connection/index.js:189:44)",
                        "    at TLSSocket.emit (node:events:390:28)",
                        "    at addChunk (node:internal/streams/readable:315:12)",
                        "    at readableAddChunk (node:internal/streams/readable:289:9)",
                        "    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)",
                        "    at TLSWrap.onStreamRead (node:internal/stream_base_commons:199:23)"
                    ]
                }
            },
            "name": "GraphQLError"
        }
    ]
}

Dreamhost "support" just sent me the article for PHP which suggests using host: "ssl://smtp.dreamhost.com" but that just returns a less helpful "can't find address" error:

Error: getaddrinfo ENOTFOUND ssl://smtp.dreamhost.com

So I'm fairly confident the nodemailer config is correct – ie. host, port, user and password

A: This was my own silly mistake ♂
Here's the nodemailer config to send emails in production (assuming you have an email hosted by dreamhost):
import { createTransport, getTestMessageUrl } from "nodemailer";

var transport = createTransport({
  host: "smtp.dreamhost.com",
  port: 465,
  auth: {
    user: process.env.PROD_MAIL_USER, // your email address
    pass: process.env.PROD_MAIL_PASS, // your webmail password
  },
  secure: true,
  logger: true,
  debug: true,
});

// ...

await transport.sendMail({ ... })

My issue was the encodeURIComponent() wrapped around my email and password – so email hello@example.com was being passed as hello%40example.com.
The logger and debugger properties above are optional but they helped me identify the issue in my server logs.


text:
Q: Copiar varias tablas con mismo prefijo necesito pedirles consejo.
Tengo una base con mas de 100 tablas, de las cuales varias tienen un prefijo que las asemeja, como ejemplo 'TBS01_nombretabla', 'TBS01_nombretabla2', 'TBS01_nombretabla3' y asi sucesivamente... El asunto es que necesito copiar todas estas tablas con prefijo incial 'TBS01_' a otra base, y hacer esta misma operacion, para otras bases mas con el mismo caso, ya que trate de realizarlo con Select Into, pero tendria que hacer una query enorme para mas de 50 tablas por base.
Espero se entienda y ojala puedan ayudarme.

A: El siguiente script construye y ejecuta de manera dinámica una sentencia select/into para cada tabla que cumpla con el patrón de búsqueda, en una base de datos llamada copia.
Debes ajustar el nombre de la base de datos de destino.
declare @tableName sysname;
declare @sSQL nvarchar(max);

declare cTablas cursor for
select name
  from sys.tables
 where name like 'TBS01%';

open cTablas;

fetch next from cTablas into @tableName;

while @@FETCH_STATUS = 0
begin
  print 'Trasladando ' + @tableName;
  set @sSQL = 'select * into [copia].dbo.' + QUOTENAME(@tableName) + ' from ' + QUOTENAME(@tableName);
  exec sp_executesql @sSQL;
  fetch next from cTablas into @tableName;
end;

close cTablas;
deallocate cTablas;

Debes tener en cuenta que este script replicará los datos, pero no otros objetos, tales como índices, llaves foráneas y otros constraints que puedan estar definidos en las tablas.
Las tablas deben no existir en la base de datos destino.
Si las tablas ya existen y tienen la misma estructura, entonces, este script hará el trabajo:
declare @tableName sysname;
declare @sSQL nvarchar(max);

declare cTablas cursor for
select name
  from sys.tables
 where name like 'TBS01%';

open cTablas;

fetch next from cTablas into @tableName;

while @@FETCH_STATUS = 0
begin
  print 'Trasladando ' + @tableName;
  set @sSQL = 'insert into [copia].dbo.' + QUOTENAME(@tableName) + ' select *  from ' + QUOTENAME(@tableName);
  exec sp_executesql @sSQL;
  fetch next from cTablas into @tableName;
end;

close cTablas;
deallocate cTablas;

El script no toma en cuenta relaciones jerárquicas que puedan haber entre las tablas, ya que va ejecutando de manera secuencial según se encuentra la información en el diccionario de datos.
Por lo mismo, si hay constraints, por ejemplo, llaves foráneas, es mejor desactivarlas antes de iniciar y activarlas al finalizar.


text:
Q: Impicit Conversion with PLAIN Binding I am trying to create an implicit cast within WPF.
Lets say we have an enum:
public enum MyEnum
{
    A1,
    B2,
    C3,
    D5
}

I want to swap the displayed value in a ComboBox with something different. So I create a wrapper class:
public class EnumDisplay
{
    public object Value { get; set; }
    public String Text { get; set; }
}

I populate a collection with some instances like
new EnumDispay
{
    Value = MyEnum.A1,
    Text = "Foo"
}

What we usually do create the binding for a ComboBox like this:
<ComboBox ItemsSource="{Binding WhatEver}"
          SelectedValuePath="Value"
          SelectedValue="{Binding Val}"/>

Works like a charm - but I would like to use a simplified/straight Forward binding. No Converters, no Display/Value Path. Just plain binding like this:
<ComboBox ItemsSource="{Binding WhatEver}"
          SelectedItem="{Binding Val}"/>

I tried adding a TypeConverter attribute to my EnumDispay class
[TypeConverter(typeof(EnumDisplayTypeConverter))]

but it seems only to be used to convert my EnumDisplay class into Strings...
public class EnumDisplayTypeConverter : TypeConverter
{
    public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
    {
        //never called
        return base.CanConvertFrom(context, sourceType);
    }

    public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
    {
        //desttype is always String
        if (context != null)
        {
            if (context.Instance != null)
            {
                if (context.Instance.GetType() == typeof(EnumDisplay))
                {
                    return true;
                }
            }
        }
        return false;
    }

    public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
    {
        //never called
        return base.ConvertFrom(context, culture, value);
    }

    public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
    {
        //desttype is always String
        var t = value as EnumDisplay;
        if (t != null)
        {
            return t.Value.ToString();
        }
        return base.ConvertTo(context, culture, value, destinationType);
    }
}

Still, I Keep receiving the usual WPF Conversion Exception:
System.Windows.Data Error: 23 : Cannot convert 'bbb' from type 'EnumDisplay' to type MyEnum' with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException:...
   bei System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
   bei System.ComponentModel.TypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   bei System.ComponentModel.EnumConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   bei MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)'
System.Windows.Data Error: 7 : ConvertBack cannot convert value 'bbb' (type 'EnumDisplay'). BindingExpression:Path=Val; DataItem='MainVM' (HashCode=30659444); target element is 'ComboBox' (Name=''); target property is 'SelectedItem' (type 'Object') NotSupportedException:'System.NotSupportedException: EnumConverter...
   bei MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)
   bei MS.Internal.Data.ObjectTargetConverter.ConvertBack(Object o, Type type, Object parameter, CultureInfo culture)
   bei System.Windows.Data.BindingExpression.ConvertBackHelper(IValueConverter converter, Object value, Type sourceType, Object parameter, CultureInfo culture)'

It seems, the default EnumConverter is still used. What am I missing here?
UPDATE
I created a simple converter to cast an enum into an EnumDisplay:
public class SomeTypeConverter : TypeConverter
{
    public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
    {
        if (value is EnumDisplay)
        {
            return (value as EnumDisplay).Value;
        }
        return base.ConvertFrom(context, culture, value);
    }
}

Since WPF uses TypeDescriptor for converter Lookup, all I have to do is:
TypeDescriptor.AddAttributes(typeof(MyEnum), new TypeConverterAttribute(typeof(SomeTypeConverter)));

It works perfectly fine in one Direction.
But if I do something like this:
ViewModel.Val = MyEnum.D5

The ComboBox appears to have no selected value anymore (ChangeNotification is implemented). Also Providing a SelectedValuePath Property will solve this, but this is what I want to avoid!

A: You should apply a [TypeConverter(...)] attribute to your enum type and implement CanConvertFrom and ConvertFrom. For EnumDisplay, you can either override ToString or use a TypeConverter that implements CanConvertTo and ConvertTo.
When WPF tries to display an instance of your EnumDisplay class, it'll check if EnumDisplay has a TypeConverter. If so, it will use it to convert your EnumDisplay - if possible to a UIElement, otherwise to a string. If converting to a string is possible and you've overridden ToString, then it'll call that instead, otherwise the conversion is routed through EnumDisplay's TypeConverter. Only CanConvertTo and ConvertTo are used here.
When the binding system tries to update the source property of a binding however, it checks if the type of that property has a TypeConverter. In other words, if MyEnum has a TypeConverter. If it does, it'll call ConvertFrom on it. It may or may not call CanConvertFrom, probably depending on what version of WPF you're using. Just implement both to be safe.

A: You can use the following EnumExtensions to make think easier even if it does not implicit cast your ENUM
public static string GetDescription(this Enum value)
{
    Type type = value.GetType();
    string name = Enum.GetName(type, value);
    if (name != null)
    {
        FieldInfo field = type.GetField(name);
        if (field != null)
        {
            var attr = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) as DescriptionAttribute;
            if (attr != null)
            {
                return attr.Description;
            }
        }
    }
    return value.ToString();
}

public static Dictionary<T, string> EnumToDictionary<T>()
{
    var enumType = typeof(T);

    if (!enumType.IsEnum)
        throw new ArgumentException("T must be of type System.Enum");

    return Enum.GetValues(enumType)
               .Cast<T>()
               .ToDictionary(k => k, v => ( v as Enum ).GetDescription());
}

Enum
using System.ComponentModel;

public enum MyEnum
{
    [Description("foo1")]
    A1,
    [Description("foo2")]
    B2,
    [Description("foo3")]
    C3,
    [Description("foo4")]
    D5
}

ViewModel.cs
public Dictionary<MyEnum, string> Dict
{
    get { return EnumExtension.EnumToDictionary<MyEnum>(); }
}

private MyEnum _selectedValue;

public MyEnum SelectedValue
{
    get { return _selectedValue; }
    set
    {
        _selectedValue= value;

        RaisePropertyChanged(() => Reg(() => SelectedValue));
    }
}

View.xaml
    <ComboBox DisplayMemberPath="Value"
              SelectedValuePath="Key"
              ItemsSource="{Binding Dict}"
               SelectedValue="{Binding SelectedValue}"/>


text:
Q: converting html form to use django form library I am new to django and I didnt know that it included a forms library. I have written a dynamic form in html and javascript that shows checkboxes and if clicked, they display more input fields.
I am wondering if there is an easy way to adapt the code that I have already written to use django's forms library since it is so much easier and cleaner to access the form's data with djangos built-in methods.
Also, if i want the form to be dynamic do I need to use formset or does the form library have those capabilities?
Here is the code I would like to convert to use the Forms library:

<form name="myform" action="resultsget" method = "get" >
        <fieldset>
            <input type="checkbox" value="total_money" id = "money_check" name="check" onchange="javascript:ifChecked('money_check','money');" /> Filter by Total Money

                    <input type="checkbox" value="more" id="money_condition" onchange="javascript:ifCheckedLine('money_condition', 'money_text');"  name="condition"/>  >

                            <input type="text" id="money_box" name="money_name" value="lower limit" />

                    <input type="checkbox" value="less" id="money_condition1" onchange="javascript:ifCheckedLine('money_condition1', 'money_text1');" name="condition"/>  <

                            <input type="text" id="money_box1" name="money_name1" value="upper limit" />

</fieldset>

    <input type="submit" value="Submit" />
</form>

I would also like to know what I have to put in my views.py file to read the form information
Thanks!!

A: With django forms you can build a form with fields that you want and using template render it.
Processing of a form will become easy when you build a django form. Refer Working with forms
For dynamic enabling/disabling fields, the code you have written can be used with a change that use 'id' that django puts in for form field. I will suggest to use jQuery to set event handlers for the elements.


text:
Q: Cannot bind radio button input in vue js? I gone through the documentation and I tried the following code. I am able to get the data for enquiryDesc but getting null values for rating. I tried several steps and getting null values.
My html form is
<form id="enquiryBox" method="POST" onSubmit="return false;" data-parsley-validate="true" v-on:submit="handelSubmit($event);">

          <fieldset class="rating">
            <input v-model="rating" type="radio" id="rating" name="rating" value="5" >
               <input v-model="rating" type="radio" id="rating" name="rating" value="4" >
               </fieldset>

          Enquiry
          <textarea placeholder="Write your enquiry here" rows="7" id="enquiryDesc" name="enquiryDesc" class="form-control required" title="Desc" v-model="enquiryDesc" required="required"></textarea>

    <button id="btn-submit-enquiry" class="btn whiteButton" type="submit">Post Enquiry</button>

</form>

My vue js script is as
enquiryBox = new Vue({
   el: "#enquiryBox",
   data: {
     rating: '',
     enquiryDesc: '',
   },
   methods: {
     handelSubmit: function(e) {
       var vm = this;
       data = {};
       data['rating'] = this.rating;
       data['enquiryDesc'] = this.enquiryDesc;
       console.log(data);

       $.ajax({
         url: 'https://api/post/add_review/',
         data: data,
         type: "POST",
         dataType: 'json',
         success: function(e) {
           if (e.status) {
             alert("Success")

           } else {
             vm.response = e;

             alert(" Failed")
           }
         }
       });
       return false;
     }
   },
 });

My response for console.log(data)

{rating: "", enquiryDesc: "cg"}

I have used v-model and v-bind:value and now to I am not the values. I am really stuck on these. Is something not initialized? Please help me to have a solution.I have gone through several tutorials and everything says to do in the same way.


text:
Q: Declaring nested components in Angular Dart After playing and experimenting a lot with Angular Dart, I'm writing now my first true (as in "going to be used in my company by real users") application. And I've stumbled upon a problem I haven't be able to find an answer in the net : How to properly nest components?
I have some simple widgets, implemented as Components, and I have some more complex composite widgets including the simple ones.
Right now, I must declare all the components (simple and composite) with module..type() in the main dart file. But in a component paradigm the inner simple components should be encapsulated inside the composite components, i.e. not declared from the outside.
It would be great to have a way to get this encapsulation in components, allowing a Component to  declare and use inner components without having to declare each one of those inner components in the main application.
Is there a way to do it? My google-fu isn't usually bad, but I've found nothing on this topic...
Thanks in advance!

A: Create more modules and add them to MyAppModule with install
see for example at
- https://github.com/akserg/angular.dart.ui/blob/master/lib/accordion/accordion.dart
- https://github.com/akserg/angular.dart.ui/blob/master/lib/angular_ui.dart
accordion.dart
class AccordionModule extends Module {
  AccordionModule() {
    // old syntax
    type(AccordionComponent);
    type(AccordionHeadingComponent);
    type(AccordionGroupComponent);
    value(AccordionConfig, new AccordionConfig());
    // you could also use install() here not only in the main module

    // new Syntax
    bind(AccordionComponent);
    bind(AccordionHeadingComponent);
    bind(AccordionGroupComponent);
    bind(AccordionConfig, toValue: new AccordionConfig());
  }
}

angular_ui.dart
class AngularUIModule extends Module {
  AngularUIModule() {
    install(new AlertModule());
    install(new AccordionModule()); // the above module
    install(new ButtonModule());
    install(new CarouselModule());
    install(new CollapseModule());
    install(new DropdownToggleModule());
    install(new ProgressbarModule());
    install(new RatingModule());
    install(new TabsModule());
    install(new TimeoutModule());
    install(new TransitionModule());
    install(new ModalModule());
  }
}


text:
Q: OSX 10.8.2 Wiki Server file and database locations? OSX 10.8.2 with the Server.app installed.
Wiki server running.
where do these files live? (so that I can customize the CSS as well as back everything up.)
What databases so I need to backup and what is the best way to do this?

A: Does this Apple note help? http://support.apple.com/kb/HT5585
Or this? http://manuals.info.apple.com/en_US/WikiServerAdmin_v10.6.pdf
The location seems to be (see Chapter 6 of PDF, in 2d link) /Library/Collaboration/
OK, looking specifically for 10.8.x, I find this: /Library/Server/Wiki/FileData from here https://discussions.apple.com/message/20876865#20876865

A: As it turns out most everything is hosted in Postgres and not that customisable much beyond the functions they already allow.

A: By looking around in the Server.app package I found some relevant files here:
/Applications/Server.app/Contents/ServerRoot/private/etc/collabd

The wiki server runs as process collabd and is a child of ruby and is located in:
/Applications/Server.app/Contents/ServerRoot/usr/sbin/collabd

Oh and look, here are the files you asked for located:
/Applications/Server.app/Contents/ServerRoot/usr/share/collabd


text:
Q: Local install of APK in Android 13 Goal: Have an app that can update itself on a custom/rooted ROM in Android 13 by saving the APK locally, then having an app install it without user interaction.
Solution: Use an intention as described in the second answer here.
What no longer works:
Originally this was a question because after a lot of time I only found out-of-date answers. Android keeps on increasing security and deprecating old APIs. Here's a list of rabbit holes to avoid.

*

*Install with exec(), su, and pm install

*Granting the app android.permission.ACCESS_SUPERUSER and similar permissions

*Forcing ROM into permissive mode at compile to avoid SELINUX blocking access

Approach 1 fails because you will get Caused by: java.io.IOException: error=13, Permission denied. First you need to move the APK into a tmp dir. However when you try to run su you get the exception. You need to be su for pm install -r -d foobar.apk to work. This used to be the most common way that people installed a new apk. Even if there were no issues with it I would recommend using the answer above as its less of a hack.
Approach 2 seems to be just out of date and Android has moved on.
Approach 3 is an attempt to get around the su issue. It's unclear if SELINUX is really what was causing the exception to be thrown and maybe someone can clarify what's going on. SELINUX is what was blamed and a lot of people spent a lot of time trying to create custom rules.
To get something that worked I attempted to force the device into permissive mode. Using compile time flags doesn't work BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive and Google needs to update the instructions. I could write more here, but it's a black hole. Looking at logs there was no indication SELINUX was blocking 'su'.


text:
Q: android grid view place items from right to left I'm working on an android application with arabic version.
In one of the interfaces, I have gridView. So to display items in the correct order, I have to display items in the GridView from the right to the left (and of corse from the top to the bottom).
To do that, I tried to add these attributes in the GridView :
android:gravity="right"
android:layout_gravity="right"

Unfortunately, items still displayed from the left to the right.
any idea to do it in the right way ?

A: add this line to your GridView in XML:
android:layoutDirection="rtl"

A: You can achieve this by this ugly workaround:

*

*add this line to your GridView in XML:
android:rotationY="180"

*also add the same line to your GridView item in XML:
android:rotationY="180"
In total it gives you rotation by 360° so it looks like GridView places items from right to left.

A: Based on traninho's answer:

*

*add this line to your GridView in XML:
android:rotationY="180"

*also add the same line to your GridView item in XML:
android:rotationY="180"

do the following:

*

*On your GridActivity, delete this:
    gridView.setOnClickListener(...);

*Now, go to your gridAdapter and add onClickListener to the gridImage so, your code should look like the following:
    gridImage.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                //Do something

            }
        });

This will handle clicks normally on your GridView images.
Wish that helps :)

A: As Nibha Jain said, its right. Also you need to add a property "android:layoutAnimation" to the GridView xml as below.
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/grid"
    android:layoutAnimation="@anim/layout_grid_right_to_left"

and also you need to define an animation file with "android:direction" attribute, which actually renders your items from right to left or any supported direction.
The layout_grid_right_to_left.xml file inside anim folder
<gridLayoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
    android:columnDelay="0.5"
    android:directionPriority="row"
    android:direction="right_to_left"
    android:animation="@anim/fade" />

the @anim/fade is as below
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
   android:interpolator="@android:anim/accelerate_interpolator"
   android:fromAlpha="0.0" android:toAlpha="1.0"
   android:duration="@android:integer/config_longAnimTime" />

Its just my preferences. Please add/remove attributes that suites your needs. Play with it.

A: Create one new layout-ldrtl folder and make XML file grid view.
For example...
  <GridView
        android:id="@+id/popoulat_category_list"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scrollingCache="true"
        android:smoothScrollbar="true"
        android:numColumns="2"
        android:scrollbars="none"
        android:horizontalSpacing="-5dp"
        android:verticalSpacing="-5dp"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:layout_marginStart="5dp"
        android:layout_marginEnd="5dp"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="5dp"/>

Device local language is English:

Device local language is parsian:

A: In addition to the above answer:
android:layoutDirection="rtl"

Ideally, if you want to make it rtl aware, so only rtl in locales where it should be:
android:layoutDirection="locale"

You can also make it follow the containing layout
android:layoutDirection="inherit"


text:
Q: Getting Started with Unit Testing in C# with Visual Studio I know Visual Studio offers some Unit Testing goodies. How do I use them, how do you use them? What should I know about unit testing (assume I know nothing).
This question is similar but it does not address what Visual Studio can do, please do not mark this as a duplicate because of that. Posted as Community Wiki because I'm not trying to be a rep whore.

A: Easily the most significant difference is that the MSTest support is built in to Visual Studio and provides unit testing, code coverage and mocking support directly. In order to do the same types of things in the external (third-party) unit test frameworks generally requires multiple frameworks (a unit testing framework and a mocking framework) and other tools to do code coverage analysis.
The easist way to use the MSTest unit testing tools is to open the file you want to create unit tests for, right click in the editor window and choose the "Create Unit Tests..." menu from the context menu. I prefer putting my unit tests in a separate project, but that's just personal perference. Doing this will create a sort of "template" test class, which will contain test methods to allow you to test each of the functions and properties of your class. At that point, you need to determine what it means for the test to pass or fail (in other words, determine what should happen given a certain set of inputs).
Generally, you end up writing tests that look similar to this:
string stringVal = "This";
Assert.IsTrue(stringVal.Length == 4);

This says that for the varaible named stringVal, the Length property should be equal to 4 after the assignment.
The resources listed in the other thread should provide a good starting point to understandng what unit testing is in general.

A: The unit testing structure in VS is similar to NUnit in it's usage.  One interesting (and useful) feature of it does differ from NUnit significantly.  VS unit testing can be used with code that was not written with unit testing in mind.
You can build a unit testing framework after an application is written because the test structure allows you to externally reference method calls and use ramp-up and tear-down code to prep the test invironment.  For example: If you have a method within a class that uses resources that are external to the method, you can create them in the ramp-up class (which VS creates for you) and then test it in the unit test class (also created for you by VS).  When the test finishes, the tear-down class (yet again...provided for you by VS) will release resources and clean up.  This entire process exists outside of your application thus does not interfere with the code base.
The VS unit testing framework is actually a very well implemented and easy to use.  Best of all, you can use it with an application that was not designed with unit testing in mind (something that is not easy with NUnit).

A: First thing I would do is download a copy of TestDriven.Net to use as a test runner.  This will add a right-click menu that will let you run individual tests by right-clicking in the test method and selecting Run Test(s).  This also works for all tests in a class (right-click in class, but outside a method), a namespace (right click on project or in namespace outside a class), or a entire solution (right-click on solution).  It also adds the ability to run tests with coverage (built-in or nCover) or the debugger from the same right-click menu.
As far as setting up tests, generally I stick with the one test project per project and one test class per class under test.  Sometimes I will create test classes for aspects that run across a lot of classes, but not usually.  The typical way I create them is to first create the skeleton of the class -- no properties, no constructor, but with the first method that I want to test.  This method simply throws an NotImplementedException.
Once the class skeleton is created, I use the right-click Create Unit Tests in the method under test.  This brins up a dialog that lets you create a new test project or select an existing one.  I create, and name appropriately, a new test project and have the wizard create the classes.  Once this is done you may want to also create the private accessor functions for the class in the test project as well.  Sometimes these need to be updated (recreated) if your class changes substantially.
Now you have a test project and your first test.  Start by modifying the test to define a desired behavior of the method.  Write enough code to (just barely) pass the test.  continue on with writing tests/writing codes, specifying more behavior for the method until all of the behavior for the method is defined.  Then move onto the next method or class as appropriate until you have enough code to complete the feature that you are working on.
You can add more and different types of tests as required.  You can also set up your source code control to require that some or all tests pass before check in.


text:
Q: Insert escaped double quotes into MySQL JSON field I am trying to insert a stringified JSON which looks like this:
'{"test": "string with \"escaped quotes\" does not work"}'

into a MySQL JSON field, but I always get the error:

SQL Error (3140): Invalid JSON text: "Missing a comma or '}' after an object member."
  at position 24 in value (or column) '{"test": "string with "escaped quotes" does not work"}'.

Any idea what might be causing the issue?
The full INSERT statement is:
INSERT INTO test(json_test)
VALUES ('{"test": "string with \"escaped quotes\" does not work"}');

A: Let's create the table:
mysql> create table jsontest (id serial, value json);
Query OK, 0 rows affected (0.02 sec)

mysql> show create table jsontest\G
*************************** 1. row ***************************
Table: jsontest
Create Table: CREATE TABLE `jsontest` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `value` json DEFAULT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

And insert some JSON data/objects:
mysql> INSERT INTO jsontest(value) VALUES (JSON_OBJECT('test', 'string with "escaped quotes" does not work'));
Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO jsontest(value) VALUES ('{"test": "string with \\"escaped quotes\\" does not work"}');
Query OK, 1 row affected (0.01 sec)

mysql> select id, value->>"$.test" from jsontest;
+----+--------------------------------------------+
| id | value->>"$.test"                           |
+----+--------------------------------------------+
|  2 | string with "escaped quotes" does not work |
|  9 | string with "escaped quotes" does not work |
+----+--------------------------------------------+
2 rows in set (0.00 sec)

As you can see here you have to use the double backslash escape sequence because you don't want the SQL parser to perform the standard escape sequence processing but instead you want to pass the literal string containing the escape sequence down to the storage engine for the JSON data type processing.
I'll talk to the MySQL docs team about adding some examples and explanation for that here:
12.6 The JSON Data Type - Creating JSON Values

A: I would like to add that the value that gets inserted in the table using double slashes
INSERT INTO jsontest(value)
VALUES ('{"test": "string with \\"escaped quotes\\" does not work"}');

...would still be {"test": "string with \"escaped quotes\" does not work"} which is a valid Json format.
It's the way we are querying the inserted data that's making the difference here:
Example
mysql> select id, value->>"$.test" from jsontest;

gives:
"string with "escaped quotes" does not work"

as output, but if we query:
mysql>select value from jsontest;

...it will still reflect  {"test": "string with \"escaped quotes\" does not work"} as output. The good thing is using Json type we can directly query and extract values against the corresponding keys:
mysql> SELECT JSON_EXTRACT('{"id": 14, "SampleKey": "SampleValue"}', '$.SampleKey');

Gives "SampleValue" as output.
To use Json datatype the string being inserted should be a valid and properly formatted Json.