text:
Q: VPN endpoint for my IPhone? For my company I need to setup a VPN endpoint so that my users can securely login to my network.
Can anyone recommend a good server side software product/solution that can allow my Iphones to communicate to our network using VPN? (No VPN hardware solution to start with due to budget limits).
Also, is it possible to force all communication sent over the wire to go through the VPN tunnel? I mean traffic to non-company-network servers? Like web-sites....

A: the iPhone supports common VPN technologies like IPSec PPTP and L2TP
this Iphone VPN Guide might answer some of your questions about it
For a basic set up you might want to get a spare machine and loading Smoothwall or ipcop linux distributions. They have IPSec support built in, so it's quite easy to set up. This way you'll be able to experiment with some inexpensive hardware; figure out what works for you and implement it.

A: Try AccessMyLan, it's easy and cheap.  Plus it requires no up-front setup costs and can be deployed easily.  They support iPhones too.


text:
Q: When is require ever preferred over require_once in PHP? The way I see it, if a file has been included once then any object, function or member in it is defined.
require_once checks if the file is included and if so, doesn't include it again. But when would the event ever arise that someone would go 'this file has already been included so I can use the class inside it, but I'd better include it again because this script needs it'?
Am I missing something?

A: I use include_once / require_once for classes files, and include / require for html code (let's say a form for example). You shouldn't redeclare the class, but you could insert html code multiple times in your code.

A: In ye olde days before proper classes, I would sometimes use require inside a for or while loop when doing large imports. Along the same lines, template engines use it for repeated includes of the same file that should fail if the file is missing.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Error connecting to the service protocol: failed to connect to http I am running an application in a flutter, unfortunately, I got the same error, again and again, saying - Error connecting to the service protocol: failed to connect to http://127.0.0.1:-----/-------/
For the past 2 days, I'm struggling to get the fix but got no solution for this. I have updated my flutter and dart already. I have run the flutter doctor but found no issues in that. For more info, you can refer to the below screenshot!

Flutter Doctor logs.

PS D:\FlutterProjects_VSCode\New folder\flutter_application_1> flutter doctor -v
[√] Flutter (Channel stable, 2.0.6, on Microsoft Windows [Version 10.0.17134.1902], locale en-US)
    • Flutter version 2.0.6 at C:\flutter
    • Framework revision 1d9032c7e1 (3 days ago), 2021-04-29 17:37:58 -0700
    • Engine revision 05e680e202
    • Dart version 2.12.3

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\lenovo\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 51.0.1
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.55.2)
    • VS Code at C:\Users\lenovo\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.21.0

[√] Connected device (3 available)
    • HTC Desire 526GPLUS dual sim (mobile) • HQ53AYL09915 • android-arm    • Android 4.4.2 (API 19)
    • Chrome (web)                          • chrome       • web-javascript • Google Chrome 90.0.4430.93
    • Edge (web)                            • edge         • web-javascript • Microsoft Edge 90.0.818.51

• No issues found!

The Error I have got[Please refer to the below picture]:

Launching lib\main.dart on HTC Desire 526GPLUS dual sim in debug mode...
lib\main.dart:1
√ Built build\app\outputs\flutter-apk\app-debug.apk.
E/DartVM  (25735): vm-service: Error: Unhandled exception:
E/DartVM  (25735): Unimplemented handling of missing static target
E/DartVM  (25735): #0      new _HttpConnection.<anonymous closure> (dart:_http/http_impl.dart:2728:25)
E/DartVM  (25735): #1      _RootZone.runUnaryGuarded (dart:async/zone.dart:1546:10)
E/DartVM  (25735): #2      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
E/DartVM  (25735): #3      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
E/DartVM  (25735): #4      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
E/DartVM  (25735): #5      _StreamController._add (dart:async/stream_controller.dart:607:7)
E/DartVM  (25735): #6      _StreamController.add (dart:async/stream_controller.dart:554:5)
E/DartVM  (25735): #7      _HttpParser._headersEnd (dart:_http/http_parser.dart:387:19)
E/DartVM  (25735): #8      _HttpParser._doParse (dart:_http/http_parser.dart:745:15)
E/DartVM  (25735): #9      _HttpParser._parse (dart:_http/http_parser.dart:324:7)
E/DartVM  (25735): #10     _HttpParser._onData (dart:_http/http_parser.dart:858:5)
E/DartVM  (25735): #11     _RootZone.runUnaryGuarded (dart:async/zone.dart:1546:10)
E/DartVM  (25735): #12     _BufferingStreamSubscription._sendData (dart:async/st
Error connecting to the service protocol: failed to connect to http://127.0.0.1:***/********=/
Exited (sigterm)


text:
Q: Intuitive explanation of Inverse Wishart prior for covariance estimation I am trying to understand what is going on in the use of an Inverse Wishart prior for (Gaussian) covariance, and what is the motivation for it. I am seeing this posed as a solution for when the parameters being estimated do not have sufficiently many data samples to be estimated from.
I have looked a little in Murphy's book and Bishop's but I feel they are diving too quickly into technical details, leaving me in the dust. Any explanation or suggested reading is much appreciated.

A: I assume you are aware that Wishart matrices can be generated as the outer product $X^TX$ of a matrix where each row is an independent observation of a multivariate normal distribution, yes? So a Wishart prior might emerge from an assumption of multivariate normality in your data. The inverse Wishart is the distribution of the inverse of these outer products and is therefore also a distribution over SPD matrices. Choosing the inverse Wishart as prior guarantees a nice form for the posterior, but intuitively the Wishart is also a decent choice with the added benefit of not inversely penalizing matrices with large determinants.


text:
Q: Exporting a data extension messes up the date format I'm trying to export a Data Extension via a browser download. It is not a large data extension - around 2,000 records.
When I open up the exported file (a csv file), I get a mixture of two date formats:

There seems to be no logic to which date format it picks - m/dd/yyyy hh:mm AM/PM or mm/dd/yyyy hh:mm. Can anyone help?

A:
Hope it can help. I think you can use the 'Format Cells' functionality and choose the 'Date' in Excel. Then you can get the format you wanna.

A: It seems a datetime field in your CSV. You need to set the format of the column and then do the load.


text:
Q: Angular - Get Route data in app component I have the following routes configured in app-routing.module.ts
const routes: Routes = [
  {
    path: 'abc/:id', component: AbcComponent, data: { category: 'Public' }
  },
  {
    path: 'xyz/:id/tester/:mapId', component: XyzComponent, data: { category: 'Private' }
  },
  { path: '**', redirectTo: '/page-not-found', pathMatch: 'full'}
]

In app.component.ts I would like to get the category of each Route based on the URL passed:
Ex: going to http://myapp.com/abc/123  should return category as Public
going to http://myapp.com/xyz/123/tester/456  should return category as Private
Here is what I have so far:
constructor(
    private activatedRoute: ActivatedRoute,
    private router: Router
)
{
  checkRouteAndGetCategory()
}

checkRouteAndGetCategory()
{
  this.router.events.pipe(
        filter(event => event instanceof NavigationEnd),
        map(() => this.activatedRoute),
        map(route => {
          while (route.firstChild) route = route.firstChild
          return route
        }),
        filter(route => route.outlet === 'primary'),
        mergeMap(route => route.data)
      ).subscribe(data =>
        console.log('data', data)
      )
}

The above code does not seem to get the right route. Ex: If I am on http://myapp.com/abc/123 page and navigated to http://myapp.com/xyz/123/tester/456, it seems to get the data for  http://myapp.com/abc/123 page.

A: This is what I have in my app component
constructor(private route: ActivatedRoute) {
}

ngOnInit(): void {
  this.router.events.pipe(
    filter(event => event instanceof NavigationEnd),
    map(() => this.rootRoute(this.route)),
    filter((route: ActivatedRoute) => route.outlet === 'primary'),
    mergeMap((route: ActivatedRoute) => route.data)
  ).subscribe((event: {[name: string]: any}) => {
    this.titleService.setRouteTitle(event['title']);
  });
}

private rootRoute(route: ActivatedRoute): ActivatedRoute {
  while (route.firstChild) {
    route = route.firstChild;
  }
  return route;
}

Where my app routes look like:
{ path: 'login', component: LoginComponent, data: { title: 'Login' } }

And my title service is responsible for setting the title.
The only difference I see between mine and yours is that you bind to the router in your constructor and I do it in ngOnInit. Can you try calling what you have in ngOnInit? I'm not sure if this will make a difference, but it's worth a shot.

A: I would consider moving this to a service, say CategoryService
CategoryService
import { Injectable } from '@angular/core';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { filter, map, mergeMap } from 'rxjs/operators';

@Injectable({
  providedIn: 'root'
})
export class CategoryService {
  constructor(private router: Router ) { }
  private routerEvents =  this.router.events;
  private navigationEndEvent = this.routerEvents
    .pipe(filter(event => event instanceof NavigationEnd))
  category$ = this.navigationEndEvent
    .pipe(
      mergeMap(() => this.rootRoute(this.router.routerState.root).data),
      map(({category}: any) => category)
    )
  private rootRoute = (route: ActivatedRoute): ActivatedRoute => {
    return route.firstChild ? this.rootRoute(route.firstChild) : route;
  }
}

Component
constructor(private categoryService: CategoryService) {
  }
  category$ = this.categoryService.category$;
  ...
}

HTML
<span>{{ category$ | async }}</span>

Sample on Stackblitz

A: It's a short way to get route data in the component.
constructor(router:Router, route:ActivatedRoute) {
    router.events
      .filter(e => e instanceof NavigationEnd)
      .forEach(e => {
        this.title = route.root.firstChild.snapshot.data.category;
    });
}


