text:
Q: Navigating to another view iPhone sdk? Is it possible for me to navigate to a view that has uitextfield and make it so that uitextfield doesn't change everytime I navigate?

A: If I understood correctly, you want a text that was previously, there...
there is a lot of options but an easy an fast one is have a static NSString....
so in your class you have the uitextfield, in that class you define
static NSString *myString;
then, when the user or you modify it and you have access to it, define it in the static NSString.
Now, to recover it, in the method you initialize that view you do:
myTextField.text = myString;
that, will restore the text.


text:
Q: Flutter UI challenge How to create this kind of UI in flutter. with expanded pageview??

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:movie_app/components/bottom_tabs.dart';
import 'package:movie_app/components/card_image.dart';
import 'package:movie_app/components/expandable_text.dart';
import 'package:movie_app/components/heading.dart';
import 'package:movie_app/constants.dart';
import 'package:movie_app/screens/card_details/components/card_details_cast.dart';
import 'package:movie_app/screens/card_details/components/card_details_photos.dart';
import 'package:movie_app/screens/card_details/components/card_details_reviews.dart';
import 'package:movie_app/screens/card_details/components/card_details_tabs.dart';

import '../../../components/my_text.dart';

import '../card_details.dart';

class Body extends StatefulWidget {
  const Body({Key key}) : super(key: key);

  @override
  State<Body> createState() => _BodyState();
}

class _BodyState extends State<Body> {
  PageController _tabsPageController;
  int _selectedTab = 0;

  @override
  void initState() {
    _tabsPageController = PageController();
    super.initState();
  }

  @override
  void dispose() {
    _tabsPageController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      child: Stack(
        clipBehavior: Clip.none,
        children: [
          Image.network(
            "https://static.wikia.nocookie.net/film-vault/images/c/c8/Furypost.jpg/revision/latest?cb=20171202094520",
            height: 260,
            fit: BoxFit.cover,
          ),
          Positioned(
            top: 100,
            left: 180,
            child: SvgPicture.asset(
              "assets/icons/play icon.svg",
              color: kwhitecolor,
              height: 50,
            ),
          ),
          Container(
            margin: EdgeInsets.only(top: 200, left: 15, right: 15, bottom: 20),
            child: Column(

              children: [
                Row(

                  crossAxisAlignment: CrossAxisAlignment.end,
                  children: [
                    const CardImage(
                      image:
                          "https://m.media-amazon.com/images/M/MV5BMjA4MDU0NTUyN15BMl5BanBnXkFtZTgwMzQxMzY4MjE@._V1_.jpg",
                      width: 120,
                    ),
                    const SizedBox(width: 15),
                    // Text("data"),
                    Column(
                      // mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Row(
                          children: const [
                            MyText(
                              "FURY",
                              fontSize: 22,
                              isBold: true,
                              color: Colors.black,
                            ),
                            SizedBox(width: 2),
                            MyText(
                              "(2014)",
                              fontSize: 14,
                              isBold: true,
                              color: Colors.black,
                            ),
                          ],
                        ),
                        const MyText(
                          "Action/Drama/War",
                          fontWeight: FontWeight.w600,

                        ),
                        const SizedBox(height: 40),
                        Row(
                          children: [
                            const Icon(Icons.remove_red_eye_outlined,
                                color: klightgreyColor),
                            const SizedBox(width: 2),
                            const MyText("1.5M", isBold: true),
                            const SizedBox(width: 10),
                            SvgPicture.asset(
                              "assets/icons/comment.svg",
                              height: 21,
                              color: klightgreyColor,
                            ),
                            const SizedBox(width: 4),
                            const MyText("1K", isBold: true),
                            const SizedBox(width: 10),
                            SvgPicture.asset(
                              "assets/icons/clock.svg",
                              height: 18,
                              color: klightgreyColor,
                            ),
                            const SizedBox(width: 4),
                            const MyText("2h 30min", isBold: true),
                          ],
                        ),
                      ],
                    ),
                  ],
                ),
                const SizedBox(height: 30),

                const Heading(
                  "STORYLINE",
                  fontSize: 18,

                  padding: 0,
                  lineColor: Color.fromARGB(255, 255, 68, 68),
                  // fontWeight: FontWeight.w800,
                ),
                const SizedBox(height: 10),

                const ExpandableText(
                  text:
                      "1945, the Allies are making their final push in the European theater. A battle-hardened Army sergeant nallier (Brad Pitt), leading a Sherman tank and a five-man crew, undertakes a deadly mission behind enemy lines. Hopelessly outnumbered, outgunned and saddled with an inexperienced soldier (Logan Lerman) in their midst, Wardaddy and his men face overwhelming odds as they move to strike at the heart of Nazi Germany.",
                  max: 4,
                ),
                SizedBox(height: 10),
                CardDetailsBottomTabs(
                  selectedTab: _selectedTab,
                  tabPressed: (num) {
                    _tabsPageController.animateToPage(num,
                        duration: const Duration(milliseconds: 300),
                        curve: Curves.easeOutCubic);
                  },
                ),
                // HERE I WANT TO USE EXPANDED WIDGET INSTEAD OF SIZEDBOX, BUT IT GIVES ME ERROR
                SizedBox(
                  height: 300,
                  child: PageView(
                    controller: _tabsPageController,
                    onPageChanged: (num) {
                      setState(() {
                        _selectedTab = num;
                      });
                    },
                    children: const [
                      CardDetailsCast(),
                      CardDetailsPhoto(),
                      CardDetailsReview(),
                    ],
                  ),
                ),

              ],
            ),
          ),
        ],
      ),
    );
  }
}

this is all what I did so far, when I wrap pageview inside expanded widget it gives me error,
So is there any one who could find a way to wrap the pageview with expanded widget???
this is all what I did so far, when I wrap pageview inside expanded widget it gives me error,
So is there any one who could find a way to wrap the pageview with expanded widget???
this is all what I did so far, when I wrap pageview inside expanded widget it gives me error,
So is there any one who could find a way to wrap the pageview with expanded widget???

A: You can follow CustomScrollView with SliverAppBar. Example from SliverAppBar
class MyStatefulWidget extends StatefulWidget {
  const MyStatefulWidget({Key? key}) : super(key: key);

  @override
  State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
}