text:
Q: While implementing StartApp ads , i am getting StartApp ads Error java.lang.NullPointerException The error is given below: _

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Enum.ordinal()' on a null object reference
                                                                                at com.startapp.android.publish.cache.g.i(StartAppSDK:277)
                                                                                at com.startapp.android.publish.cache.g.j(StartAppSDK:374)
                                                                                at com.startapp.android.publish.cache.g$1.onFailedToReceiveAd(StartAppSDK:356)
                                                                                at com.startapp.android.publish.cache.i$3$1.run(StartAppSDK:241)
                                                                                at android.os.Handler.handleCallback(Handler.java:754)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                at android.os.Looper.loop(Looper.java:163)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:6237)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Earlier it was working fine, but now this error is coming.
onCreate method I am calling this:
// StartAppSDK.init(this, "210075679", true);
setContentView(R.layout.activity_main);
StartAppSDK.init(MainActivity.this, "210075679", true);

A: I got my answer after adding this in Progaurd rules
-keep class com.startapp.** {*;}
-keepattributes Exceptions, InnerClasses, Signature, Deprecated,
SourceFile,LineNumberTable, *Annotation*, EnclosingMethod
-dontwarn android.webkit.JavascriptInterface


text:
Q: redirecting/reloading page in js.erb instead of controller My index.js.erb is refreshing the page only partially:
$("#view").html("<%= escape_javascript render 'view' %>");

I am able to refresh it fully in the controller with this line:
format.js { render :js => "window.location.replace('#{url_for(:controller => :view, :action => :index, :some_parameter => value)}');" }

Is it possible to refresh the page in js.erb?
edit:
I call index.js.erb by this command in the controller:
format.js { redirect_to(:action => :index, :format => :js, :some_parameter => value)},

It refreshes the page with the content for some_parameter, but refreshes it only partially.
window.location works better, but I read in one of stack overflow posts that it is better to use erb than controller for javascript. Is it really?

A: For the second way, you're refreshing the whole page( made another http request ) and if you want to do this, why not just use redirect_to?


text:
Q: SQL MAX Command still returning more one result I had this SQL Query working perfectly.  I made a few small changes to the database, and reran it and it simply stopped work.
My goal here is to join master_followups with followups_fb_messages.message_text but only return a single row for each UID in master_followups with the most RECENT followups_fb_messages.message_text joined to it.
SELECT master_followups.*,
  followups_fb_messages.message_text,
  followups_fb_messages.message_time
FROM
  master_followups
  LEFT JOIN followups_fb_messages
    ON master_followups.UID = followups_fb_messages.FID
    AND followups_fb_messages.message_time =
      (SELECT
        MAX(followups_fb_messages.message_time)
        FROM followups_fb_messages
        WHERE  followups_fb_messages.FID = master_followups.UID
      )

I've been trying to figure out what happened for the last hour.
Instead of returning 100 results as expected, this is returning 340.   I checked the database and it shows 100 rows in master_followups and 340 rows in followups_fb_messages.
I had this exact query working fine about an hour ago, then it stopped.  Maybe I changed something, but I can't see it.

A: Try this one up.
SELECT  a.*,
        b.*
FROM    master_followups a
        LEFT JOIN followups_fb_messages b
            ON a.UID = b.FID
        LEFT JOIN
        (
            SELECT  FID, MAX(message_time) maxTime
            FROM    followups_fb_messages
            GROUP BY FID
        ) c ON b.FID = c.FID AND
                b.message_TIME = c.maxTime

A: Presumably, the reason you are getting duplicates is that more than one row has the maximum message time.  Here is one way you can fix this:
 SELECT master_followups.*,
        ffm.message_text,
        ffm.message_time
FROM master_followups LEFT JOIN
     (select *, row_number() over (partition by fid order by message_time desc) seqnum
      from followups_fb_messages
     ) ffm
     ON master_followups.UID = ffm.FID and
        seqnum = 1

This finds the maximum row based on message_time, but only chooses one row if there are duplicates.

A: Let's use some TDQD — Test-Driven Query Design.
Time of most recent follow-up message for each ID
SELECT FID, MAX(message_time) AS MostRecent
  FROM followups_fb_messages
 GROUP BY FID

Most Recent Follow-up Message Information for each ID
SELECT a.*
  FROM followups_fb_messages AS a
  JOIN (SELECT FID, MAX(message_time) AS MostRecent
          FROM followups_fb_messages
         GROUP BY FID
       ) AS b ON a.FID = b.FID AND a.message_time = b.MostRecent

Note that this is a regular inner join, not an OUTER join.
Master Follow-up Information and Follow-up Message Information
SELECT m.*, f.message_text
  FROM master_followups AS m
  LEFT JOIN
       (SELECT a.FID, a.message_text
          FROM followups_fb_messages AS a
          JOIN (SELECT FID, MAX(message_time) AS MostRecent
                  FROM followups_fb_messages
                 GROUP BY FID
               ) AS b ON a.FID = b.FID AND a.message_time = b.MostRecent
       ) AS f ON f.FID = m.UID

A: What about John's answer slightly modified?
SELECT  a.*,
        b.*
FROM    master_followups a
    LEFT JOIN followups_fb_messages b
        ON (b.FID = c.FID AND b.message_time = c.maxTime)
    LEFT JOIN
    (
        SELECT  FID, MAX(message_time) maxTime
        FROM    followups_fb_messages
        GROUP BY FID
    ) c ON a.UID = c.FID


text:
Q: MariaDB non-root users passwords reset after server restart I create a user and set a password. It works okay until mariadb server restarts.
After I run 'service mysqld restart' only root mysql user continues to work. When trying to use any other user I get an error: Connect failed: Access denied for user 'username'@'localhost' (using password: YES)
So every time after server restart I have to log in as root and execute query: SET PASSWORD FOR 'username'@'localhost' = PASSWORD('passw').
Also if after setting password I execute query 'FLUSH PRIVILEGES' the password gets lots again.
Server version: 10.2.12-MariaDB-10.2.12+maria~xenial-log - mariadb.org binary distribution

A: I reinstalled MariaDB as Raymond Nijland suggested. It fixed the problem.


text:
Q: Add alert or action sheet to UITableView during swiping to delete I want to pass an object to the action sheet from the declaration of the UIActionSheet, how to do it?
-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex{

A: *

*Create a property in your header.

*Set it whenever you create your
object.

*Then reference it in the
    didDismissWithButotnIndex you
    posted.

Easy. Peasy. Japanesy.


text:
Q: Remove a string in all the languages Android I have an app with several translations, and I want to delete some strings.
How can I refactor and delete them only once for example in the default strings.xml file and automatically propagate the deletion to the other strings.xml file of other translations?

A: You can remove all translations by "Translations Editor" in Android Studio.

*

*Select string's key

*Click on "Remove key" button

*Uncheck all checkboxes in "Delete" dialog

*Click "OK" button in "Delete" dialog

A: *

*CTRL-H

*select tab File Search

*check regular expression

*input \R\s*<string name="string_name">(.|\R)*?</string> and
don't forget replace string_name to actual string name.

*file name patterns set *.xml

*Press Replace...

*Leave replace field empty.

*Press Preview >

*Check all replacement.

*Apply changes by press `Ok'

A:
default strings.xml file and automatically propagate the deletion to the other strings.xml file of other translations

ADT does not support this operation. You need to get rid of the text from all your XML files yourself, which should not be hard task anyway, as it would be sufficient to do project global search (in Eclipse CTRL-H), set file mask to *.xml and search for your string key. Then just remove this file from each file found.

A: Now you can do it easily with Translations Editor.
To open it click on the Open editor on the top right corner in xml file.
Then in the editor right click on key you are want to delete and press Delete Keys(s)

A: This is the way that I have done to Delete a language I do not want.
1: Make a backup copy of your project.zip
2:Go to Your project folder >app>src>main>res:
In this folder, you will find all languages in the form of folders
Remove the language folder that you not want For example : values-ar-rSA
back to android studio clean your project and test


text:
Q: Facebook group comments Hello im creating a website with facebooks API, im trying to get a facebooks GROUPS comments and let the user reply to a comment, but cant get it to work..

*

*Tried with the graph api, which i get error that i need Page Access Token to reply to comments. Page Access Tokens has nothing to do with Groups and with many tries and errors i came to conclusion that it doesnt work.

*Tried with facebook embed comments which seems to be deprecated since 2021.
Is there another way to get access of a public groups post comments and let the user reply?


text:
Q: The installation of Visual Studio 2022 causes Visual Studio 2019 to not find system references at runtime We have a solution with about 40 projects. One of these projects is a Microsoft Service Fabric project we use to host all micro services present in this solution. Projects in this solution use different frameworks: .NET 4.7, .NET Standard 2.0 and .NET Core 3.1
Every developer in our department currently uses Visual Studio 2019 to build and debug this exact solution without any problems. Now one developer got a new machine on which we tried to use Visual Studio 2022. On the first try to build this solution in 2022 we got the following error:

Error MSB4226 The imported project "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" was not found. Also, tried to find "Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" in the fallback search path(s) for $(MSBuildExtensionsPath32) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe.Config". Confirm that the path in the  declaration is correct, and that the file exists on disk in one of the search paths.

After changing the path in the import section of the affected project to Visual Studio 2022 (by replacing v16.0 with v17.0) we were able to build and also to debug the different projects without any problems.
The problem occurred after we switched back to Visual Studio 2019. After resetting the changed path from the error message before back to Visual Studio 2019, we were able to build but not to debug the solution anymore. Once we tried to start the Service Fabric project we would always get the following exception:

System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Source=System.Web.Http
StackTrace:
at System.Web.Http.HttpConfiguration..ctor(HttpRouteCollection routes)
at ... (some of your code)

Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

The code that throws the exception looks like this:
public static HttpConfiguration HttpConfiguration { get; set; }

private static void InitializeHttpConfiguration()
{
    if (HttpConfiguration != null)
        return;
    HttpConfiguration = new HttpConfiguration(); //this is the line that throws the exception
    HttpConfiguration.MapHttpAttributeRoutes();
}

Has anyone experienced the same issue and maybe got a solution already?
Upgrading everyone at once is unfortunately not so easy because we also have automated build servers that have to be upgraded too. And so do all release pipelines we use.


text:
Q: Node / NPM issues installing / upgrading packages OSX Mavericks I was running node and npm absolutely fine, till today. I am trying to install gulp.
sudo npm install -g gulp and I get a crazy list of errors.
I have tried to re-install node via the Mackintosh Installer, however no difference. Not sure what I was running before the re-install, but now I am running latest stable versions of node and npm.
The same happens if I try to install any node packages. Any suggestions?
ahm:www ahmet$ node -v
v0.10.29
ahm:www ahmet$ npm -v
1.4.14

ahm:www ahmet$ sudo npm install -g gulp
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.keys/node_modules/lodash._isnative'
npm ERR! error rolling back  gulp-util@2.2.19 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.keys/node_modules/lodash._isnative']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.keys/node_modules/lodash._isnative' }
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash'
npm ERR! error rolling back  gulp@3.8.5 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash' }
npm ERR! Error: ENOENT, open '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/multipipe/node_modules/duplexer2/node_modules/readable-stream/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/multipipe/node_modules/duplexer2/node_modules/readable-stream/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/glob/README.md'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/glob/README.md
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/glob/README.md
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, chown '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/node_modules/globule/Gruntfile.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/node_modules/globule/Gruntfile.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-watcher/node_modules/gaze/node_modules/globule/Gruntfile.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chown
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._reunescapedhtml/LICENSE.txt'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._reunescapedhtml/LICENSE.txt
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._reunescapedhtml/LICENSE.txt
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._escapehtmlchar/LICENSE.txt'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._escapehtmlchar/LICENSE.txt
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._escapehtmlchar/LICENSE.txt
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/glob/glob.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/glob/glob.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/glob/glob.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/minimatch/minimatch.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/minimatch/minimatch.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/glob-stream/node_modules/minimatch/minimatch.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys'
npm ERR! error rolling back  vinyl-fs@0.3.4 { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash._shimkeys' }
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/LICENSE.txt'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/LICENSE.txt
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs/node_modules/lodash.defaults/node_modules/lodash.keys/node_modules/lodash.isobject/LICENSE.txt
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash/lodash.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! cwd /Applications/AMPPS/www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash/lodash.js
npm ERR! fstream_path /usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/lodash/lodash.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at process.addListener (events.js:160:15)
    at process.on.process.addListener (node.js:773:26)
    at spinner (/usr/local/lib/node_modules/npm/node_modules/char-spinner/spin.js:35:13)
    at Object.npm.spinner.start (/usr/local/lib/node_modules/npm/lib/npm.js:172:25)
    at Object.commandCache.(anonymous function) (/usr/local/lib/node_modules/npm/lib/npm.js:202:19)
    at /usr/local/lib/node_modules/npm/lib/cache.js:289:18
    at c (/usr/local/lib/node_modules/npm/lib/cache.js:129:12)
    at /usr/local/lib/node_modules/npm/lib/cache.js:145:5
    at process._tickCallback (node.js:419:13)

A: I had to delete my .npm folder, then install npm again to get this working.
sudo rm -rf ~/.npm
sudo npm install -g npm@1.4.14
Once I had done this, I was able to run sudo npm install -g gulp without issue.

A: I faced similar problem before in my server, it was solved by clearing the npm cache by below commands:
# rm -rf ~/.npm
# npm cache clear

Or  you can just clear the physical folder at
C:\Users\{{USERFolder}}\AppData\Roaming\npm-cache

source : http://origin1tech.wordpress.com/2013/08/31/clearing-nodes-npm-cache/


text:
Q: SQL Server 2017 - SELECT com Metadados duplicados Fiz um select utilizando metadados, mas o resultado da minha seleção me trouxe algo parecido com um 'Cross Join'. Mesmo usando GROUP BY e DISTINCT retorna com os valores duplicados. Gostaria de uma ajuda para que os valores retornassem corretamente ... segue o sql:
SQL:
SELECT distinct

S.name as 'Schema',

T.name as Tabela,

C.name as Coluna,

TY.name as Tipo,

C.max_length as 'Tamanho Máximo', -- Tamanho em bytes, para nvarchar normalmente se divide este valor por 2

C.precision as 'Precisão', -- Para tipos numeric e decimal (tamanho)

C.scale as 'Escala', -- Para tipos numeric e decimal (números após a virgula)

TEP.value as 'Descrição'

FROM sys.columns C

INNER JOIN sys.tables T
ON T.object_id = C.object_id

LEFT JOIN sys.schemas S
ON T.schema_id = S.schema_id

INNER JOIN sys.types TY
ON TY.user_type_id = C.user_type_id

LEFT JOIN sys.extended_properties TEP
ON T.object_id = TEP.major_id

Imagem do resultado:

Creio que o problema está do ultimo JOIN, quando troco o parâmetro 'TEP.major_id' para 'TEP.minor_id' ele retorna os valores corretos, porém sem as descrições das colunas.
Imagem do resultado (usando 'TEP.minor_id'):

A: Me parece que a junção com a exibição sys.extended_properties está incompleta.
Experimente o seguinte:
-- código #1
....
LEFT JOIN sys.extended_properties TEP
     ON T.object_id = TEP.major_id
        and C.object_id = TEP.minor_id
        and TEP.name = 'MS_Description'

Não testei, mas espero que seja isto.


text:
Q: Python memoization: necessity of passing back memo in recursive calls I just learned about memoization for optimizing recursive functions.  The solution for memoizing a Fibonacci function was provided as:
def fib_memo(n, memo={}):
    if n in memo : return memo[n]
    if n in [1,2]: return 1
    memo[n] = fib_memo(n-1, memo) + fib_memo(n-2, memo)
    return memo[n]

print(fib_memo(50))

>>> 12586269025

However, I have found that the following variation (which does not pass memo in the recursive calls) also works as expected, but I am unable to explain how/why:
def alt_memo(n, memo={}):
    if n in memo : return memo[n]
    if n in [1,2]: return 1
    memo[n] = alt_memo(n-1) + alt_memo(n-2)
    return memo[n]

print(alt_memo(50))

>>> 12586269025

When I run alt_memo(n), is my compiler optimizing the code behind the scenes and adding memo in the recursive calls, or is it in fact not necessary to include memo in the recursive calls?
If not necessary, how is it that the recursive calls are receiving/passing-along the memo object (being as that the function initially sets the memo parameter to an empty dictionary, when otherwise unspecified)?


text:
Q: Our PowerUser and PowerReader were accidentally deleted. We recreated them but we're still getting errors The user accounts used for our Portal Super User and Portal Super Reader were accidentally deleted in Active Directory.  We recreated them with different names (and re-added them to the user policy for the web application), but now our top navigation and side navigation bars are failing for most of our site collections.  They return with the follow error:
Error rendering new menu state: The specified user or domain group was not found
Is there something else that needs to be done for these users besides re-adding them to the user policy for the web application?
This is the error I'm seeing in the logs:
Application error when access /_layouts/15/SiteNavigationSettings.aspx, Error=Some or all identity references could not be translated.

 at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)

 at System.Security.Principal.NTAccount.Translate(Type targetType)
 at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKeyClaim(IClaimsIdentity claimsIdentity, SPClaim loginClaim)

System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated.
Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.SharePoint.SPException: The specified user or domain group was not found. ---> System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated.

A: Basically there are couple steps to configure it

*

*you have to add the account into the Policy of Web App

*you have to run the powershell to configure.

*Now reset IIS on all servers in the farm.

As a test, run the below powershell to test if new account is configured properly.You should see your new users here.
$wa = Get-SPWebApplication -Identity "<WebApplication>"
$wa.Properties["portalsuperuseraccount"]
$wa.Properties["portalsuperreaderaccount"]

If after above steps, its still throwing the error then you have to clear the config cache on the SharePoint servers.


text:
Q: Puzzling error while using sunitx (in a tabular environment) I've been working on writing a contingency table in LaTeX (I've prepared myself for a long battle to get multi-line and multi-column cells to appear as I need).
\usepackage{booktabs}
\usepackage[detect-all]{siunitx}
\usepackage{multirow}

\begin{table}[htp]
    \centering
    \begin{tabular}{
           @{}
           l
           S[table-format=3.2]
           S[table-format=3.2]
           S[table-format=3.2]
           S[table-format=3.2]
           S[table-format=3.2]
           S[table-format=3.2]
           @{}
           }
        \toprule
        \multicolumn{7}{|c|}{Factor B} \\
        & Alpha & Beta & Gamma & Delta & Epsilon & Row Total \\

        \midrule
        \multirow{2}{*}{Alpha} & 1 & 1 & 1 & 1 & 1 & 1 \\
        & 11.11 & 2.11 & 3.11 & 4.11 & 5.11 & \\
        \multirow{2}{*}{Beta} & 2 & 2 & 2 & 2 & 2 & 2 \\
        & 22.22 & 2.22 & 3.22 & 4.22 & 5.22 & \\
        \multirow{2}{*}{Gamma} & 3 & 3 & 3 & 3 & 3 & 3 \\
        & 33.33 & 2.33 & 3.33 & 4.33 & 5.33 & \\
        \multirow{2}{*}{Delta} & 4 & 4 & 4 & 4 & 4 & 4 \\
        & 44.44 & 2.44 & 3.44 & 4.44 & 5.44 & \\
        \multirow{2}{*}{Epsilon} & 5 & 5 & 5 & 5 & 5 & 5 \\
        & 55.55 & 2.55 & 3.55 & 4.55 & 5.55 & \\
        Column Total & 111 & 222 & 333 & 444 & 555 & 666 \\

        \bottomrule
    \end{tabular}
    \caption {Table Caption}\label{my-table}
\end{table}

I receive the following error:
! siunitx Error

(siunitx) Invalid numerical input 'e'.

For immediate help type H <return>.
 ...

l.157          & Alpha & Beta &
                                Gamma & Delta & Epsilon & Row Total \\

I admit I don't understand it. The non-numerical text is in the header of the table. To see the table, replace the line
    & Alpha & Beta & Gamma & Delta & Epsilon & Row Total \\

with
    1 & 2 & 3 & 4 & 5 & 6 & 7 \\

just to allow it to render.
I'm puzzled. Why "e"?
Suggestions are very appreciated.
Thanks in advance.

A: The "e" is because siunitx is trying to parse "Delta" as a number in engineering notation (eg, 1.234E+04). Fix it by writing the headings as \multicolumn{1}{c}{Delta}, etc


text:
Q: HDD downsize after installing ubuntu here is the big deal guys i was using windows with two partitions "C:" and "D:". After installing ubuntu "D:" partition is gone but totally gone -.- there was 500gb before installing ubuntu but i have just 298 gb hdd space so what can I do guys:

A: Having a separate C: and D: suggests there might be two physical drives.
From what I see above, you have a Root partition of 243MB in /dev/sda1, and then an ubuntu-vg LVM partition of 298GB, /dev/sda5, within the extended partition /dev/sda2. I would, very carefully, examine what's in /dev/sda5 and copy anything you want to save to an external drive, then delete (in this order) /dev/sda5, /dev/sda2, save the change, then expand /dev/sda1 to fill almost the entire drive, leaving room (2GB? 4GB? However much your RAM size is) for the swap partition.
After you have set /dev/sda1 to roughly 294-296 GB and created the /dev/sda5 swap (inside an extended partition /dev/sda2), save again.
Then, check what's in /dev/sdb by clicking on the spin box at upper left which now says /dev/sda 298.09GB for I suspect the 500GB drive is really /dev/sdb and /dev/sda is a 300GB drive.


text:
Q: Buildozer "Command '['ant', 'debug']' returned non-zero exit status 1" I try to compile a basic code with buildozer. At first run it installs depencies and fail. Later runs it just fails.
any help needed desperately.
Thanks in advance.
BUILD FAILED
/home/mbp/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:645: The following error occurred while executing this line:
/home/mbp/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:651: null returned: 127

Total time: 1 second
form/python-for-android/dist/sozluk/private/lib/python2.7/site-packages/kivy/modules/inspector.pyo
...
.....
...
assets/private.mp3: /home/mbp/build/.buildozer/android/platform/python-for-android/dist/sozluk/private/lib/python2.7/lib-dynload/_io.so
assets/private.mp3: /home/mbp/build/.buildozer/android/app/sitecustomize.pyo
assets/private.mp3: /home/mbp/build/.buildozer/android/app/main.pyo
assets/private.mp3: /home/mbp/build/.buildozer/android/app/sozluk.kv
Traceback (most recent call last):
  File "build.py", line 412, in <module>
    make_package(args)
  File "build.py", line 336, in make_package
    subprocess.check_call([ANT, arg])
  File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /usr/bin/python build.py --name DenemeSozluk --version 1.2.0 --package bs.sozluk.sozluk --private /home/mbp/build/.buildozer/android/app --sdk 14 --minsdk 8 --orientation sensor debug

Fedora release 20 (Heisenbug)
I found following question about very similar problem on ubuntu. It might not be distro specific.
Build Error while converting python file into apk using buildozer
Linux localhost.localdomain 3.12.9-301.fc20.x86_64 #1 SMP Wed Jan 29 15:56:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Full output:
http://paste.fedoraproject.org/82968/41173791/

A: This is a very generic error, it could mean a lot of things.
One thing to check is that you have buildozer's dependencies installed...in particular, I think the lack of a jdk (and javac) can cause this. Do you have these?

A: I recently faced this error and from github found that it happened because google has updated their sdk version to 24.So my quick fix in buildozer was to set following property in buildozer.spec and my app worked fine afterwards.
# (int) Android SDK version to use
android.sdk = 24


text:
Q: Turning a calculation into a function I have this chunk of code that I would like to turn into ONE function.  I would like the arguments to be choice and the name of the x-y dataset.
choice = "exponential";
nlm = NonlinearModelFit[data,
   <|"proportional" -> a x,
     "linear" -> a x + b ,
     "quadratic" -> a x^2 + b x + c,
     "cubic" -> a + b x + c x^2 + d x^3,
     "quartic" -> a + b x + c x^2 + d x^3 + e x^4,
     "exponential" -> a Exp[-c x] + b |>[[choice]],
    {a, b, c, d, e}, x];
Print["Equation is ", choice, ": y = ", Normal[nlm]]
Labeled[Show[
  Plot[nlm[x], {x, Min[data[[All, 1]]],  Max[data[[All, 1]]]}],
  ListPlot[data,
   PlotStyle -> {Darker@Blue, PointSize[0.02]}]], choice]

A: You specification is vague about what you want to give as arguments and what your function should return, if anything. I've made some guesses about those missing specs, so this may not be exactly what you want. However, even so, it should give you ideas on how to proceed.
forms =
  <|"proportional" :> a x,
    "linear" :> a x + b,
    "quadratic" :> a x^2 + b x + c,
    "cubic" :> a + b x + c x^2 + d x^3,
    "quartic" :> a + b x + c x^2 + d x^3 + e x^4,
    "exponential" :> a Exp[-c x] + b|>;

myFit[data_, choice_] :=
  Module[{min, max, nlm, plot},
    {min, max} = MinMax[data[[All, 1]]];
    nlm = NonlinearModelFit[data, forms[choice], {a, b, c, d}, x];
    plot =
      Labeled[
        Show[
          Plot[nlm[x], {x, min, max}],
          ListPlot[data,
            PlotStyle -> {Darker @ Blue, PointSize[0.02]}]],
        choice];
    Print[Column[{nlm // Normal, plot }]];
    nlm]

Now let's how well this does.
With[{n = 10}, data = Transpose[{Range[n], Range[n]^2}]];

Seems to work well for all the forms except the exponential one. Whether you should adjust the specification of the exponential form or just write it off as not being inappropriate for the data set used, I leave up to you.


text:
Q: Round percentage value to nearest number I wanted to convert a number which is in string format to a percentage value with one decimal point. Below is my sample input and expected output.
Expected results:
"0.0195" => "2.0%"
"0.0401" => "4.0%"
I know this may be a simple question but I am not able to find the exact solution for this using java APIs, I tried all the rounding modes present under RoundingMode enum, but no rounding mode gives my expected result. Could you please help, I may be missing something.

import java.math.RoundingMode;
import java.text.NumberFormat;

public class RoundingModeExample {
    public static void main(String[] args) {
        System.out.println(formatPercentage("0.0195") + "(expected 2.0%)");
        System.out.println(formatPercentage("0.0401") + "(expected 4.0%)");
    }

    private static String formatPercentage(String number) {
        String formattedValue = "";
        NumberFormat numberFormat = NumberFormat.getPercentInstance();
        numberFormat.setMinimumFractionDigits(1);
        numberFormat.setRoundingMode(RoundingMode.HALF_UP);
        try {
            formattedValue = numberFormat.format(Double.valueOf(number));
        } catch (NumberFormatException e) {
            formattedValue = number;
        }
        return formattedValue;
    }

}

Output of the above program:
1.9%(expected 2.0%)
4.0%(expected 4.0%)

A: The problem with 0.0195 is that there is no double precision number that is exactly mathematically equal to it. When you write 0.0195 in program source code or parse the string "0.0195" into double, the number you get is actually a little bit less. That's why the formatter rounds it to 1.9%.
You can get around this by not using the double data type at all:
formattedValue = numberFormat.format(new BigDecimal(number));


text:
Q: Post Request to Parse Mobile data management I'm trying to send a post request to Parse: https://parse.com/docs/rest#objects-creating. Can't get it to work correctly. I use the real the App and Rest API ID's in my program.
var https = require('https');

var options = {
 host: 'api.parse.com',
 port: 443,
 path: '/1/classes/GameScore',
 method: 'POST',
 headers: {
    X-Parse-Application-Id: "",
    X-Parse-REST-API-Key: "",
    Content-Type: "application/json";
}
 data: {
    "score": 1337, "playerName": "Sean Plott", "cheatMode": false
 }
}

};

var req = https.request(options, function(res) {
 console.log("statusCode: ", res.statusCode);
 console.log("headers: ", res.headers);

res.on('data', function(d) {
 process.stdout.write(d);
 });
});
req.end();

req.on('error', function(e) {
 console.error(e);
});

EDITED: Added error response:
SyntaxError: Unexpected token -
at Module._compile (module.js:406:25)
at Object..js (module.js:417:10)
at Module.load (module.js:343:31)
at Function._load (module.js:302:12)
at Array.<anonymous> (module.js:430:10)
at EventEmitter._tickCallback (node.js:126:26)

A: You cannot use - as a key to the object without quotes.
So you need to change
headers: {
  X-Parse-Application-Id: "",
  X-Parse-REST-API-Key: "",
  Content-Type: "application/json";
}

to be
headers: {
  "X-Parse-Application-Id": "",
  "X-Parse-REST-API-Key": "",
  "Content-Type": "application/json";
}


text:
Q: In mongoDB map function emit full document without assigning (key,values) pair to a varchar var map = function() {
    var values = {d_sno : this.d_sno, type : this.type};
    emit(this._id, values);
};

In the map function above I am assigning (key,value) pair to a varchar and emit that varchar. I want to emit the whole document without assigning (key,value) pair to a varchar.

A: You can emit the whole document like this:
var map = function() {
    emit(this._id, this);
};

By emitting the whole document as a value, the emitted document will look like this:
{
    "_id" : ObjectId("53a6bd394aaee8df24b45dc5"),
    "value" : {
        "_id" : ObjectId("53a6bd394aaee8df24b45dc5"),
        "d_sno" : "foo",
        "type" : "bar",
        /* ... other fields */
    }
}

The problem with this approach is that you will have _id of the documents in the value and in the key (because you're emitting _id as a key).
To get rid of the _id in the emitted value you can use this approach:
var map = function() {
   var key = this._id;
   var value = this;
   delete value._id;
   emit(key, value);
};

But you should be careful when emitting whole documents because a single emit can only hold half of MongoDB's maximum BSON document size (which is currently 16 MB).


text:
Q: Splitting program into two classes I am in the process of creating a basic data storage program in C#. I am fairly new, please go easy on me. I want to split this into two classes so somebody else would be able to run it from their own main method. My problem is, that I have no idea where to start with this. I tried adding another .cs file for the methods, but the references to arrays and such create errors in the program. Here is what I have.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace Basic_Item_Entry
{
    public class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("This program is designed to take input and hold          data for 10 items");
            //make array for item #'s and add 10 values
            Console.WriteLine("Enter 10 item numbers");
            int[] itemNums = new int[10];
            for(int i = 0; i <itemNums.Length; i++)
            {

                itemNums[i] = Convert.ToInt32(Console.ReadLine());

            }
            //make array for item descriptions
            string[] itemDesc = new string[10];
            for(int i = 0; i < itemNums.Length; i++)
            {
                Console.WriteLine("Enter the description for item number: " +     itemNums[i]);
                itemDesc[i] = Console.ReadLine();
            }
            //add contents of arrays to a file @"C:\temp\DataEntry.txt"
            using (System.IO.StreamWriter file = new System.IO.StreamWriter(
                @"C:\temp\DataEntry.txt"))
            {
                file.WriteLine("Item Data:");
                for (int i = 0; i < itemNums.Length; i++)
                {
                    file.WriteLine("Item number " + itemNums[i] + " Description: " + itemDesc[i]);

                }
                file.Close();
            }
            //finish and maybe print contents from file
            Console.WriteLine("Data has been recorded to a file. Would you like                       to view the the contents? y/n");
            //print array data from previously written to file                 @"C:\temp\DataEntry.txt"
            try
            {
                if (Console.ReadLine().Equals("y"))
                {
                    using (StreamReader stringRead = new     StreamReader(@"C:\temp\DataEntry.txt"))
                    {
                        String DataEntryTXT = stringRead.ReadToEnd();
                        Console.WriteLine(DataEntryTXT);

                    }
                }
                //dont print anything, just exit (Still creates the file)
                else
                {
                    System.Environment.Exit(1);
                }

            }
            catch(Exception ex)
            {
                Console.WriteLine("File not found");
                Console.WriteLine(ex.Message);
            }

            Console.ReadLine();
        }
    }
}

A: Item Object - Stores an instance of an item (Number, Description)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicDataStorageApp
{
    public class Item
    {
        private int _number;

        public int Number
        {
            get { return _number; }
            set { _number = value; }
        }

        private string _description;

        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        public Item(int number, string description)
            : this()
        {
            _number = number;
            _description = description;
        }

        public Item()
        {
        }

        public override string ToString()
        {
            return string.Format("Item number {0} Description {1}", _number, _description);
        }
    }
}

Model Object - Stores a collection of Items and includes methods to read and write to a file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicDataStorageApp
{
    public class Model
    {
        private Item[] _items;

        public Item[] Items
        {
            get { return _items; }
            set { _items = value; }
        }

        public bool WriteItems(string filename, bool append)
        {
            if (_items != null)
            {
                for (int i = 0; i < _items.Length; i++)
                {
                    string str = _items[i].ToString();
                    FileHelper.WriteLine(str, filename, append);
                }

                return true;
            }

            return false;
        }

        public IEnumerable<string> ReadItems(string filename)
        {
            return FileHelper.ReadLines(filename);
        }
    }
}

FileHelper - Provides read and write IO static methods.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicDataStorageApp
{
    public static class FileHelper
    {
        public static bool WriteLines(IEnumerable<string> lines, string filename, bool append)
        {
            try
            {
                using (StreamWriter writer = new StreamWriter(filename, append))
                {
                    foreach (var line in lines)
                    {
                        writer.WriteLine(line);
                    }
                }

                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static bool WriteLine(string line, string filename, bool append)
        {
            try
            {
                using (StreamWriter writer = new StreamWriter(filename, append))
                {
                    writer.WriteLine(line);
                }

                return true;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static IEnumerable<string> ReadLines(string filename)
        {
            try
            {
                var lines = new List<string>();

                using (StreamReader reader = new StreamReader(filename))
                {
                    string line = null;
                    while ((line = reader.ReadLine()) != null)
                    {
                        lines.Add(line);
                    }
                }

                return lines;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

Program - Includes the described logic to get user input, write it to a file and read it back to the user
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicDataStorageApp
{
    class Program
    {
        static Model _model;
        const int _totalInput = 10;
        const string _filename = @"C:\temp\DataEntry.txt";

        static void Main(string[] args)
        {
            _model = new Model();
            _model.Items = new Item[_totalInput];

            Console.WriteLine("This program is designed to take input and hold data for 10 items");

            int i = 0;
            while (i < _totalInput)
            {
                int number = -1;

                Console.WriteLine("\nEnter number: ");
                string numberValue = Console.ReadLine();

                if (Int32.TryParse(numberValue, out number))
                {
                    _model.Items[i] = new Item(number, null);

                    Console.WriteLine("\nEnter description: ");
                    string descriptionValue = Console.ReadLine();

                    _model.Items[i].Description = descriptionValue;

                    i++;
                }
            }

            _model.WriteItems(_filename, true);

            var itemStrings = _model.ReadItems(_filename);
            foreach (var s in itemStrings)
            {
                Console.WriteLine(s);
            }

            Console.ReadLine();
        }
    }
}


text:
Q: Convert a 4 bit binary nibble as a string into its hex equivalent value as a string I'm not sure what I'm doing wrong, but my print statement doesn't seem to be working.
  def nib(string):
    if string == '0000':
        return '0'

    if string == '0001':
        return '1'

    if string == '0010':
        return '2'

    if string == '0011':
        return '3'

    if string == '0100':
        return '4'

    if string == '0101':
        return '5'

    if string == '0110':
        return '6'

    if string == '0111':
        return '7'

    if string == '1000':
        return '8'

    if string == '1001':
        return '9'

    if string == '1010':
        return "A"

    if string == '1011':
        return "B"

    if string == '1100':
        return "C"

    if string == '1101':
        return "D"

    if string == '1110':
        return "E"

    if string == '1111':
        return "F"

def main(nib):
    strings= input("Enter your 4 bit binary nibble, separated by spaces: ")
    strings= strings.split(' ')

    print(string)

I'd like to maintain the code in the simple format I have since I'm a beginner. Here are my instructions:
Write a function that takes as an argument, a 4 bit binary nibble represented as a string, and returns its hex equivalent value as a String
Use that function to write a program that accepts an entire string of binary nibbles entered from the keyboard and prints out the full hex equivalent. The nibbles in the input must be separated by spaces.
For Example:
An input of 0101 1101 produces an output of 5D
An input of  0000 1001 0001 1111 1100 produces an output of 091FC
I don't know where I went wrong?????

A: There are a few things wrong with your code:

*

*You never call any of the functions you defined. The code inside a function is only executed when the function is called

*You don't do anything with your input values.

Your code to accept the input values is correct. I suggest you rename your variables to something that makes sense. Also your main function doesn't need a nib argument. The nib function is already defined in the global scope. Also, you don't need to specify an argument to .split if you want to split on spaces -- that is the default behavior.
At this point, you have a list of input nibbles, and you need to convert each of them. Once you convert each of them, you need to join the individual hex digits to a single string.
def main():
    user_in = input("Enter your 4 bit binary nibbles, separated by spaces: ") # e.g. 1000 0010 1010
    strings = user_in.split() # ["1000", "0010", "1010"]

    hex_digits = [nib(s) for s in strings] # ["8", "2", "A"]
    hex_value = "".join(hex_digits)        # "82A"
    print(hex_value)                       # Prints 82A

main() # You need to actually call the function to run it

Note: You can skip the need to define hex_digits and do hex_value directly like so: hex_value = "".join(nib(s) for s in strings)

Now, your nib function works, but you could clean it up a little to be more terse. You could define a dictionary which maps the binary values to the hex digits, and use that instead of a bunch of if statements (remember to fill in all the key-value pairs in bin_to_hex.
bin_to_hex = {"0000": "0", "0001": "1", "0002": "2", ..., "1001": "9", "1010": "A", ..., "1111": "F"}
def nib(n):
    return bin_to_hex[n]

You could even define bin_to_hex using a loop:
bin_to_hex = {f"{i:04b}": f"{i:x}".upper() for i in range(16)}

The f"..." construct is called the f-string syntax. :b formats an integer as a binary string, and :04 pads the result with zeros to a width of 4.:x formats an integer as a hex string. Doing this for all integers in the range(16) allows us to create the bin_to_hex without manually typing everything out.

A: This should be helpful.
def nib(string):
    if string == '0000':
        return '0'

    if string == '0001':
        return '1'

    if string == '0010':
        return '2'

    if string == '0011':
        return '3'

    if string == '0100':
        return '4'

    if string == '0101':
        return '5'

    if string == '0110':
        return '6'

    if string == '0111':
        return '7'

    if string == '1000':
        return '8'

    if string == '1001':
        return '9'

    if string == '1010':
        return "A"

    if string == '1011':
        return "B"

    if string == '1100':
        return "C"

    if string == '1101':
        return "D"

    if string == '1110':
        return "E"

    if string == '1111':
        return "F"

strings= input("Enter your 4 bit binary nibble, separated by spaces: ")
strings= strings.split(' ')
for s in strings:
    print(nib(s), end="")


text:
Q: mappend! can't append element to the list if the list is empty? (require racket/mpair)

(define (bld-mlst . args)
  (list->mlist args))

(define mlst-my (bld-mlst))
mlst-my

(mappend! mlst-my (list->mlist (list 100)))
mlst-my

(define mlst-my2 (bld-mlst 2))

(mappend! mlst-my2 (list->mlist (list 100)))
mlst-my2

it will print out:
(mcons 100 '())
'()
(mcons 2 (mcons 100 '()))
(mcons 2 (mcons 100 '()))

The first and third line is just the return value of the mappend! Note the second line and fourth line! We can see that the second line is '(), which means that mappend! does not change the mlst-my! While when the mlst-my2 is not empty, the mappend! works fine.
Question:
Then How to make the mappend! to still side effect the mlist when the mlist is empty?

A: You can't! The empty list is a singleton, immutable object. It has no slots (car or cdr) that you can change. But you can do this:
(set! mlst-my (mappend! mlst-my (list->mlist (list 100))))

That is, you set! your variable to mappend!'s return value.

To understand all that, understand how singly linked lists work. It comprises cons cells (or dotted pairs), which each have two slots (traditionally named car and cdr). The car slot points to the value, and the cdr points to the next cons/pair.
So, a list like (1 2 3) has three conses:
#0=(1 . #1#)
#1=(2 . #2#)
#2=(3 . ())

The way append! works is to find the last cons (the one whose cdr is pointing to ()), and change its cdr to point to the list you're appending.
If your list is empty, though, it has no conses, and therefore it has nothing to change. Empty lists are always immutable.


text:
Q: Geolocator().getCurrentPosition vs StreamSubscription in flutter I am currently using Geolocator().getCurrentPosition to get user current position... but when I am build an app.. I want to calculate the distance between user current location and her/his house (for example)... but since user can move everywhere and stop at some point.. I also want to calculate that new distance... so the route is like this..
Home= A
user first location= B
user second location= C (so user move from B to C)

I need to know the location from A to B and from A to C
...So what I want to ask is..is it enough to use only Geolocator().getCurrentPosition or am I need also use StreamSubscription<Position> to listen for user location changes?
here is my code...
Geolocator()
          .getCurrentPosition(desiredAccuracy: LocationAccuracy.high)
          .then((Position position) {
        setState(() {
          _first = position;
        });
        _distanceCalculation(_first.latitude, _first.longitude);
      }).catchError((error) {
        print(error);
      });

if I need StreamSubscription<Position> to listen for user location changes how the way to apply StreamSubscription<Position> inside my code


text:
Q: Reproducir sonido python-arduino Tengo que hacer un proyecto de la escuela. Se trata de un reproductor de música en Python que controle con un modulo receptor infrarrojo, que se conecta con Arduino.
El problema es que con botones en tkinter funciona muy bien pero al correr con Arduino no funciona, no reproduce ningún sonido, ni siquiera entra al método que requiero,ya he intentando de varias maneras y no se que mas hacer, esto tengo hasta ahora
import tkinter as tk
from tkinter import filedialog
from tkinter import PhotoImage
from tkinter import *
import pygame
from pygame import mixer
import serial
import time
from time import  sleep
global aux
aux=0

ini=tk.Tk()
ini.geometry("490x500")
ini.title("Reproductor de musica ITC")
ini.config(bg='gray')
pygame.mixer.init()

def agregar():
    canciones=filedialog.askopenfilenames(initialdir="/",title="Elige una cancion",filetypes=(("mp3",".mp3"),("all files",".*")))
    for cancion in canciones:
        cancion=cancion.replace("E:\Sexto Semestre\Programacion Avanzada\Parcial 4\musica","")
        cancion=cancion.replace(".mp3","")
        pantalla.insert(END,cancion)

def play():
    cancion=pantalla.get(ACTIVE)
    cancion=f'{cancion}.mp3'
    pygame.mixer.music.load(cancion)
    pygame.mixer.music.play(loops=0)

def stop():
    pygame.mixer.music.stop()
    pantalla.selection_clear(ACTIVE)

def siguiente():
    proxima=pantalla.curselection()
    proxima=proxima[0]+1
    cancion=pantalla.get(proxima)
    cancion=f'{cancion}.mp3'
    pygame.mixer.music.load(cancion)
    pygame.mixer.music.play(loops=0)
    pantalla.selection_clear(0,END)
    pantalla.activate(proxima)
    last=None
    pantalla.selection_set(proxima,last)

def anterior():
    proxima=pantalla.curselection()
    proxima=proxima[0]-1
    cancion=pantalla.get(proxima)
    cancion=f'{cancion}.mp3'
    pygame.mixer.music.load(cancion)
    pygame.mixer.music.play(loops=0)
    pantalla.selection_clear(0,END)
    pantalla.activate(proxima)
    last=None
    pantalla.selection_set(proxima,last)
global paused
paused=False
def pause (is_paused):
    global paused
    paused=is_paused
    if paused:
        pygame.mixer.music.unpause()
        paused=False
    else:
        pygame.mixer.music.pause()
        paused=True
def borrar1():
    pantalla.delete(ANCHOR)
    pygame.mixer.music.stop()

def borrar_todas():
    pantalla.delete(0,END)
    pygame.mixer.music.stop()

def mas():
    volume=pygame.mixer.music.get_volume()
    print(volume)
    if (volume<1):
        pygame.mixer.music.set_volume(volume+.1)
def menos():
    volume=pygame.mixer.music.get_volume()
    print(volume)
    if (volume>0):
        pygame.mixer.music.set_volume(volume-.1)

def cerrar():
    ini.destroy()
    pygame.mixer.music.stop()
    #pantalla.selection_clear(ACTIVE)
    arduino.close()

arduino=serial.Serial("COM3",9600)
time.sleep(2)
def leervalor():
    arduino.flushInput()
    lectura=arduino.readline()
    valor=(lectura.decode())
    print(valor)
    if(valor=="PAUSE"):
        play()
                    #if(valor==2):

    if(valor=="FAST FORWARD"):
        siguiente()
    if(valor=="FAST BACK"):
        anterior()

    if(valor=="VOL+"):
        mas()
    if(lectura=="VOL-"):
        menos()

pantalla=Listbox(ini,bg='black',fg='white',width=60,selectbackground='white',selectforeground='black')
pantalla.place(x=55,y=20)

#anterior=Button(ini,text="Anterior",command=anterior)
#anterior.place(x=70,y=450)

reproducir=Button(ini,text="Reproducir",command=leervalor)
reproducir.place(x=125,y=450)

dell=Button(ini, text="I/O", command=cerrar)
dell.place(x=460,y=0)

menubar=Menu(ini)
ini.config(menu=menubar)
agregar_cancion=Menu(menubar)
menubar.add_cascade(label="Agregar cancion",menu=agregar_cancion)
agregar_cancion.add_command(label="Agregar una o mas canciones a la lista", command=agregar)

espero puedan ayudarme por favor


text:
Q: Mule CE 3.6.1 HTTP Request url encoding issue I have a Mule flow which uses HTTP Request endpoint in Mule CE3.6.1. It needs to use encoded HTTP url to get the correct data.
Please note the encoded url: /items?q=%2Blabel%3ABOTV2309H*%20%2Bparent.uri%3A%5C%2Fbristol%5C%2Ftest%5C%2Fgateway%5C%2F*&rows=100&start=0
Here is the test flow.
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.6.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8089" basePath="/" usePersistentConnections="false" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Config_Search" host="testserver" port="80" basePath="/index" usePersistentConnections="false" doc:name="HTTP Request Configuration"/>
<flow name="testFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="*" allowedMethods="POST" doc:name="HTTP"/>
    <object-to-string-transformer doc:name="Object to String"/>
    <logger level="INFO" doc:name="Logger"/>

    <http:request config-ref="HTTP_Request_Config_Search" path="/items?q=%2Blabel%3ABOTV2309H*%20%2Bparent.uri%3A%5C%2Fbristol%5C%2Ftest%5C%2Fgateway%5C%2F*&rows=100&start=0" method="GET" doc:name="HTTP"/>
    <logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>
</mule>

When the Mule flow runs, here is the url being requested (Found through wireshark):
/items?q=%20label%3ABOTV2309H%2A%20%20parent.uri%3A%5C%2Fbristol%5C%2Ftest%5C%2Fgateway%5C%2F%2A&rows=100&start=0

Please note %2B is replaced with %20 in two places, which obviously do not return the data I need.
Is this an issue with HTTP endpoint?
Thanks!

A: I divided the params into query and uri params. Then this issue got resolved.
<http:request config-ref="HTTP_Request_Config_Search" path="/items" method="GET" doc:name="HTTP">
        <http:request-builder>
            <http:query-param paramName="q" value="+label:BOTV2309H* +parent.uri:\/test\/gateway\/*"/>
            <http:uri-param paramName="rows" value="100"/>
            <http:uri-param paramName="start" value="0"/>
        </http:request-builder>
    </http:request>


text:
Q: how to view classpath in clojure? How do you display all dirs of classpath in clojure?
This is a common question that clojure CLI has covered now. See answer below.

A: in your projects' dir run:
clojure -Spath


text:
Q: how can i append auto search class in script when i am clicking on first textbox auto autocomplete function is working.but after inserting another textbox in script autocomplete function is not working.So please suggest me how to append autocomplete class in script.
html:

    <form  id="smart-form-register" class="smart-form client-form" method="post" enctype="multipart/form-data">
<fieldset>

 <input type="text"   name="product_name" placeholder="product Name">
  Needed to enter product Name

  Material Name
  Material Quantity

 <input name="last[]" class="auto"  id="last[0]" size="40">
 <input name="first[]" id="first[0]" size="40">

</fieldset>

<input type="submit" name="submit" value="Register" class="btn btn-primary">

 </form>

script:
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/base/minified/jquery-ui.min.css" type="text/css" />

A: just you call autocomplete script function after insert new row.
Add this function "autocomplete()" to end of "insertAdjacentHTML()"


text:
Q: In perl passing a parameter to a script using a required command I have two file tmp.pl and tmp2.pl. I want to call tmp2.pl with a require command but also send a parameter. Is there a better way of doing this?
tmp.pl
require "tmp2.pl" "passed parameter";

tmp2.pl
print @_;

A: As far as I know, require cannot be used to send a parameter. But that's  a good thing, I think, because I cannot think of a reason why you should want to. Looks to me that your design is wrong.
tmp2.pl should be either:

*

*a independent perl program, which you should run with system or qx()

*a module, with optional exported tags etc.

*a package which defines a class

but that's just my idea....

A: There's probably a better way to accomplish whatever it is you're trying to do, but you could achieve your current sub goal with something like
{
    local @_ = ("passed parameter");
    require "tmp2.pl";
}

I might consider this idiom in a place where I wanted to run a perl script from within a perl script. That is, I could say
{
    local @ARGV = ("foo","bar");
    require "my_script.pl";
}

instead of
system("perl","my_script.pl","foo","bar");

(There are plenty of subtle and not-so-subtle differences between these two calls, so a lot depends on what "features" of these calls you need)

A: Yes, I think this should work. Use "require" to include the script. After that you can pass the parameter by calling the sub function. The modified script can be

require "tmp2.pl" ;
subfunc(parameter);
print @_;

A: Supposing that you want to execute other program and capture its output I'm partial to using the IPC::Run module.
#!/usr/bin/perl

use strict;
use warnings;
use IPC::Run qw( run );

run( [ './tmp2.pl', @ARGV ], \'', \my $out, \my $err );

print "out: $out\n";
print "err: $err\n";


text:
Q: adding arraylist to another arraylist with different values I have a dataset with 2 tables, so I declared 2 ArrayList and fetching that table values from DataSet into two ArrayLists.
One ArrayList has the count of 66, another of 37.
Now, how do I combine these ArrayLists into one ArrayList so that I get values of both ArrayList into an single ArrayList?

A: Try this
array1.AddRange(array2);

A: You can use the AddRange method. But you shouldn't use ArrayLists, they are deprecated. Use the generic List class instead.
Furthermore, are you sure you need the separate values at all? Aren't the data sets enough?

A: Linq style:
IList<int> both = arrlist1.Cast<int>().Concat(arrlist2.Cast<int>()).ToList();


text:
Q: Tikz Hierarchical Chart - Branching Children \documentclass{article}
\usepackage{tikz-qtree}

\begin{document}
\tikzset{edge from parent/.style=
{draw, edge from parent path={(\tikzparentnode.south)
-- +(0,-8pt)
-| (\tikzchildnode)}},
blank/.style={draw=none},
level distance=45pt}
\begin{tikzpicture}[every tree node/.style={align=center,minimum width=\widthof{Janet Botwood}}]
 \Tree
[ .{Ruth Butler\\Registered Manager}
[ .{Anita Kaur\\Registered Manager} ]
 [ .{Janet Botwood\\Head of Care} ]
 [ .{Sunny Bell\\Head of Care}  ] ]
\end{tikzpicture}

\end{document}

I am trying to make Anita & Ruth on the same branch level. Also, how would I make children branches of Janet and Sunny?

A: Trees are not meant for multiple "parents". I am not sure, if I got you right, but you could just put the two first names into one single node:
% arara: pdflatex

\documentclass{article}
\usepackage{tikz-qtree}
\usetikzlibrary{shapes}

\begin{document}
    \tikzset{edge from parent/.style=
        {draw, edge from parent path={(\tikzparentnode.south)
                -- +(0,-8pt)
                -| (\tikzchildnode)}},
        blank/.style={draw=none},
        level distance=45pt}
    \begin{tikzpicture}[every tree node/.style={align=center,minimum width=\widthof{Janet Botwood}}]
    \Tree [.\node(grands)[rectangle split,rectangle split horizontal,rectangle split parts=2]{Ruth Butler\\Registered Manager \nodepart{second} Anita Kaur\\Registered Manager};
    [ .{Janet Botwood\\Head of Care} A B C  ]
    [ .{Sunny Bell\\Head of Care} D E F ] ]
\end{tikzpicture}
\end{document}

A: Something like this?

This uses the power forest package. The trick involved in getting Ruth and Anita on the same level is to make them children of a phantom node, since the tree must have a single root.
\documentclass[tikz,border=5pt,multi]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
  for tree={
    edge path={
      \noexpand\path [draw, \forestoption{edge}] (!u.parent anchor) -- +(0,-5pt) -| (.child anchor)\forestoption{edge label};
    },
    align=center,
    parent anchor=south,
    child anchor=north
  }
  [, phantom, for children={fit=band}
    [Ruth Butler\\Registered Manager
      [Janet Botwood\\Head of Care
        [child 1]
        [child 2]
        [child 3]
      ]
      [Sunny Bell\\Head of Care
        [child 1]
        [child 2]
        [child 3]
      ]
    ]
    [Anita Kaur\\Registered Manager]
  ]
\end{forest}
\end{document}

Or like this?

\documentclass[tikz,border=5pt,multi]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
  for tree={
    edge path={
      \noexpand\path [draw, \forestoption{edge}] (!u.parent anchor) -- +(0,-5pt) -| (.child anchor)\forestoption{edge label};
    },
    align=center,
    parent anchor=south,
    child anchor=north
  }
  [, phantom, for children={fit=band}
    [Ruth Butler\\Registered Manager
      [Janet Botwood\\Head of Care
        [child 1]
        [child 2]
        [child 3]
      ]
    ]
    [Anita Kaur\\Registered Manager
      [Sunny Bell\\Head of Care
        [child 1]
        [child 2]
        [child 3]
      ]
    ]
  ]
\end{forest}
\end{document}


text:
Q: Reduce javascript code I have two functions in my angular project, one is aceitaProposta that does this:
aceitaProposta() {
    this.aceita();
    // some other code
}

and I have recusaProposta:
recusaProposta() {
    this.recusa();
    // some other code
}

Now, the only difference between this.recusa and this.aceita is that the first one increments a property and the second one decrement it. I want to know if there's a way that I can transform these two functions into one function only using something like if to identify if its decrementing or incrementing. This way I would call the same function in both aceitaProposta and recusaProposta. Example:
aceitaProposta() {
   this.incrementDecrement();
    // some other code
}

recusaProposta() {
    this.incrementDecrement();
    // some other code
}

A: Should be pretty easy.
function incrementDecrement(inc: boolean)
{
    inc ? this.prop++ : this.prop--;
}

A: @KingFelix has it. Just pass a boolean.
incrementDecrement(shouldIncrement: boolean) {
  shouldIncrement ? value++ : value--;
}

aceitaProposta() {
    this.incrementDecrement(true);
}

recusaProposta() {
    this.incrementDecrement(false);
}

A: Another way to do this uses ES6 and more 'functional' code. Make the parameter a function instead of a boolean. Then make the change in the function you pass.
update(alteration) {
    x = alteration(x);
}

aceitaProposta() {
    this.update((x) => x - 1);
}

recusalProposta() {
    this.update((x) => x + 1);
}

Without ES6 its a little ugly but you would just add in the anonymous function declarations.


text:
Q: Android Shopify Mobile buy Version - 3.1.1 Retryhandler Error Hi i am using below mentioned code for pulling order conformation. But i can't get Order ID and order details from this Query. Not able to get order id and order details even order confirmed.
Currently i am using shopify mobilebuysdk:buy3:3.1.1
graphClient!!.queryGraph(query).enqueue(
    object : GraphCall.Callback<Storefront.QueryRoot> {
        override fun onResponse(@NonNull response: GraphResponse<Storefront.QueryRoot>) {

            if (response.data()!!.getNode() as Storefront.Checkout != null) {
                val checkout = response.data()!!.getNode() as Storefront.Checkout
                println("CheckOut : " + checkout)

                if (checkout != null) {

                    if (checkout.getOrder() != null) {
                        if (checkout.getOrder().getId().toString() != null) {
                            val orderId = checkout.getOrder().getId().toString()
                            println("Order ID : " + orderId)
                        }
                    }

                }

            }

        }

        override fun onFailure(@NonNull error: GraphError) {}
    }, null,
    RetryHandler.exponentialBackoff(1, TimeUnit.MILLISECONDS, 1.2f)
            .whenResponse<Storefront.QueryRoot> { response ->
                (response.data()?.getNode() as Storefront.Checkout).getOrder() == null
            }
            .maxCount(10)
            .build())

A: val checkoutId = ID(tinyDB!!.getString("New_checkoutID"))
    val query = Storefront.query({ rootQuery ->
        rootQuery
                .node(checkoutId, { nodeQuery ->
                    nodeQuery
                            .onCheckout({ checkoutQuery ->
                                checkoutQuery
                                        .order({ orderQuery ->
                                            orderQuery
                                                    .orderNumber()
                                                    .totalPrice()
                                                    .processedAt()
                                        }

                                        )
                            }
                            )
                }
                )
    }
    )

graphClient!!.queryGraph(query).enqueue(
            object : GraphCall.Callback<Storefront.QueryRoot> {
                override fun onResponse(@NonNull response: GraphResponse<Storefront.QueryRoot>) {
                    val checkout = response.data()!!.getNode() as Storefront.Checkout
                    val orderId = checkout.getOrder().getId().toString()
                }

                override fun onFailure(@NonNull error: GraphError) {}
            }, null,
            RetryHandler.exponentialBackoff(1, TimeUnit.MILLISECONDS, 1.2f)
                    .whenResponse<Storefront.QueryRoot>(
                            { response -> (response.data().getNode() as Storefront.Checkout).getOrder() == null }
                    )
                    .maxCount(10)
                    .build()
    )

A: Have a look at this answer,
Shopify Web Checkout Issue
First thing is to remove HttpCachePolicy from the QraphQL setup. After it try to provide the Network_Only to order status api.
And your issue will be gone.


text:
Q: How To Set a Cron Script to Run Daily I have a PHP file that I would like to run once per day.  I know that in order to do this I need to set up a CRON job.  From my understanding there should be a way to set-up the CRON job within my web host, but I do not know where this is located.  Everything I see about the CRON job has to do with running it from my local computer.  What is the missing link here?  How do I format the filename?  And any other pertinent information on how this is done would be greatly appreciated.

A: Can you login via SSH to your webserver? If so, type crontab -e and there you can edit your crontab file. You can run the script by typing php filename.php (mayber after installing php5-cli first).
I don't know what kind of webserver you have. If you have no terminal access, then you have to look if your provider supports CRON Jobs (then he has to set it up), otherwise there is no possibility to do that.

A: On server (ssh) type crontab -e
Pattern:
* * * * * job
Explanation:
Min(0-59) Hour(0-23) DayOfMonth(1-31) Month(1-12) DayOfWeek(0-6, 0 - Sunday)
Every day in midnight:
0 0 * * * job


text:
Q: Javascript: Change value of x while x is object.style.left; here is my situation:
I have a div with a CSS position of `"left:10px;"
All divs position's are set to fixed.
Now I put this value into a variable (JS):
var Left = document.getElementById("div").style.left;

Now I can alert it: alert(Left); and I get a box witch says "10px"
Here is the fiddle for it: http://jsfiddle.net/L19rq2tk/2/
Now I want to change the value of the position by using the variable Left. I tried every possibility that came to my mind:
Left = "100px"; -->does not work
Left = 100px;   -->does not work
Left = "100";   -->does not work
Left = 100;     -->does not work

Changing the position by the following code works:
document.getElementById("div").style.left="100px";

Would be glad if anyone could help me!

A: left works with position:absolute
Here is updated fiddle
Updated
By adding position weather relative or absolute will do the job. By adding position:absoute could have side effects on your design(as lonic mentioned in comment)
DEMO

A: You must use the explicit form that you mentioned at the end of your answer document.getElementById("div").style.left="100px";. If you are trying to avoid looking up the element each time, you should be able to do something like:
var savedStyle = document.getElementById("div").style;
savedStyle.left = '100px';

You can't set the value they way you are trying to because Left stores a copy of the value, it doesn't point to the same value. When you set Left to a new value you are only changing the value it is storing, not the value that object.style.left is storing. While you can have multiple variables point to the same object, you can't have multiple variables point to the same value. I've included a demo snippet showing the difference.

var x = 1;
var y = x;
document.write('x = ' + x + '
');
document.write('y = ' + y + '
');
document.write('Setting y to 2
');
y = 2;
document.write('x is now = ' + x + '
');
document.write('y is now = ' + y + '
');

var xObj = { myValue: 3 };
var yObj = xObj;
document.write('xObj.myValue = ' + xObj.myValue + '
');
document.write('yObj.myValue = ' + yObj.myValue + '
');
document.write('Setting yObj.myValue to 1
');
yObj.myValue = 1;
document.write('xObj.myValue is now = ' + xObj.myValue + '
');
document.write('yObj.myValue is now = ' + yObj.myValue + '
');

A: See this fiddle.
You've assigned the 100px, but you haven't add position:relative or position:absolute. Due to this fact you haven't seen anything, but it was assigned in the background.

A: by assigning the value to the variable left nothing will be done.
you need to assign the value to the html element.
use
document.getElementById("div").style.left="100px";

left is a var which only holds the prev value.
you also need to give
positon:relative

to your div else it wont move, left, top and other position css can only be applied if the element has some position property which was missing in your.
http://jsfiddle.net/L19rq2tk/
here is your updated fiddle;


text:
Q: Calling iframe link from other js file not working I created an iframe in vex6.html and a js file in styles.gq/test.js and in that file there is the link and id but when I try to call the code in html it does not work.
Here is my code for vex6.html
<!DOCTYPE html>

<title>Page Title</title>

here is my js code
document.getElementById("vex3").src
    = "https://www.obviousplays.tk/gfiles/vex3";

document.getElementById("vex4").src
    = "https://www.obviousplays.tk/gfiles/vex4";

document.getElementById("vex5").src
    = "https://www.obviousplays.tk/gfiles/vex5";

document.getElementById("vex6").src
    = "https://www.obviousplays.tk/Gfiles6/vex6";

document.getElementById("slope").src
    = "https://www.obviousplays.tk/gfiles/slope";

I expected an iframe but instead there seems to be no link for the iframe
it is also spitting out the error cannot set properties of null (setting(src))

A: Add the line
 after the iframe tag.
Worked for me.

A: Error in console: "script.js:3 Uncaught TypeError: Cannot set properties of null (setting 'src')"
Your script is loaded before the iframe content, meaning that you're trying to initialize the source of an unidentified object.
Solution: Place the

Your code is fine and should work (pardon for criticizing). Anytime you seem to use repetitive code, it means that it can be simplified/automated like so:
window.onload = () => {
  // Target all  tags.
  iframes = document.querySelectorAll('iframe');

  // Loop through list of  nodes.
  Array.from(iframes).map(iframe => {
    // Update 's attribute "src" to the origin URL,
    // and use the iframe's attribute "id" value as the final source.
    iframe.setAttribute('src', `https://www.obviousplays.tk/gfiles/${iframe.id}`)
  });
}


text:
Q: How to play mp3 file using volley with async task? Hello friends I am new in android I want play online mp3 file from url I used it async task for playing online mp3 file but problem is that it takes too much time for processing request I heard volley is best for this purpose now I used volley but when request send to server it block my main Ui thread while I heard volley itself manage aysc task and faster performance but in my case I did see anything like that please help how play audio from url faster and second without block main thread with help of volley here audio url and my code
"http://wpaorg.wordproject.com/bibles/app/audio/21/1/1.mp3"
   RequestQueue queue = Volley.newRequestQueue(this);
            String url ="http://wpaorg.wordproject.com/bibles/app/audio/21/"+booknumber+"/"+chapternumber+".mp3";

// Request a string response from the provided URL.
            StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
                    new Response.Listener<String>() {
                        @Override
                        public void onResponse(String response) {
                            // Display the first 500 characters of the response string.

                            Toast.makeText(ALLVERSE.this, ""+response, Toast.LENGTH_SHORT).show();

                        }
                    }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {

                    Toast.makeText(ALLVERSE.this, ""+error, Toast.LENGTH_SHORT).show();

                }
            });

// Add the request to the RequestQueue.
            queue.add(stringRequest);

when i tried send request it takes to much time and second block ui thread why?


text:
Q: Converting Python to JS I need help understanding how to convert some code from Python to JS. Basically, I am trying to ask a series of Y/N questions that follow along with a flowchart. I used if elif nested in python and it was suggested to me to use nested if blocks with JS but I'm not sure how to do that.
I am converting this flowchart questionnaire into a chatbot and there will be a yes or no button to click when each question appears and based on the answer another question will appear or the program will end. I hope this helps to explain my problem. Here is an example of the python code I have for ref that needs to be converted into JS:
question1 = input("Do you like the color green? Please select yes or no: ")
if question1 == "yes":
# Do this.
print("You have answered YES to the previous question")
if question1 == "yes":
    question2y = input("Do you like wearing green? Please select yes or no: ")
    if question2y == "yes":
        print("Thanks for taking the survey")

elif question1 == "no":
# Do that.
print("You have answered NO to the previous question")
if question1 == "no":
    question2n = input("Do you like the color Blue? Please select yes or no: ")
    if question2n == "yes":
        print("You have answered YES to the previous question")

elif question2n == "no":
print("You have answered NO to the previous question")

else:
print("Please select yes or no.")


text:
Q: why side bar dont show in mobile version it disappear? i am following the code from https://adminlte.io/docs/3.0/components/main-sidebar.html it work perfectly in desktop version but when i change into mobile version the side bar is disappeared

      AdminLTE 3

          Alexander Pierce

                Starter Pages

Active Page

what should i do ?