class _MyStatefulWidgetState extends State<MyStatefulWidget> {
  bool _pinned = true;
  bool _snap = false;
  bool _floating = false;

// [SliverAppBar]s are typically used in [CustomScrollView.slivers], which in
// turn can be placed in a [Scaffold.body].
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: <Widget>[
          SliverAppBar(
            pinned: _pinned,
            snap: _snap,
            floating: _floating,
            expandedHeight: 160.0,
            flexibleSpace: const FlexibleSpaceBar(
              title: Text('SliverAppBar'),
              background: FlutterLogo(),
            ),
          ),
          const SliverToBoxAdapter(
            child: SizedBox(
              height: 20,
              child: Center(
                child: Text('Scroll to see the SliverAppBar in effect.'),
              ),
            ),
          ),
          SliverList(
            delegate: SliverChildBuilderDelegate(
              (BuildContext context, int index) {
                return Container(
                  color: index.isOdd ? Colors.white : Colors.black12,
                  height: 100.0,
                  child: Center(
                    child: Text('$index', textScaleFactor: 5),
                  ),
                );
              },
              childCount: 20,
            ),
          ),
        ],
      ),
      bottomNavigationBar: BottomAppBar(
        child: Padding(
          padding: const EdgeInsets.all(8),
          child: OverflowBar(
            overflowAlignment: OverflowBarAlignment.center,
            children: <Widget>[
              Row(
                mainAxisSize: MainAxisSize.min,
                children: <Widget>[
                  const Text('pinned'),
                  Switch(
                    onChanged: (bool val) {
                      setState(() {
                        _pinned = val;
                      });
                    },
                    value: _pinned,
                  ),
                ],
              ),
              Row(
                mainAxisSize: MainAxisSize.min,
                children: <Widget>[
                  const Text('snap'),
                  Switch(
                    onChanged: (bool val) {
                      setState(() {
                        _snap = val;
                        // Snapping only applies when the app bar is floating.
                        _floating = _floating || _snap;
                      });
                    },
                    value: _snap,
                  ),
                ],
              ),
              Row(
                mainAxisSize: MainAxisSize.min,
                children: <Widget>[
                  const Text('floating'),
                  Switch(
                    onChanged: (bool val) {
                      setState(() {
                        _floating = val;
                        _snap = _snap && _floating;
                      });
                    },
                    value: _floating,
                  ),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to display an error message upon invalid login and route back to username and password screen in ruby sinatra What I want to do is to be able to put an error message of my choosing if username/password combo is wrong I can just make another view but want to be able to just go back to login screen instead if having to go to a invalid login view I know there has to be something simple I can add on next line after :login but when i put "This is a sample error message" or something like that it just will display it and not bring me back to login screen.
post '/login' do
    authenticate
    if @auth == 1
        erb :main
    else
        erb :login
    end
end

A: Well I figured out my issue Im not redirecting anymore i added a parameter to my code
Post '/login' do authenticate if @auth == 1 erb :main else erb:login,:locals => {:message => "Failed"} end end and

get '/login' do erb :login ,:locals => {:message => "!!Type in your username and password!!"}

and in my view file
<form action="/login" method="POST">
<input class="login" type="text" name="username" value="Username">

<input class="login" type="password" name="password" value="Password">

<input class="submit" type="submit" value="Submit...If you dare">
<form action="/login" method="POST">
<%=message%>

</form>


text:
Q: Toshiba Laptop blue screening we have lot of laptop Toshiba which are blue screening.
I have rebuild the laptop, re-install GC drivers and remove wifi and netwrok drivers but still i keep getting blue screen on these laptops. the logs say somthing about GC drivers but its not that its the network card which is causing this. does anyone know the kb number which i can apply to make these laptop stop blue screening.
its happening on Windows 7 x64 Toshiba laptops.
We had same problem with HP(r840) laptop but after applying Windows6.1-KB2664888-x64 and Windows6.1-KB2665206-x64. We haven't had this problem on HP laptops.

A: Have you diagnosed the hard drive at all? Have you tried a fresh install of Windows on any of the units blue screening? Also is there a pattern with the blue screens either on boot up, loading windows, playing music etc? Are the laptops that are bluescreening on the internet? One last question is that does it blue screen in safe mode? let us know,
Thanks


text:
Q: How convert Bitmap to ImageProxy object How convert Bitmap or other data in ImageProxy object or Image object (android.media)?
I find only how to convert ImageProxy or Image to Bitmap and other image formats, not the other way around.


text:
Q: Accordion via bootstrap in IE browser I connected the accordion script via bootstrap.
I implement this in the sidebar. If the screen width is large, then the accordion is not applied, the accordion is added on the mobile view.
Tell me, the IE browser swears at this script. Throws an error - an invalid character.
Where did I make a mistake?
https://ganzola.ru/elektrosamokat/


text:
Q: How to enable my team to run integration tests against RedShift in parallel? I am working with Docker to run my integration tests, it works pretty nice:

*

*I startup my docker containers (one with my server and one with the database)

*I run the IT using arquillian against these containers

Now we are moving to AWS and we would like to use Amazon RedShift for some analysis. The problem is that RedShift is only available in AWS, so I cannot create a RedShift image for Docker.
I would like to have a way that many developers + CI server can run tests in parallel (without affecting each other's results).
I've searched for any references about how people do it, but I could not find anything except for this post from Serenytics, which is not exactly what I need.
The possibilities I see are:

*

*Use one schema for each developer/CI server

*Use a Postgres Docker image for the developers and a real RedShift for the CI Server.

About number 1: it would run against the real DB in all instances, but we would need to have some "private" configuration for each developer and we would have multiple schemas in the database just for testing.
Number 2: We would not run against the real DB engine, so maybe not everything would be supported by Postgres. It could cause problems in the near future.
I imagine I am not the first one with this problem. How can I setup my tests so many people can run the tests in parallel and it doesn't pollute my database?

A: I never worked with RedShift by myself, but the situation you describe is not so special for this specific technology.
Using two different database technologies can be tricky, however, when you have a chance to keep the architecture of your system open to different backend technologies with small effort, I would recommend to use that chance. So if your developers care for making the applications compatible with PostgreSQL and RedShift (which is, according to Wikipedia, based on PostgreSQL 8.0.2 as well), you gain a flexibility which is not just helpful for easier testing. This will also make it easier to switch to a newer backend version in the future, or to support additional host vendors if that will become necessary in the future.
So why not interpret your option #2 as an advantage, to have the possibility to run tests on two (slightly) different backend systems?  Of course, you will have to "abstract away" the differences between the systems, and inform your devs which SQL restrictions they have to obey. Amazon gives a list here, and there are further details (like the ones mentioned by @AdrienChauve) your team has to learn about, but I would expect that to be an initial learning phase, not a thing which slows down your team constantly.
Of course, there might be some failing tests on the "real" RedShift backend which were overlooked using the PostgreSQL backend - that is what your tests are for, right?  What you have to care for if you pick this route: make sure not to develop just on a PostgreSQL server for several weeks and switch afterwards to Redshift, but to test on Redshift regularly and immediatly when the tests on PostgreSQL are done. Since you mentioned a CI server, I guess that is what you already had in mind.
Additionally, I would also recommend to let the door open for option #1. A fixed schema name should not be hardcoded into your applications either, and multiple schemas in one database for testing can be fine, as long as you do not have to fill each test schema with a huge amount of test data. And if you really run into the situation where you need to run tests in parallel directly on RedShift, but for different schemas, you can still decide to do so.

A: In practice there are several small differences between Redshift and a recent Postgres, such as:

*

*order of rows in query set

*timezone conversion

*date diff function

so I prefer running the tests directly on Redshift.
I believe the best bet to setup your tests so that many people can run them in parallel is to use random names for your databases/tables (e.g. test_ + uuid or timestamp, so there is no collision between test runners). Then you need to make sure all these temporary databases/tables are correctly deleted at the end of the tests.

A: Create a snapshot of Redshift, and then spin up smaller Redshift clusters for each developer at integration test time. Trash the clusters when the tests are done. If performance testing is important then spin-up larger clusters. As long as you don't keep the cluster up too long it won't cost too much.

*

*You should use different AWS accounts for Production & development (and whatever other environments you use)

*Share the snapshot from production to the development AWS account

*There are some good tools you can use to automate this (in order of my preference): Terraform, Ansible, Cloudformation

*You can export a Redshift connection string from those processes which should be the only changing dependency between your containerized server and Redshift. If you have a proxy/bastion/jumperserver and some DNS then you can maintain a name for each developer and switch in the Redshift backend when needed and then your developers don't need to alter that connection string dependency.

Other options:

*

*You could use different database names or schemas but there's hidden dangers with that approach, and then you are either testing on Prod or you have a development cluster up all the time costing a lot, and tests colliding or performance interference.

*docker-amazon-redshift  This is just postgres 8.02 in a container, it won't have any of the newer additions, functions or backports in it so testing might give a lot of false positive bugs that you won't get on real Redshift.
I hate the idea of CI finding errors that you can't detect during developer testing because the database engine is different. There's a lot of people who suggest you should be database-agnostic, but unless you are creating enterprise software for clients with different databases then I find that advice to be a bit unrealistic.
There really is no way to support multiple databases universally. ANSI/ISO SQL is not adhered to strictly by any vendor. You will end up supporting the quirks of multiple database vendors, even if you only aspire to the lowest common-denominator functionality. Or just give up and use sqlite for everything (don't do that).
It will not be a lovely elegant universal abstraction layer. Take a look at any decent ORM or database API from any language and see where the abstraction leaks or is unsupported for different target back-ends.


text:
Q: String parsing in Objective C iOS efficiently I have a (NSDictionary * record) with keys ATTR1,ATTR2,ATTR3.
I have a dynamic where clause which needs to be applied to a sql lite database. But before constructing the fetch request, the predicate has to be in  "ATTR1=%@ AND ATTR2=%@ AND ATTR3=%@"  format. Also I have a static string whereClause defined in this format "ATTR1=:ATTR1 AND ATTR2=:ATTR2 AND ATTR3=:ATTR3" (Note : This format is unchangeable. It is defined at the customer's  production server).  By dynamic I mean that the ":ATTR1" , ":ATTR2", ":ATTR3" should get replaced by the values in the dictionary variable record mentioned above.
So to create a predicate , I need the following String and Array of attributes to be created so that I execute the fetch request.
"ATTR1=%@ AND ATTR2=%@ AND ATTR3=%@"
["ATTR1","ATTR2","ATTR3"]
The solution I found was like below :
 NSString * whereClause = @"ATTR1=:ATTR1 AND ATTR2=:ATTR2 AND ATTR3=:ATTR3";
 NSArray * primaryTokens = [whereClause componentsSeparatedByString: @":"];
 NSUInteger  primaryTokenCount = [primaryTokens count];
 NSMutableString * finalWhereClause = [[NSMutableString alloc] initWithString:primaryTokens[0]];
 NSMutableArray * attributes = [[NSMutableArray alloc]init];
 if(primaryTokenCount >1)
 {
    for(int i=0;i<(primaryTokenCount-1);i++){
        NSArray * secondaryTokens = [primaryTokens[i+1] componentsSeparatedByString: @" "];
        NSUInteger secondaryTokenCount = [secondaryTokens count];
        if(secondaryTokenCount > 1)
        {
            [finalWhereClause appendString:@"%@"];
            NSArray * newSecondaryArray = [secondaryTokens subarrayWithRange:NSMakeRange(1,[secondaryTokens count]-1)];
            [finalWhereClause appendString:@" "];
            [finalWhereClause appendString:[newSecondaryArray componentsJoinedByString:@" "]];
        }
    [attributes addObject:secondaryTokens[0]];
    }
[finalWhereClause appendString:@"%@"];
}
NSLog(@"THE FINAL PARSED STRING IS : %@",finalWhereClause);
NSLog(@"THE FINAL ATTRIBUTES IS : %@",[attributes componentsJoinedByString:@","]);

The above code works . But it has the overhead of using 3 extra arrays and separating by components in every run of the primary loop. Is there an efficient way in Objective C to achieve this parsing so as to avoid this over head of extra storage. This  method would be called extensively. Hence any help would be appreciated.

A: NSString *whereClause = @"ATTR1=:ATTR1 AND ATTR2=:ATTR2 AND ATTR3=:ATTR3";
NSString *finalWhereClause = whereClause;

NSArray *clauseComponents = [whereClause componentsSeparatedByString: @" "];
NSMutableArray *attributes = [NSMutableArray new];

for (NSString *component in clauseComponents) {

    if ([component containsString:@":"]) {

        NSString *paramName = [component substringFromIndex:[component rangeOfString:@":"].location + 1];
        [attributes addObject:paramName];

        NSString *separatedParamName = [@":" stringByAppendingString:paramName];
        finalWhereClause = [finalWhereClause stringByReplacingOccurrencesOfString:separatedParamName withString:@"%@"];

    }

}

NSLog(@"THE FINAL PARSED STRING IS : %@",finalWhereClause);
NSLog(@"THE FINAL ATTRIBUTES IS : %@",[attributes componentsJoinedByString:@","]);


text:
Q: What's going on here with my freshly compiled perl? I compiled perl with a relocatable @INC as follows:
$ sh Configure -des -D prefix=~/perl -Duserelocatableinc

After I set up my path etc I get the following:
$ perl -e 'use strict; print "ok"'
Can't locate strict.pm in @INC (@INC contains: ../lib/site_perl/5.12.4/darwin-2level ../lib/site_perl/5.12.4 ../lib/5.12.4/darwin-2level ../lib/5.12.4 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

If I do this though, everything it's all OK?
$ `which perl` -e 'use strict; print "ok"'

Have I done something wrong?  This is on OS X.
Here's the output for perl -V:
$ perl -V
Can't locate Config.pm in @INC (@INC contains:     ../lib/site_perl/5.12.4/darwin-2level ../lib/site_perl/5.12.4     ../lib/5.12.4/darwin-2level ../lib/5.12.4 .).
BEGIN failed--compilation aborted.

$ `which perl` -V
Summary of my perl5 (revision 5 version 12 subversion 4) configuration:

  Platform:
    osname=darwin, osvers=10.8.0, archname=darwin-2level
    uname='darwin fenchurch-2.local 10.8.0 darwin kernel version 10.8.0: tue     jun 7 16:33:36 pdt 2011; root:xnu-1504.15.3~1release_i386 i386 '
    config_args='-des -D prefix=/Users/kd/perl -Duserelocatableinc'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp     -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include     -I/opt/local/include',
    optimize='-O3',
    cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp     -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include     -I/opt/local/include'
    ccversion='', gccversion='4.2.1 (Apple Inc. build 5666) (dot 3)',     gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',     lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector     -L/usr/local/lib -L/opt/local/lib'
    libpth=/usr/local/lib /opt/local/lib /usr/lib
    libs=-lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup     -L/usr/local/lib -L/opt/local/lib -fstack-protector'

Characteristics of this binary (from libperl):
  Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL
                        USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO
                        USE_PERL_ATOF
  Built under darwin
  Compiled at Jul 16 2011 15:44:19
  %ENV:
    PERL_MM_USE_DEFAULT="1"
  @INC:
    /Users/kd/perl/lib/site_perl/5.12.4/darwin-2level
    /Users/kd/perl/lib/site_perl/5.12.4
    /Users/kd/perl/lib/5.12.4/darwin-2level
    /Users/kd/perl/lib/5.12.4
    .

A: OK, found a bug report:
http://www.nntp.perl.org/group/perl.perl5.porters/2011/03/msg169818.html

A: Do you get anything for perl -V? Using the capital V shows the version and the compilation options, including the @INC directories. Ensure those directories are where the modules are.
Also note that in prefix, you're nominating the directory for installation, so perl should be in ~/perl/bin/perl. Is that the perl you are running? I wouldn't expect which to find that unless you have already adjusted your PATH.

A: I can't imagine a scenario where you would rather precompile the Perl interpreter with a new @INC path rather than just setting it into the environment or establishing it in the Perl script itself.
Compiling a new lib path into Perl seems excessive and fragile.
I think you're much better off passing it as an argument:
PERL5LIB="/my/new/path":$PERL5LIB /path/to/my/script.pl

or inside the script itself, since you already know the path required:
push(@INC, "/my/new/path");


text:
Q: Unexpected RadioButton behavior
Here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFFFF">

<RadioGroup
    android:id="@+id/choices_group"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:layout_centerInParent="true"
    android:orientation="vertical"
    android:background="@drawable/rounded_bg" >

    <RadioButton
        android:id="@+id/choice_a"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:padding="5dp"
        android:text="Choice A" />

    <RadioButton
        android:id="@+id/choice_b"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="Choice B" />

    <RadioButton
        android:id="@+id/choice_c"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="Choice C" />

    <RadioButton
        android:id="@+id/choice_d"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:text="Choice D" />
</RadioGroup>
</RelativeLayout>

Why are the radio buttons superimposed over the text?

A: Problem was with the padding. Once I removed the padding, everything worked as usual. This might be a bug.

A: Why are you using a relative layout? Put the radiogroup in a linearlayout, then put the lienarlayout in the relativelayout.
Try changing the radiobutton layout_width from fill_parent to wrap_content

A: Is there a reason you're using RelativeLayout? That could be the problem.. Otherwise, I'd just increase the padding. I had this problem when using custom button images.

A: Use AppCompatRadioButton, this issue has been release in AppCompat 22.1 library


text:
Q: A detail in Rădulescu's Theorem proof I've been following one Rădulescu's Theorem proof ($G$ is hyperlinear if and only if $\mathcal{L}_{G}$ can be embedded in a ultrapower of the hyperfinite type-$II_{1}$ factor $\mathcal{R}$, where $\mathcal{L}_{G}$ denotes the von Neumann group algebra). I am, however, stuck in a detail that appears to be trivial, since it is not specified in any article I'm reading. So you'll excuse me if this question is quite trivial, but I've been just learning this by myself, out of interest.
Here it goes : Why is it that given a group monomorphism $\Phi : G\rightarrow \mathcal{R}^{\mathcal{U}}$, where $\mathcal{U}$ is an ultrafilter in $\mathbb{N}$ and such that $\tau(\Phi(g))=0$, for every $g\in G\setminus{1_{G}}$ - where $\tau$ denotes the trace - can be extended to a von Neumann algebra embedding $\mathcal{L}_{G}\rightarrow \mathcal{R}^{\mathcal{U}}$?
Thank you for the attention !

A: The conditions guarantee that the linear extension of $\Phi$ is an isometry in the $2$-norm. Indeed,
$$
\left\|\Phi\left(\sum_k\alpha_k\,g_k\right)\right\|_2^2=\left\|\sum_k\alpha_k\Phi(g_k)\right\|_2^2=\tau_{\mathcal U}\left(\sum_{k,j}\overline{\alpha_j}\alpha_kg_j^{-1}g_k\right)
=\sum_{k,j}\overline{\alpha_j}\alpha_j\tau_{\mathcal U}(g_j^{-1}g_k)\\
=\sum_k|\alpha_k|^2=\left\|\sum_k\alpha_k\,g_k\right\|_2^2.
$$
Any II$_1$-factor is closed in the 2-norm topology, so the above isometry guarantees the embedding. Interestingly, once you deduce that it is an embedding, it is automatically norm-isometric.


text:
Q: Joining many tables together using key from first table for all joins? I would like to do something like this but can't get it to work:
SELECT A.*,B.*,C.* FROM tableA A LEFT JOIN
B ON A.ID = B.ID
C ON A.ID = C.ID

I.e. I need to use a field from the first table for all joins as tableB and tableC don't
has any fields to link them together.
Can this be done?

A: you missed a join !
SELECT A.*,B.*,C.* FROM tableA A
LEFT JOIN
B ON A.ID = B.ID
left join
C ON A.ID = C.ID

A: Try this one -
SELECT *
FROM dbo.tableA A
LEFT JOIN dbo.B ON A.ID = B.ID
LEFT JOIN dbo.C ON A.ID = C.ID


text:
Q: Obtain other 'objects/records' as property of another 'column/attribute' I have 3 tables:
Item and OwnerImage have Foreign Key to Owner. Not all Owner have Item(s)
Item

id  name    owner_id (fk)
1   alpha   1
2   beta    1

Owner

id name
1   owner1
2   owner2

OwnerImage

id  name    owner_id (fk)
1   image1   1
2   image2   1

I want to get a list of all Items, and their Owner and OwnerImage, which I can do with a join.
But it is possible, to get the Owner as a 'property' of Item from database:
Item.Owner.OwnerImage (like an object)
At this moment I'm doing 3 queries and do the matching using loops in code(python), but I want to know if it is possible with one query;

A: You can use a join to select data for a given value in another table where a relationship exists:
select owner
from owner o1
inner join ownerimage o2
on o2.owner_id = o1.id

Not sure how EVENT ties into this, but this should get you started


text:
Q: Android - posting data from Android SQLite DB to MySQL DB on localhost server I'm doing some assignment, and I need to enable sync of SQLite DB data to MySQL DB on localhost server. On button click, data from SQLite needs to be "gathered", converted to JSON and sent to localhost MySQL DB and inserted there. I made Activity that handles that job, made some PHP according to academy example, and have wamp server running where I made database in which data needs to be stored.
On my localhost database is named employes_db , and table within is named employes.
Here is the code from android studio which I made:
package com.EmDatabase;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DataSyncManager extends Activity {

Database db;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.sync_options);
    db = new Database(this);
    db.getWritableDatabase();
}

public void syncToServer(View v) throws JSONException {
    List<Employe> employes = db.selectAll();
    JSONObject objEmployes = new JSONObject();
    JSONArray employesData = new JSONArray();
    for (Employe employe : employes) {
        int id = employe.getId();
        String name = employe.getName();
        String surname = employe.getSurname();
        int age = employe.getAge();
        String company = employe.getCompany();
        String wtype = employe.getWorktype();
        JSONObject empData = new JSONObject();
        empData.put("id", id);
        empData.put("name", name);
        empData.put("surname", surname);
        empData.put("age", age);
        empData.put("company", company);
        empData.put("worktype", wtype);
        employesData.put(empData);
    }
    objEmployes.put("all_employes", employesData);
    String result = objEmployes.toString();
    System.out.println(result);
    UploadJsonStringTask task = new UploadJsonStringTask();
    task.execute(
            new String[] { "http://10.0.2.2/employes_db/register.php", result}
    );
}

public void syncFromServer(View v) {

}

private class UploadJsonStringTask extends AsyncTask<String, Void, String> {

    @Override
    protected String doInBackground(String... params) {
        String response = "";
        Map<String,String> queries = new HashMap<String, String>(1);
        queries.put("all_employes", params[1]);
        try {
            response += postHttpContent(params[0],queries);
        } catch (IOException e) {
            Log.e("error", e.toString());
        }
        return response;
    }
    @Override
    protected void onPostExecute(String result) {
        Toast.makeText(getApplicationContext(), result, Toast.LENGTH_LONG).show();
    }

    public String postHttpContent(String urlString, Map<String, String> queries) throws IOException {
        String response = "";
        URL url = new URL(urlString);
        HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();
        httpConnection.setDoInput(true);
        httpConnection.setDoOutput(true);
        httpConnection.setUseCaches(false);
        httpConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

        String postData = "";
        for (String key : queries.keySet()) {
            postData += "&" + key + "=" + queries.get(key);
        }
        postData = postData.substring(1);
        DataOutputStream postOut = new DataOutputStream(httpConnection.getOutputStream());
        postOut.writeBytes(postData);
        postOut.flush();
        postOut.close();

        int responseCode = httpConnection.getResponseCode();
        if (responseCode == HttpURLConnection.HTTP_OK) {
            String line;
            BufferedReader br = new BufferedReader(new InputStreamReader(httpConnection.getInputStream()));
            while ((line = br.readLine()) != null) {
                response += line;
            }
        } else {
            response = "";
            throw new IOException();
        }
        return response + " *** Uploaded!";
    }
}

public void goBack(View v) {
    Intent in= new Intent(DataSyncManager.this,MainActivity.class);
    startActivity(in);
}

}
And here is the PHP file I made and inserted into wampserver/www/employes_db (register.php):
<?php
$id = 0;
$name = "";
$surname = "";
$age = 0;
$company = "";
$worktype = "";
$conn = new mysqli("localhost","root","","employes_db");
$conn->query("insert into employes values (null,'".$_POST['id']."','".$_POST['name']."','".$_POST['surname']."','".$_POST['age']."','".$_POST['company']."','".$_POST['worktype']."')");
if(!$conn->error) echo "{status:0}"; else echo "{status:-1}";
?>

When I launch app, insert one row in SQLite database, than hit sync button, and I open "localhost/employes_db/register.php" I get "errors" -> Notice: Undefined index: id in C:\wamp64\www\employes_db\register.php on line 9 <- And same error for rest of columns(name,surname,age,company,wtype).
May someone help, where is my mistake?

A: Undefined index: id means $_POST['id'] does not exist. The first mistake is that you use $_POST to retrieve data, use $_GET instead. The second one is that to retrieve the data using $_GET you've to access your URL like this: localhost/register.php?id=myID.

In your case you are sending the data via HTTPPost so just use file_get_contents('php://input') to get your JSON string, decode the JSON data (json_decode($myJSONString)) you are receiving and send it to your second database.

EDIT
If i understood your problem correctly you could do it like this:
// get all employees from your first database and write them into a JSONArray

List<Employe> employes = db.selectAll();
JSONObject objEmployes = new JSONObject();
JSONArray employesData = new JSONArray();
for (Employe employe : employes) {
    int id = employe.getId();
    String name = employe.getName();
    String surname = employe.getSurname();
    int age = employe.getAge();
    String company = employe.getCompany();
    String wtype = employe.getWorktype();
    JSONObject empData = new JSONObject();
    empData.put("id", id);
    empData.put("name", name);
    empData.put("surname", surname);
    empData.put("age", age);
    empData.put("company", company);
    empData.put("worktype", wtype);
    employesData.put(empData);
}

// open connection
URL url = new URL("yourUrl.com/yourPhpScript.php");
url.openConnection();

// send JSONArray to your second database
String dataToSend = employesData.toString();
OutputStream os = urlConnection.getOutputStream();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "UTF-8"));
writer.write(dataToSend);
writer.flush();
writer.close();

PHP Script:
<?php
// connect to database
$link = mysqli_connect($hostname, $username, $password);
mysqli_select_db($link, "myDatabase");

// get the JSONArray the app sends
$contents = file_get_contents('php://input');

$jsonArray = json_decode($contents, true);
$jsonCount = count($jsonArray);

for ($i = 0; $i < $jsonCount; $i++) {
    $item = $jsonArray[$i];
    $itemName = utf8_decode($item['name']);
    // parse the other json attributes here like the one above

    $query = "INSERT INTO employees VALUES('$itemName', 'addOtherValuesHere...')";
    mysqli_query($link, $query);
}


text:
Q: Why does $(x)$ generate $R$? The proof of $1 - rx$ is a unit $\iff x\in J$ where $J$ is Jacobson Radical Here is a sample proof from Dummit and Foote

Why does some random element $x \in R - M$ (together with $M$) generate the whole ring? I think in this context $R$ is a commutative ring with $1$. But if $x$ is chosen such that it is a non unit, how can it generate $1$ for example?

A: $M$ is by assumption a maximal ideal. $(x,M)$ is an ideal which contains it, and since $x\notin M$ the inclusion $M\subseteq (x,M)$ is proper. Since $M$ is maximal this implies $(x,M)=R$.


text:
Q: Updating rows of the same index Given a DataFrame df:
                            yellowCard secondYellow redCard
match_id          player_id
1431183600x96x30  76921              X          NaN     NaN
                  76921            NaN            X       X
1431192600x162x32 71174              X          NaN     NaN

I would like to update duplicated rows (of the same index) resulting in:
                            yellowCard secondYellow redCard
match_id          player_id
1431183600x96x30  76921              X            X       X
1431192600x162x32 71174              X          NaN     NaN

Does pandas provide a library method to achieve it?

A: It looks like your df is multi-indexed on match_id and player_id so I would perform a groupby on the match_id and fill the NaN values twice, ffill and bfill:
In [184]:
df.groupby(level=0).fillna(method='ffill').groupby(level=0).fillna(method='bfill')

Out[184]:
                             yellowCard  secondYellow  redCard
match_id          player_id
1431183600x96x30  76921               1             2        2
                  76921               1             2        2
1431192600x162x32 71174               3           NaN      NaN

I used the following code to build the above, rather than use x values:
In [185]:
t="""match_id player_id yellowCard secondYellow redCard
1431183600x96x30  76921              1          NaN     NaN
1431183600x96x30  76921            NaN           2       2
1431192600x162x32 71174              3          NaN     NaN"""
df=pd.read_csv(io.StringIO(t), sep='\s+', index_col=[0,1])
df

Out[185]:
                             yellowCard  secondYellow  redCard
match_id          player_id
1431183600x96x30  76921               1           NaN      NaN
                  76921             NaN             2        2
1431192600x162x32 71174               3           NaN      NaN

EDIT there is a ffill and bfill method for groupby objects so this simplifies to:
In [189]:
df.groupby(level=0).ffill().groupby(level=0).bfill()

Out[189]:
                             yellowCard  secondYellow  redCard
match_id          player_id
1431183600x96x30  76921               1             2        2
                  76921               1             2        2
1431192600x162x32 71174               3           NaN      NaN

You can then call drop_duplicates:
In [190]:
df.groupby(level=0).ffill().groupby(level=0).bfill().drop_duplicates()

Out[190]:
                             yellowCard  secondYellow  redCard
match_id          player_id
1431183600x96x30  76921               1             2        2
1431192600x162x32 71174               3           NaN      NaN

A: If you do a
df.groupbby([df.match_id, df.player_id]).min()

the default behavior for NaN will ignore them. For DataFrames of the form in your example (all disagreements are between NaNs and filled values), this will do the job.
Edit
I assumed the X values were placeholders for floats. For strings, use a combination of ffill and bfill like EdChums answer (which should be accepted).


text:
Q: Where is brew supposed to put its link to its Python binary? I recently tried to upgrade my Python version via brew and now I am stuck with OSX's system Python because Brew does not seem to be creating a link to it's Python binary.
brew link python outputs (yes I've tried relinking):

Warning: Already linked: /usr/local/Cellar/python/2.7.5
To relink: brew unlink python && brew link python

brew --prefix outputs:
/usr/local

And yet ls /usr/local/python outputs:

ls: /usr/local/python: No such file or directory

Am I misunderstanding how brew is supposed to be working? Shouldn't it be putting a link to a python binary in my /usr/local/bin directory?


text:
Q: docker: Error response from daemon: network mongo-network not found I am trying to create a container in a network but while creating I am getting this error:
docker: Error response from daemon: network mongo-network not found

Here mongo-network is the name of network which i have created. The command I am using is:
docker run --network mongo-network -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=password --name mongodb -d mongo

Error in this command or something else happens. How to slove this problem?

A: Raj use $docker network ls to see the available networks. Use the name of the network created or present in place of mongo-network. If you wanna use the same network name, you first need to create a network by the name mongo-network you can use the following command:
$docker network create -d bridge mongo-network

If you use the default network name it would be something like this.
$docker run --network none -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=password --name mongodb -d mongo

Or else you can execute your command and wont be having an error.


text:
Q: Angular Http.Post not sending request I have created a user service in angular for registering a user in my database, but for some reason the angular http.post method doesn't send any request, I also checked my network tab and the request is missing, here is my code :
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { User } from '../models/user';

@Injectable({
  providedIn: 'root'
})
export class UserService {

  constructor(private http: HttpClient) { }

  registerUser(body: User) {
    console.log(body);
    return this.http.post("http://localhost:8080/api/register", body).subscribe(response => console.log(response));
  }
}

import { Component, OnInit } from '@angular/core';
import { User } from 'src/app/models/user';
import { UserService } from 'src/app/services/user.service';

@Component({
  selector: 'app-register',
  templateUrl: './register.component.html',
  styleUrls: ['./register.component.scss']
})
export class RegisterComponent implements OnInit {
  user = new User();

  constructor(
    private userService: UserService
    ) { }

  register() {
    console.log(this.user)
    this.userService.registerUser(this.user);
  }

  ngOnInit(): void {
  }

}

A: I found out that the the http interceptor was sending the Authorization headers and for some reason when i skipped sending the headers it started working
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
    let auth = <string>localStorage.getItem('auth')
    console.log('Interceptor called: '+ auth);
        if (req.headers.get("skip"))
           return next.handle(req);

        if(auth !== undefined){
          req = req.clone({
            setHeaders:{
              Authorization: auth
            }});
          }
        return next.handle(req);

and I updated the post method as goes:
return this.http.post<User>("http://localhost:8080/api/register", body, {headers: {skip: 'true'}});

A: I don't know if it will sove your issue, but you don't have to subscribe into the service. The service is mainly used to get datas from API. So try :
registerUser(body: User): Observable<User> {
  return this.http.post<User>("http://localhost:8080/api/register", body);
}

Then in your component :
ngOnInit(): void {
  this.register();
}

register() {
  this.userService.registerUser(this.user).subscribe(response => {
    console.log(response);
  });
}


text:
Q: How to use buildscript dependencies in custom classes? I am using a couple of helper classes with my build script, the folder structure looks like
buildSrc
  -src
     -main
       -groovy
           GitUtils.groovy
build.gradle

In GitUtils I am trying to import a couple of classes (from grgit & http-builder in this example) used in a custom library. But it does not work, I get "Unable to resolve class XXX" exceptions. These classes are resolved fine if they are in build.gradle.
Relevant part of build.gradle:
buildscript {
  repositories {
    jcenter()
    mavenCentral()
  }
  dependencies {
    classpath 'org.ajoberstar:grgit:1.3.0'
    classpath 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
  }
}

dependencies {
  compile 'org.ajoberstar:grgit:1.3.0'
  compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
}

...
GitUtils.doStuff();

A: The clean solution is to declare the dependencies you have in GUtils in your buildSrc/build.gradle file:
apply plugin:'groovy'

repositories {
  jcenter()
  mavenCentral()
}
dependencies {
  compile gradleApi()
  compile 'org.ajoberstar:grgit:1.3.0'
  compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
}

A: Since your buildSrc class is in groovy, please ensure the following are included in your build.gradle:
apply plugin: 'groovy'

dependencies {
    compile 'org.codehaus.groovy:groovy-all:2.2.1'
}


text:
Q: Rails: redirect to current path but different subdomain I think this should be fairly easy but I'm not familiar with how it's done...
How do you write a before filter that would check if the current request is for certain subdomains, and if so redirect it to the same url but on a different subdomain?
Ie: blog.myapp.com/posts/1 is fine but blog.myapp.com/products/123 redirects to www.myapp.com/products/123.
I was thinking something like...
class ApplicationController < ActionController::Base
  before_filter :ensure_domain

  protected
  def ensure_domain
    if request.subdomain == 'blog' && controller_name != 'posts'
      redirect_to # the same url but at the 'www' subdomain...
    end
  end
end

How do you write that redirect?

A: A simple choice to redirect from subdomain to subdomain would be the following
redirect_to subdomain: 'www', :controller => 'www', :action => "index"

This would be called on a domain name for example foo.apple.com would then go to www.apple.com

A: An even simpler option without the need to do a string sub or specify the controller or action would be to use
redirect_to url_for(subdomain: 'www', only_path: false)

A: ActionController::Redirecting#redirect_to allows you to pass an absolute URL, so the easiest thing to do would be to pass it one with something like:
redirect_to request.url.sub('blog', 'www')

A: A simple solution for this is
redirect_to dummy_rul(subdomain: 'subdomain')

Example:
redirect_to projects_url(subdomain: 'edv') it will redirect on below url

"http://edv.maindomain.com/projects"

"edv" is my subdomain


text:
Q: Bus stops and routes in SUMO I recently started using SUMO traffic simulator and I am trying to simulate an intermodal network.
I've been able of launch a simulation with cars and buses using vTypeDistribution and randomTrips.py.
Now I am trying to simulate a realistic public transport network using ptlines2flows.py.
I am able to obtain all the bus stops and trips, but not to obtain the routes. In fact I get multiple warnings like this:
Warning: busStop '25902051' for vehicle '55_subway_L4:0' on lane '497770366_0' is not downstream the current route.
and 0 vehicles are loaded. Also, I get this error:
Error: Vehicle '39_bus_73:0' is not allowed on any lane of via edge '45100166#0'.
It seems that the program tries to put a bus in metro/underground lines.
I attach my bash script where I do everything:
#!/bin/bash
source autosumo_parameters.sh

# 1. Links and folder creations
mkdir -p ${folder}
cd ${folder}
ln -sf ../$map .    # Link to where is the map (downloaded manually at the moment)
rm ${conf_file}

# 2. Create SUMO network from .osm map
#netconvert --osm-files ${map} --output-file ${network} --geometry.remove --roundabouts.guess --ramps.guess --junctions.join --tls.guess-signals --tls.discard-simple --tls.join

netconvert --osm-files ${map} --output-file ${network} --osm.stop-output.length 15 --ptstop-output ${ptstops_out} --ptline-output ${ptlines_out} --osm.elevation --geometry.remove --roundabouts.guess --ramps.guess --junctions.join --tls.guess-signals --tls.discard-simple --tls.join

# 2.2 Create public transport schedules
python3 /home/alejandro/Documentos/sumoDocs/pythonScripts/ptlines2flows.py -n ${network} -s ${ptstops_out} -l ${ptlines_out} -o ${ptroutes} -p 300 --min-stops 1 --use-osm-routes --verbose

#python3 $SUMO_HOME/tools/ptlines2flows.py -n ${network} -s ${ptstops_out} -l ${ptlines_out} -o ${ptroutes} -p 300 --min-stops 1 --use-osm-routes --verbose

# 3. Create SUMO simulation configuration file
  echo "<?xml version='1.0' encoding='iso-8859-1'?>

<configuration xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://sumo.dlr.de/xsd/duarouterConfiguration.xsd'>

    <input>
        <net-file value='${network}'/>
        <route-files value='${ptroutes}'/>
    <additional-files value='${ptstops_out}'/>
    </input>

    <output>
        <emission-output value='${emi_out}'/>
    <fcd-output value='${fcd_out}'/>
    </output>

    <time>
        <begin value='${begin_time}'/>
        <end value='${end_time}'/>
    </time>

    <processing>
        <time-to-teleport value='${teleport}'/>
    </processing>

</configuration>" > $conf_file
#fi

#sumo -c $conf_file --fcd-output $fcd_out --emission-output $emi_out --device.emissions.period "20.0"
sumo -c $conf_file --ignore-route-errors
echo " \n sumo done"

# Open the configuration file in sumo-gui to launch the simulation
#sumo-gui $conf_file

# traceExporter.py converts fcd-output file to different file formats: OMNET, Shawn, ns2/ns3, PHEM
python3 $SUMO_HOME/tools/traceExporter.py --fcd-input $fcd_out --omnet-output fcd_to_omnet.xml #--kml-output fcd_to_kml.xml

Would you be so kind to help me? I would really appreciate it, I've been stucked with this a few days...

A: I got it finally, the problem was in the network and lanes permissions. Apparently, if you import an OpenStreetMap file, SUMO assignes permissions to highway.services road type only to bicicles, pedestrians and delivery vehicles.
To modify this, you have to change the road access permissions in the typemap file you are using. Those are located in $SUMO_HOME/data/typemap. The file used by default is called osmNetconvert.typ.xml, then you can change the permissions adding or removing vehicle type, it looks like this:
<type id="highway.service"        numLanes="1" speed="5.56"  priority="1"  oneway="false" allow="delivery pedestrian bicycle bus"/>

Once the permissions are correct, there was no problem running the simulation.


text:
Q: Outbound Messaging: ActionId I'm investigating the use of Outbound messaging for some integrations we need to make with SalesForce.
According to the documentation, the outbound message includes an ActionId field which is a salesforce id. Does anyone know which custom object the ActionId is the primary key for and whether it is queryable using SOPI?
Background
I'd like to create a generic endpoint for all our outbound messages so we can use publish/subscribe to route the various notifications to interested applications. It would be useful if applications could subscribe to notifications based on the developer name of the action so I'd like to translate the ActionId into this value.

A: according to the documentation its id of the workflow rule::
ActionId   string  The workflow rule (action) that triggers the message.
you can not query Workflow's using SOQL, but you can run a listMetadata call against the MetaData API that will return a list of workflow rules and record ids
http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_listmetadata.htm

A: In v32.0 of the Tooling API WorkflowOutboundMessage was exposed. You can query this in the Tooling API using the ActionId as the WorkflowOutboundMessage.Id. From there you can determine which workflow outbound message started the process.
See also: Possible to distinguish (from xml request) which outbound message/workflow trigger was called?


text:
Q: No se pudo cargar el tipo 'Proyecto.MvcApplication' Me salta al intentar iniciar el siguiente error:

Error de servidor en la aplicación '/'. Error del analizador
  Descripción: Error al analizar el recurso requerido para dar servicio
  a esta solicitud. Revise los detalles de error de análisis específicos
  y modifique el archivo de código fuente en consecuencia.
Mensaje de error del analizador: No se pudo cargar el tipo
  'Proyecto.MvcApplication'.
Error de código fuente:
Línea 1: <%@ Application Codebehind="Global.asax.cs"Inherits="Proyecto.MvcApplication" Language="C#" %>
Archivo de origen: /global.asax Línea: 1

Mi proyecto es uno nuevo basado en otro antiguo, no se exactamente que falla ahi porque MvcAplication existe.
global.ajax.cs
namespace Proyecto
{

    public class MvcApplication : HttpApplication
    {
        public static readonly ILog log = LogManager.GetLogger(typeof(MvcApplication));
        protected void Application_Start()
        {
            log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4net.config")));
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            var builder = new ContainerBuilder();
            // Register your MVC controllers.
            builder.RegisterControllers(typeof(MvcApplication).Assembly);

            builder.Register(c => HttpContext.Current.User.Identity).As<IIdentity>();

            // Set the dependency resolver to be Autofac.
            var container = builder.Build();
            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
        }
        void Application_End(object sender, EventArgs e)
        {
            // Code that runs on application shutdown

            LogManager.Shutdown();
        }
    }
}

No comprendo que puede estar sucediendo, ¿las referencias estarán corruptas? ¿Algún conflicto interno con algún elemento?
Si el elemento no encontrado existe y se encuentra en el lugar especificado en el error. Al compilar o recompilar la solución no me muestra ningún error, pero en el momento que ejecuto el IIS express para visualizar la web me salta un mensaje de error en la compilación.
¿De que puede venir ese error?

A: El problema era que tenia dos proyectos vinculados en una misma solución con diferentes Frameworks, la solución ha sido:

*

*Click derecho en los proyectos y pulsar propiedades.

*En la pestaña Aplicación seleccionar en Plataforma de destino el mismo framework.

*Reiniciar.

Esto soluciona el error y ejecuta correctamente la web.


text:
Q: quantmod - getQuote() not working for tickers on different exchanges I am going through the quantmod-getQuote() to find a solution to the problem I am running into (link).
When I run the following;
metrics <- yahooQF(c("Name", "Volume", "P/E Ratio", "Dividend Yield", "Shares Outstanding"))
symbols2 <- c("GOOG", "MSFT")
stats <- getQuote(symbols2, what = metrics)

I am able to obtain some yahoo finance statistics on GOOG and MSFT. However when I add the symbol 3888.HK to the list I obtain an error.
symbols2 <- c("GOOG", "MSFT", "3888.HK")
stats <- getQuote(symbols2, what = metrics)

Error message:
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  :
  arguments imply differing number of rows: 2, 3
In addition: Warning message:
In getQuote.yahoo(Symbols = c("GOOG", "MSFT", "3888.HK"), what = list( :
  symbols have different timezones; converting to local time

Does anybody know of a work around for this, I cannot seem to find what to change in the getQuote() function.

A: The issue is not with the dot in the ticker name. You actually found a bug in the function.
If you run getQuote("3888.HK", what = metrics) you get a result:
                 Trade Time     Name  Volume P/E Ratio Dividend Yield Shares Outstanding
3888.HK 2018-09-20 16:08:17 KINGSOFT 5549058  4.991025    0.000952381         1365229952

The issue is the different timezone. And if the tickers per timezone are unequal you will get an error.
This works:
symbols2 <- c("GOOG", "MSFT", "0005.HK", "3888.HK")
symbols2 <- c("GOOG", "MSFT", "0005.HK", "3888.HK", "FAGR.BR", "AGFB.BR")

this doesn't
symbols2 <- c("GOOG", "MSFT", "FB", "0005.HK", "3888.HK")
symbols2 <- c("GOOG", "MSFT", "0005.HK", "3888.HK", "FAGR.AB")

The problem is in this part of the function:
 Qposix <- sapply(split(sq, sq$exchangeTimezoneName), convertTZ)

This returns a list instead of a vector of timezones. And if the number of stocks in per stock exchange are not equal you will get this error. Adjusting this is simple, but needs a change in the quantmod package. I have opened an issue on github.
The workaround for now is to run your code per exchange instead of a big list of tickers in one go.
edit: added github issue.

A: I may be wrong, but I think the error occurred as you have 2 counters from the NASDAQ but only one counter from the HK Exchange (e.g. "arguments imply differing number of rows" error).
When I tried to get the financials of two counters from NASDAQ and two counters from HK Exchange, the problem gets resolved:
metrics <- yahooQF(c("Name", "Volume", "P/E Ratio", "Dividend Yield", "Shares Outstanding"))
symbols2 <- c("GOOG", "MSFT", "0005.HK", "3888.HK")
stats <- getQuote(symbols2, what = metrics)

Warning message:
In getQuote.yahoo(Symbols = c("GOOG", "MSFT", "0005.HK", "3888.HK" :
  symbols have different timezones; converting to local time

stats
             Trade Time                  Name   Volume P/E Ratio Dividend Yield Shares Outstanding
GOOG    2018-09-20 04:00:01         Alphabet Inc.  1077192 50.576115             NA          349883008
MSFT    2018-09-20 04:00:01 Microsoft Corporation 18559784 52.441310    0.014839678         7668219904
0005.HK 2018-09-20 16:08:17         HSBC HOLDINGS 15168181 18.303152    0.007505519        19422699520
3888.HK 2018-09-20 16:08:17              KINGSOFT  5549058  4.991025    0.000952381         1365229952

Another alternative is you could obtain the financial information by exchange; you do not have to get all counters from all exchanges you are interested in concurrently. Meaning, you could do something like the following:
US_symbols <- c("GOOG", "MSFT")
HK_symbols <- c("0005.HK", "3888.HK")

US_stats <- getQuote(US_symbols, what = metrics)
HK_stats <- getQuote(HK_symbols, what = metrics)

US_stats
          Trade Time                  Name  Volume P/E Ratio Dividend Yield Shares Outstanding
GOOG 2018-09-20 09:39:47         Alphabet Inc.   91776  50.93889             NA          349883008
MSFT 2018-09-20 09:40:07 Microsoft Corporation 1956869  52.62911     0.01504029         7668219904

HK_stats
             Trade Time          Name   Volume P/E Ratio Dividend Yield Shares Outstanding
0005.HK 2018-09-20 16:08:17 HSBC HOLDINGS 15168181 18.303152    0.007505519        19422699520
3888.HK 2018-09-20 16:08:17      KINGSOFT  5549058  4.991025    0.000952381         1365229952


text:
Q: Give me a hand in building a function in Facebook Javascript SDK I am trying to build a Facebook application in which I need to extract the id's of my friends who don't like a certain page.
Up to now I've extracted all my friend id's using the function below.
I need to generate a code which builds another API that uses the id of my friends to get their likes..
function loadFriends()
{
    //get array of friends
    FB.api('/me/friends', function(response) {
        console.log(response);
 var testdiv = document.getElementById("test");
        for(i=0;i<response.data.length;i++)
            {
                 testdiv.innerHTML +=  response.data[i].id + '<br/>' ;
            }
    });
}

I'll need to get something like :
 FB.api('/response.data[i].id/likes', function(response) {

How can I do it?

A: You can do like this
FB.api({
            method: 'fql.query',
            query: 'SELECT first_name, last_name, pic_big FROM USER WHERE uid IN ( SELECT uid FROM page_fan WHERE page_id=' + page_id + ' AND uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) )'
        }, function(response){

//you get the friends who liked this page. now you can remove these ids from friends lists to get you result.
});


text:
Q: How to display custom type post article on main post (single.php) I want to display my faq post (custom type post) on main post (single.php). I am using category to match the posts. If any category from faq post (custom type post) matches category of main post (single.php) then display FAQ post content below main post. Category need not match all but atleast one.
<?php while (have_posts()):
    the_post(); ?>

<?php the_title(); ?>

<?php the_content(); ?>

  <?php get_template_part("widgets/cta"); ?>
        <?php
        $cat = the_category();
        echo $cat[0]->cat_name;
        ?>

        <?php
        $args_faq = ["post_type" => "faq", "posts_per_page" => 2];
        $faq_loop = new WP_Query($args_faq);
        while ($faq_loop->have_posts()):
            $faq_loop->the_post();

            $category_faq = the_category();
            $cat_slug_faq = $category_faq[0]->cat_name;
            echo $cat_slug_faq[0]->cat_name;

            if ($cat_slug_faq == $cat_slug) {
                echo "
" . get_the_title() . "
";

                echo the_content();
            }
        endwhile;
        ?>

      <?php
endwhile; ?>

FAQ CUSTOM POST TYPE
add_action( 'init', 'create_faqs' );

function create_faqs() {
    register_post_type( 'faqs',
        array(
            'labels' => array(
                'name' => 'FAQs',
                'singular_name' => 'FAQ',
                'add_new' => 'Add New',
                'add_new_item' => 'Add New Faq',
                'edit' => 'Edit',
                'edit_item' => 'Edit Faq',
                'new_item' => 'New Faq',
                'view' => 'View',
                'view_item' => 'View Faq',
                'search_items' => 'Search FAQs',
                'not_found' => 'No FAQs found',
                'not_found_in_trash' => 'No faqs found in Trash',
                'parent' => 'Parent Faq'
            ),

            'public' => true,
            'menu_position' => 15,
            // 'menu_icon' => 'dashicons-editor-help',
            'supports' => array( 'title', 'editor', 'comments', 'thumbnail', 'custom-fields' ),
            'taxonomies' => array( '' ),
            'menu_icon' => 'dashicons-editor-help',
            'has_archive' => true
        )
    );
}
function reg_cat() {
         register_taxonomy_for_object_type('category','faqs');
    }
add_action('init', 'reg_cat');

A: There are a lot of mistakes in your code.

*

*the_category() doesn't return anything, it echoes the terms links.

*the_content() also echoes so you should not add echo before this function.

*the_content() shouldn't be wrapped in

 tag.

*You're not using wp_reset_postdata() in your custom query.

*Your logic is not good for your requirements.

*Necessary validations are missing in your code.

There is a simplified code for requirements.
Note: I have not tested the code, so there could be typos and mistakes which can create errors so make sure you have FTP access to modify the files to fix the error, If you're using the WordPress file editor then test the code in localhost or somewhere else then upload in live websites
<?php
while ( have_posts() ) :
    the_post();
    ?>

<?php the_title(); ?>

<?php the_content(); ?>

    <?php get_template_part( 'widgets/cta' ); ?>

    <?php vh_display_post_faqs( get_the_ID() ); ?>
<?php endwhile; ?>

The above code is your single.php template file, I have added vh_display_post_faqs() which takes the post id and outputs the faqs content after doing the validations.
The below code will go to functions.php.
<?php
/**
 * Display faq lists from matching post categories.
 *
 * @param int $post_id Post ID.
 */
function vh_display_post_faqs( $post_id = 0 ) {
    // Return if post id is empty.
    if ( empty( $post_id ) ) {
        return;
    }

    // Get the categories' ids using the passed post id.
    $categories_ids = wp_get_post_terms( $post_id, 'category', array( 'fields' => 'ids' ) );

    // Validate for empty ids or wp errors.
    if ( empty( $categories_ids ) || is_wp_error( $categories_ids ) ) {
        return;
    }

    // Prepare query args, using tax query.
    $query_args = array(
        'post_type'      => 'faqs',
        'posts_per_page' => 2,
        'tax_query'      => array( // phpcs:ignore WordPress.DB.SlowDBQuery
            'taxonomy' => 'category',
            'field'    => 'term_id',
            'terms'    => $categories_ids,
        ),
    );

    // Run query and fetch faq posts.
    $faqs = new WP_Query( $query_args );

    // Check if we have posts from the query.
    if ( $faqs->have_posts() ) :

        // Loop through the query posts.
        while ( $faqs->have_posts() ) :
            $faqs->the_post();

            // Print the content.
            ?>

<?php the_title(); ?>

<?php the_content(); ?>

            <?php

        endwhile;

        // Reset the post data.
        wp_reset_postdata();

    endif;
}


text:
Q: Trying to get ID from multidimensional array PHP I have an array, which has been created from getting the pages from user levels. When I use print_r to print out the array you can see that there are arrays nested within arrays.
I am trying to access the 'ID' and 'name' values, which exists in each nested array. I have tried using a foreach and for loop, but have had no luck. Any help would be greatly appreciated.

   Array ( [0] => Array ( [0] => Array ( [ID] => 2487 [name] => Student Analytics [_more_] => /levels/1531756603/pages/2487 )
[1] => Array ( [ID] => 1048 [name] => Member Profile [_more_] => /levels/1531756603/pages/1048 )
[2] => Array ( [ID] => 864 [name] => i.4 Course Practicum – Your Live Campaign [_more_] => /levels/1531756603/pages/864 )
[3] => Array ( [ID] => 817 [name] => i.5 Course Expectations – Contact Us If Needed [_more_] => /levels/1531756603/pages/817 )
[4] => Array ( [ID] => 815 [name] => i.3 Course Assessments – Why There Are Level Assessments [_more_] => /levels/1531756603/pages/815 )
[5] => Array ( [ID] => 813 [name] => i.2 Course Structure – How to Navigate the Web Platform [_more_] => /levels/1531756603/pages/813 )
[6] => Array ( [ID] => 807 [name] => Introduction to the Course [_more_] => /levels/1531756603/pages/807 )
[7] => Array ( [ID] => 659 [name] => INTRO LEVEL ASSESSMENT [_more_] => /levels/1531756603/pages/659 )
[8] => Array ( [ID] => 378 [name] => How This Course Will be Taught [_more_] => /levels/1531756603/pages/378 )
[9] => Array ( [ID] => 376 [name] => SCourse [_more_] => /levels/1531756603/pages/376 )
[10] => Array ( [ID] => 372 [name] => Dashboard [_more_] => /levels/1531756603/pages/372 ) )
[1] => Array ( [0] => Array ( [ID] => 2372 [name] => Profile Assignment [_more_] => /levels/1531866216/pages/2372 )
[1] => Array ( [ID] => 2110 [name] => Instructions [_more_] => /levels/1531866216/pages/2110 )
[2] => Array ( [ID] => 1619 [name] => Practicum [_more_] => /levels/1531866216/pages/1619 )
[3] => Array ( [ID] => 1048 [name] => Member Profile [_more_] => /levels/1531866216/pages/1048 )
[4] => Array ( [ID] => 571 [name] => LEVEL 1 [_more_] => /levels/1531866216/pages/571 )
[5] => Array ( [ID] => 506 [name] => 2.A ASSIGNMENTS [_more_] => /levels/1531866216/pages/506 )
[6] => Array ( [ID] => 504 [name] => 2.7 SUMMARY AND REVIEW [_more_] => /levels/1531866216/pages/504 )
[7] => Array ( [ID] => 502 [name] => 2.6 Your Brand is the Balancing Force [_more_] => /levels/1531866216/pages/502 )
[8] => Array ( [ID] => 497 [name] => 2.5 Brand Trust [_more_] => /levels/1531866216/pages/497 )
[9] => Array ( [ID] => 494 [name] => 2.4 Brand Beliefs [_more_] => /levels/1531866216/pages/494 )
[10] => Array ( [ID] => 491 [name] => 2.3 Brand Promise [_more_] => /levels/1531866216/pages/491 )
[11] => Array ( [ID] => 487 [name] => 2.2 Brand Story [_more_] => /levels/1531866216/pages/487 )
[12] => Array ( [ID] => 484 [name] => 2.1 Branding [_more_] => /levels/1531866216/pages/484 )
[13] => Array ( [ID] => 478 [name] => CHAPTER 2 CREATING THE BRAND HUB: FOUR KEY BRAND ELEMENTS [_more_] => /levels/1531866216/pages/478 )
[14] => Array ( [ID] => 473 [name] => LEVEL 1 ASSESSMENT [_more_] => /levels/1531866216/pages/473 )
[15] => Array ( [ID] => 464 [name] => 2.A-1 Brand Strategy Assignment [_more_] => /levels/1531866216/pages/464 )
[16] => Array ( [ID] => 461 [name] => 2.A-4 Student Instructions [_more_] => /levels/1531866216/pages/461 )
[17] => Array ( [ID] => 459 [name] => 2.A-3 Project Submission Form [_more_] => /levels/1531866216/pages/459 )
[18] => Array ( [ID] => 448 [name] => 1.A PRACTICUM ASSIGNMENTS [_more_] => /levels/1531866216/pages/448 )
[19] => Array ( [ID] => 445 [name] => 1.A-2 Topical Brainstorm Assignment [_more_] => /levels/1531866216/pages/445 )
[20] => Array ( [ID] => 432 [name] => 1.5 SUMMARY AND REVIEW [_more_] => /levels/1531866216/pages/432 )
[21] => Array ( [ID] => 427 [name] => 1.4 A New Inbound Model [_more_] => /levels/1531866216/pages/427 )
[22] => Array ( [ID] => 423 [name] => 1.3 The New Social Era of Marketing [_more_] => /levels/1531866216/pages/423 )
[23] => Array ( [ID] => 410 [name] => 1.2 Traditional Outbound Marketing vs. Digital Inbound Marketing [_more_] => /levels/1531866216/pages/410 )
[24] => Array ( [ID] => 394 [name] => 1.1 Consumer Acquisition from the Digital Landscape [_more_] => /levels/1531866216/pages/394 )
[25] => Array ( [ID] => 392 [name] => CHAPTER 1 INTRODUCING [_more_] => /levels/1531866216/pages/392 )
[26] => Array ( [ID] => 318 [name] => Project Submission Thank You [_more_] => /levels/1531866216/pages/318 ) ) )

A: Loop through the array like so.
foreach($pages_array_name['0'] as $index => $sub_array) {
   echo "index is " . $index . "\n
";
   echo "name is " . $sub_array['name'] . "\n
";
   echo "_more_ is " . $sub_array['_more_'] . "\n
";
   echo "\n
"; // extra space
}


text:
Q: SQL Server : select the minimum value from table I know it's simple question, but I still can't figure it out.
I want to find the date which is the closest date from now.
Here is my product table:
P_INDATE
----------
2013-11-03
2013-12-13
2013-11-13

Basically, it should show 2013-12-13.
I type this SELECT Max( P_INDATE)   FROM product and it work.
Then, I try to use  MIN((GETDATE()- P_INDATE)) in the where condition, but I fail.

A: Use MAX and WHERE clause along with function GETDATE():
SELECT MAX(P_INDATE)
FROM product
WHERE P_INDATE < GETDATE()

The above query gives you maximum date, which is less than current date, which you get using function GETDATE()

A: One way to go about this is to order the query by the difference between the stored date and the current date and take the first rows only. Using abs will allow you to find the closest date regardless of whether its before or after the current date.
SELECT   TOP 1 p_indate
FROM     mytable
ORDER BY ABS(GETDATE() - p_indate) ASC

A: Assuming you have a column which stores data and you want to show only recent one every time,why cant you use
select max(date) from yourtable which will always give you recent date

A: If you have an index on the column, the most efficient method is probably a bit more complicated:
SELECT TOP 1 P_INDATE
FROM ((SELECT TOP 1 P_INDATE
       FROM product
       WHERE P_INDATE < GETDATE()
       ORDER BY P_INDATE DESC
      ) UNION ALL
      (SELECT TOP 1 P_INDATE
       FROM product
       WHERE P.INDATE >= GETDATE()
       ORDER BY P.INDATE
      )
     )
ORDER BY ABS(DATEDIFF(second, P_INDATE, GETDATE()))

The subqueries will use the index to get (at most) one row earlier and later than the current date.  The outer ORDER BY then just needs to sort two rows.

A: Well you can try this:
SELECT TOP(1) P_INDATE
FROM [product table]
ORDER BY CASE
            WHEN DATEDIFF(day,P_INDATE,GETDATE()) < 0
            THEN DATEDIFF(day,GETDATE(),P_INDATE)
            ELSE DATEDIFF(day,P_INDATE,GETDATE())
        END ASC


text:
Q: How to run batch file in remote server(windows 10) from Django Web server I am new to Django learning and have fairly understood basic polls app from Django tutorial, Now I ahve below requirement:
I have a basic (server1) Django development web server and another server (server2) which has a python script or a batch file that launches a python application . Assume that the server1 has necessary authentication in place to run the script on server2. All I want to do is, click a button on the django website which would run the python script sitting on server2.
I am really clueless here on how to achieve it, Will Django REST APIs work in this case ? I am not aware of what Django REST APIs do but willing to learn if it solves the purpose. Any help highly appreciated.

A: use concept of call_command link


text:
Q: Can apps be developed, installed, and debugged onto an actual iPad Pro using ONLY Visual Studio & Xamarin on Windows 10 computer WITHOUT using a Mac? Can a C# app prototype be developed on my iPad Pro by using ONLY Visual Studio with Xamarin, on my Windows 10 Pro computer without buying (ie. using) a Mac?
Initially, for rapid development of non-distribution prototype, I want to use only VS 2017 Pro & Xamarin on Windows 10 to develop and test an app on my iPad Pro 12.9".
App will talk to other system components by WiFi, and utilize new iPad Pro features like pen and its high quality screen, for augmented reality.
Can get Mac later, in order to deploy on Apple store.
Can I truly develop, deploy onto actual iPad, and debug 100% with only VS & Xamarin, and without Mac and Xcode?
This Microsoft article about its Xamarin Live Player is confusing to me because it reads "the source code is interpreted" which I don't want, and later it reads "The app runs right on your phone or tablet." is I want.

A: Yes, a mac is required to build and debug iOS apps.
However, VSTS does allow you access to a mac build host which can build and deploy to TestFlight and the AppStore, if required (and if configured correctly). This won't allow you to debug and step through your code on a device or in the iOS Simulator, however. For that you need the Mac with High Sierra and the latest XCode installed.
Xamarin Live Player is in preview only and is only really useful for simple apps at the moment.

A: So, the answer is the company needs to buy me a new Mac.  Yum.
The bad news is that it's back to using Xcode again.  Two years ago, the star rating of Xcode on Apple Store was a mere 2-stars.   It would be nice if the tool to develop on iOS was as easy to use as iOS.  But, that's what Stackoverflow is for, I guess.   :)

A: Whilst the existing answers/comments are correct I thought I'd add my own experience with this
If, like me, you won't use the mac for anything other than a build server for xamarin, I can say that a mac mini is fine for this, and will allow you to build apps. Just make sure you connect visual studio on your PC to the mac.
It's also worth noting, that more recently Visual studio team services has started using a hosted macOS build host. I haven't used this myself as I bought a mac mini, but in theory, if you use VSTS you might be able to build and deploy your iOS apps. I would suggest that you check it out.
https://learn.microsoft.com/en-gb/vsts/pipelines/apps/mobile/xamarin?view=vsts&tabs=vsts
https://blogs.msdn.microsoft.com/devops/2017/11/16/cloud-hosted-mac-agents-for-ci-cd-pipelines/
Sadly this has always been the case with xamarin and it's the way apple licensing works.


text:
Q: Element Alignment with LinkedIn Hopscotch I've just started using LinkedIn's Hopscotch to create a page tour for new users. It seems pretty simple to use, except all the elements seem to be out of alignment as shown in the image below. Any idea how to fix this issue?

This is my js code:
var tour = {
    id: "hopscotch",
    showPrevButton: true,
    steps: [{
        title: "About Me",
        content: "This is the header of my page.",
        target: 'about_edit',
        placement: "bottom",
        xOffset: '-20'
        },
        {
        title: "About Me",
        content: "This is the header of my page.",
        target: 'work_edit',
        placement: "bottom"

    }]
};

// Start the tour!
hopscotch.startTour(tour);

A: Just ran into this today and found a workaround. I assume you're using Bootstrap.
If so, there are some styling conflicts. My fix is to override the Bootstrap box-sizing of border-box that is used on all elements:
.hopscotch-bubble-container *{
    box-sizing: content-box;
}

A: This has been fixed as part of Hopscotch 0.2.2, making it compatible with Bootstrap.
https://github.com/linkedin/hopscotch/issues/75


text:
Q: How to properly delete the directive scope from controller in AngularJS 1.2 I'm trying to remove an instance of a directive from the page with a controller call and getting some kind of digest issue that I can't seem to be able to figure out. Looks like the scope isn't getting cleaned up properly and evens are still fired after the element is removed. Help is appreciated.
Here's my trimmed down HTML:

This is my directive

  [ delete ]

And my JS:
var demo = angular.module('demo', []);

demo.directive('myDirective', function() {
  return {
    link: function($scope, $element) {
      console.log('init directive');
    }
  }
});

demo.controller("MyCtrl", ['$scope', '$compile', function($scope, $compile) {
 $scope.items = {
    'red': {
      style: {
        color: 'red'
      }
    },
    'green': {
      style: {
        color: 'green'
      }
    }
  };

  $scope.style = function(color) {
    return $scope.items[color].style;
  }

  $scope.delete = function() {
    console.log('deleting...');
    $('.directive-text').remove();
    delete $scope.items['green'];
  };
}]);

Here's a plunker: http://plnkr.co/edit/Rfp93aTucdivy0zguJaF

A: Searching on SO for "angular remove directive from DOM" got me this:
Angularjs remove custom directive and child directives from DOM
The short version: You should destroy the scope of the directive before you remove it from the DOM.
$scope.delete = function() {
  console.log('deleting...');
  // Destroy the directive's scope
  angular.element(document.querySelector(".directive-text")).scope().$destroy();
  // I changed the following line to avoid using jQuery
  angular.element(document.querySelector(".directive-text")).remove();
  delete $scope.items['green'];
};


text:
Q: Making pip working under python 3.4 I used easy install with Python 2.7 and now try to update to Python 3.4 but the pip is not very clear.
My OS is Windows 7 - 64Bits and I do not have administrator rights. For the moment I enter in a terminal:
C:\Users\bc50414\Documents>pip install Pyside
Fatal error in launcher: Unable to create process using '""C:\Program Files (x86)\Python34\python.exe"" "C:\PF86\Python34\Scripts\pip.exe" install Pyside'

Where pip is just an alias for doskey pip=C:\PF86\Python34\Scripts\pip.exe $*. Apparently there is a problem with spaces, so using this solution (python3=C:\PF86\Python34\python.exe $*):
C:\Users\bc50414\Documents>python3 -m pip install Pyside
Downloading/unpacking Pyside
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement Pyside
Cleaning up...
No distributions at all found for Pyside
Storing debug log for failure in C:\Users\bc50414\pip\pip.log

Still fails ... the log is:
C:\PF86\Python34\lib\site-packages\pip\__main__.py run on 02/02/15 09:14:35
Downloading/unpacking Pyside
  Getting page https://pypi.python.org/simple/Pyside/
  Could not fetch URL https://pypi.python.org/simple/Pyside/: timed out
Will skip URL https://pypi.python.org/simple/Pyside/ when looking for download links for Pyside
  Getting page https://pypi.python.org/simple/

I guess it is a problem of Firewall/proxy since I am in a firm using this...so I tried this:
C:\Users\bc50414\Documents>python3 -m pip install --proxy="XXXXXmyproxyXXXXX" Pyside
Downloading/unpacking Pyside
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement Pyside
Cleaning up...
No distributions at all found for Pyside
Storing debug log for failure in C:\Users\bc50414\pip\pip.log

I really do not know hopw to solve this problem and afraid I am stuck with a lot of code in Python and pacakge I can't reach ...

A: PIP should already be included with Python 3.x
Open a command prompt in windows.
and type pip
you can open a command prompt by pressing windows button then type cmd in search for programs.
It should also be installed in accessories folder from your windows start button.


text:
Q: Remove  tags around text with Vim Basically, I would like to turn stuff like this:
Lorem ipsum

into this:
Lorem ipsum

In a whole document.
What's the fastest way of doing this with Vim?

A: if you want to remove all  tags, and leave the content, you could:
:%s/]*>\([^<]*\)<.*/\1/

if you just want to do the substitution on those <span.. with certain style="..", you can just copy the  put it before \([^<]*\).....
if your file is xml format, and your vim was armed with xml plugin, you could do it with macro(or :g), with xml plugin, <localleader>d deletes the surrounding tags and leave the text value.

A: Something along the lines of
:%s/\([^<]*\)<\/span>/\1/g

should do the trick. I'm not quite sure if you'd need to escape the capturing parentheses or not, though.
(Thanks Birei for the escaping)

A: you could use vim surround plugin by Tim Pope.
it's very suitable for your needs.

Surround.vim is all about "surroundings": parentheses, brackets,
  quotes, XML tags, and more. The plugin provides mappings to easily
  delete, change and add such surroundings in pairs.

http://github.com/tpope/vim-surround

A: To achieve the same from the normal mode you might:
place the cursor somewhere between first and last bracket of the paired tags and copy what's inside the tag into register let's say p:
"pyit

then delete the whole pair tag:
dat

and then paste what's in the p register:
"pp

The advantage of this approach is that it would work for all pair tags. When recorded as macro you may get rid of many different tags by just finding the tag and running the macro.

A: :%s/Lorem ipsum<\/span>/Lorem ipsum/g

Thanks


text:
Q: Convert import path to file path ('conf.settings' -> conf/settings.py) I would like to convert the import path to file path.
I can check the OS and replace '.' with either '\' or '/' and suffix with '.py` sure - but I'm interested in a built in way.
importlib.util.find_spec('conf.settings').origin does not suit my needs because that imports the module and returns the entry from sys.modules, and I'm writing a static analysis tool that does not import the code, just parses it.

A: >>>from astroid.modutils import file_from_modpath
>>>file_from_modpath(['conf', 'settings'])
/tmp/project/conf/settings.py


text:
Q: Using proxy_set_header with proxy_redirect? We have a nuxt app, and we need to have:
https://outer.domain.com/windows/thank-you
to be proxied to:
https://inner.domain.com/thank-you

I tried this:
server {
    server_name     outer.domain.com;
    listen 80;

 location /windows {
  location /windows/ {
        proxy_set_header Host inner.domain.com;
        proxy_pass http://127.0.0.1:4300/;
    }

    location /windows/thank-you/ {
        proxy_set_header Host inner.domain.com;
        proxy_redirect http://$host/windows/thank-you/ /;
        proxy_pass    http://127.0.0.1:4300;
    }
  }

}#server block

But proxy_redirect seems not working, is there anything I am missing?


text:
Q: Let $A \subset \Bbb R^n$ such that for every $\varepsilon > 0$ there exists open set $G_\varepsilon \subset \Bbb R^n$. Show that $A$ is measurable.
Let $A \subset \Bbb R^n$ such that for every $\varepsilon > 0$ there exists open set $G_\varepsilon \subset \Bbb R^n$ for which $A \subset G_\varepsilon$ and $m^*(G_\varepsilon \setminus A) < \varepsilon$. Show that $A$ is measurable.

$A$ is Lebesgue measurable if it satisfies the Caratheodory's criterion that is for arbitary $E \subset \Bbb R^n$ the equality $$m^*(E)=m^*(E \cap A) + m^*(E \setminus A)$$ holds.
Now for $G_\varepsilon$ I have that $$m^*(G_\varepsilon)=m^*(G_\varepsilon \cap A)+ m^*(G_\varepsilon \setminus A) \le m^*(G_\varepsilon \cap A) + \varepsilon$$
but since $A \subset G_\varepsilon$, then $G_\varepsilon \cap A= A$ and so $$m^*(G_\varepsilon) \le m^*(A) + \varepsilon$$
but how does this imply that $A$ would be measurable?

A: For each $k\in\mathbb{N}$, choose an open set $U_{k}$ such that
$A\subseteq U_{k}$ and $m^{\ast}(U_{k}\setminus A)<\frac{1}{k}$.
Let $G=\cap_{k}U_{k}$, which is a Borel set. Clearly $A\subseteq G$.
By monotonicity of outer-measure, $m^{\ast}(G\setminus A)\leq m^{\ast}(U_{k}\setminus A)<\frac{1}{k}$
for each $k$. Since $k$ is arbitrary, we have that $m^{\ast}(G\setminus A)=0$. Recall that sets having zero outer-measure are Lebesgue measurable.
Therefore $G\setminus A$ is Lebesgue measurable. Finally, $A=G\backslash(G\setminus A)$, which is Lebesgue
measurable.


text:
Q: Trying to pass a table-valued parameter with 20 column(s) where the corresponding user-defined table type requires 21 column(s) I get this error:

Additional information: Trying to pass a table-valued parameter with 20 column(s) where the corresponding user-defined table type requires 21 column(s).

Because I'm trying to read an Excel file with 20 columns and create a datatable, then pass the data from the datatable to SQL Server. But the table in SQL Server has 21 columns because the ID is an auto-increment column.
Any idea how to fix this?