text:
Q: Apache Kafka: kafka.common.OffsetsOutOfOrderException when reassigning __consumer_offsets to new brokers we have upgraded Kafka from 2.2 to 2.6, and added 4 new brokers to the existing 4 brokers. This went fine.
After that we started to reassign topic data to the new brokers. Most topics went ok, but on one of the 50 partitions of __consumer_offsets, the reassignment hangs. 49 of the partitions were successfully moved from the old brokers (id 3,4,5,6) to the new (ids 10,11,12,13).
But on __consumer_offsets-18 we consistently get this error (in the server.log of the new brokers)
[2020-10-24 15:04:54,528] ERROR [ReplicaFetcher replicaId=10, leaderId=3, fetcherId=0] Unexpected error occurred while processing data for partition __consumer_offsets-18 at offset 1545264631 (kafka.server.ReplicaFetcherThread)
kafka.common.OffsetsOutOfOrderException: Out of order offsets found in append to __consumer_offsets-18: ArrayBuffer(1545264631, 1545264632,
... thousands of other ids
1545272005, 1545272006, 1545272007)
    at kafka.log.Log.$anonfun$append$2(Log.scala:1126)
    at kafka.log.Log.append(Log.scala:2340)
    at kafka.log.Log.appendAsFollower(Log.scala:1036)
    at kafka.cluster.Partition.doAppendRecordsToFollowerOrFutureReplica(Partition.scala:939)
    at kafka.cluster.Partition.appendRecordsToFollowerOrFutureReplica(Partition.scala:946)
    at kafka.server.ReplicaFetcherThread.processPartitionData(ReplicaFetcherThread.scala:168)
    at kafka.server.AbstractFetcherThread.$anonfun$processFetchRequest$7(AbstractFetcherThread.scala:332)
    at kafka.server.AbstractFetcherThread.$anonfun$processFetchRequest$6(AbstractFetcherThread.scala:320)
    at kafka.server.AbstractFetcherThread.$anonfun$processFetchRequest$6$adapted(AbstractFetcherThread.scala:319)
    at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:553)
    at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:551)
    at scala.collection.AbstractIterable.foreach(Iterable.scala:920)
    at kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:319)
    at kafka.server.AbstractFetcherThread.$anonfun$maybeFetch$3(AbstractFetcherThread.scala:135)
    at kafka.server.AbstractFetcherThread.maybeFetch(AbstractFetcherThread.scala:134)
    at kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:117)
    at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:96)
[2020-10-24 15:04:54,534] INFO [ReplicaFetcher replicaId=10, leaderId=4, fetcherId=0] Truncating partition __consumer_offsets-31 to local high watermark 0 (kafka.server.ReplicaFetcherThread)
[2020-10-24 15:04:54,547] WARN [ReplicaFetcher replicaId=10, leaderId=3, fetcherId=0] Partition __consumer_offsets-18 marked as failed (kafka.server.ReplicaFetcherThread)

Any idea what is wrong here? The whole cluster seems to process data nicely. It's just that we can't move over this particular partition. We tried various things (cancelling the reassignment, restarting it with all partitions, restarting it with just partition 18, restarting all brokers) to no avail
Help very much appreciated, this is happening in PROD only after it worked successfully on all test environments.
EDIT: we actually found that in the huge list of message offsets in the list of the exception, there is actually a descrepancy. The relevant part of this list is
... 1545271418, 1545271419, 1, 1, 1545271422, 1545271423,

Obviously the two '1' entries there look really wrong! They should be 1545271420/1545271421. Could it be that the leader really has some kind of data corruption?

A: We were ultimately able to solve this issue - mainly by sitting and waiting
The issue was indeed that somewhen, somehow, the data on the leader of this __consumer_offset-18 partition got corrupted. This probably happened during the upgrade from Kafka 2.2 -> 2.6. We were doing this in a rather dangerous way, as we know now: we simply stopped all brokers, updated the SW on all, and restarted them. We thought since we can afford this outage on the weekend, this would be a safe way. But we will certainly never do that again. At least not unless we know 100% that all producers and all consumers are really stopped.  This was NOT the case during that upgrade, we overlooked one consumer and left that running, and that consumer (group) was storing their offsets in the __consumer_offset-18 partition. So that action - taking all brokers down and upgrade them - while consumers/producers are still running, did probably cause the corruption
Lesson learnt: never do that again, always do rolling upgrades, even if they take a lot longer.
The issue was then actually solved through the nature of the compacting topic. The default settings for compaction are to run it every week (or when a segment gets bigger than 1GB, which will not happen in our case). Compaction of that __consumer_offset-18 partition kicked in yesterday evening. And by that the 2 corrupted offsets were purged away. After that it was uphill, the reassign of that partition to the new brokers then worked like a charm.
We could certainly have speeded up this recovery by setting the topic parameters in a way that compaction would kick in earlier. But it was only on Wednesday when we reached the understanding that the problem could actually be resolved that way. We decided to leave everything as it was and wait another day.


text:
Q: Visual Studio VB.NET Global ADODB.CONN I am building an application that requires me to query an AS400 database up to 100 times per single use.
I have functions for each of the queries right now written in the following structure.
Option Explicit On
Shared Function query1()
    Dim conn as New ADODB.Connection
    Dim recordSet1 as New ADODB.RecordSet
    conn.open("databaseName")
    recordSet1.Open("Select * From Table",conn)

    Return someValue
End Function

My application runs pretty slow, around 30-40 seconds. I've done some performance profiling using the tools built into Visual Studio 2013 and noticed that repeatedly opening connections to a database is taking up a significant portion of time.
My question is, can I set a global connection variable at the top level of my routine so that I only have to open the connection once, and close it once the routine is finished with all the queries? Do you think that this would significantly speed up my application?
Something like the following:
Option Explicit On
Global conn as ADODB.Connection
conn.open(DSN = "database")

Shared Function query1(ByVal conn)
    Dim recordSet1 as New ADODB.RecordSet
    recordSet1.Open("Select * From Table",conn)
    Return someValue
End Function

Thanks in advance for your help !

redpajama_set_name: RedPajamaStackExchange


text:
Q: integration of google ads in an expandable list view adapter (BaseExpandableView) how do I add google ads in an expandable list view adapter (BaseExpandableView) ?
what i have done  -> added the addview in the xml layout of parentView (issue - working but not expanding).
what i want as fully working approach -> independent addview as a parent which i can interchange with even no. of positions .
here is the code ->
class RecordExpandableListAdapterCllRcc(
val mContext: Context,
private val viewModelCllRcc: RecordHistoryViewModelCllRcc,
private val lifecycleOwnerCllRcc: LifecycleOwner): BaseExpandableListAdapter() {

var recordsListCllRccCllRcc: MutableList<RecordCllRcc> = mutableListOf()
    set(valueCllRcc) {
        field = valueCllRcc
        notifyDataSetChanged()
    }

override fun getGroupCount(): Int {
    return recordsListCllRccCllRcc.size
}

override fun getChildrenCount(groupPositionCllRcc: Int): Int = 1

override fun getGroup(groupPositionCllRcc: Int): RecordCllRcc {
    return recordsListCllRccCllRcc[groupPositionCllRcc]
}

override fun getChild(groupPositionCllRcc: Int, childPositionCllRcc: Int): RecordCllRcc =
    recordsListCllRccCllRcc[groupPositionCllRcc]

override fun getGroupId(groupPositionCllRcc: Int): Long = groupPositionCllRcc.toLong()

override fun getChildId(groupPositionCllRcc: Int, childPositionCllRcc: Int): Long {

    return childPositionCllRcc.toLong()
}
override fun hasStableIds(): Boolean {
    return true
}

override fun getGroupView(
    groupPositionCllRcc: Int,
    isExpandedCllRcc: Boolean,
    convertViewCllRcc: View?,
    parent: ViewGroup?
): View {

    val bindingCllRcc: ListItemRecordCllRccBinding = if (convertViewCllRcc == null) {

        DataBindingUtil.inflate(
            LayoutInflater.from(parent!!.context),
            R.layout.list_item_record_cll_rcc,
            parent,
            false
        )

    } else {

        DataBindingUtil.getBinding(convertViewCllRcc)!!
    }

    bindRecordCllRcc(bindingCllRcc, groupPositionCllRcc)

    return bindingCllRcc.root
}

private fun bindRecordCllRcc(
    bindingCllRcc: ListItemRecordCllRccBinding,
    groupPositionCllRcc: Int
) {

    bindingCllRcc.record = getGroup(groupPositionCllRcc)

    if (groupPositionCllRcc%4 ==3 ){
        bindingCllRcc.nativeAd.visibility = VISIBLE

        val adLoader = AdLoader.Builder(mContext, mContext.getString(R.string.native_ad_id))
            .forNativeAd { ad : NativeAd ->
                bindingCllRcc.templateID.setNativeAd(ad)
            }
            .withAdListener(object : AdListener() {
                override fun onAdFailedToLoad(adError: LoadAdError) {
                    Log.e("",adError.message)
                    // Handle the failure by logging, altering the UI, and so on.
                }

                override fun onAdLoaded() {
                    Log.e("","add loaded")
                    super.onAdLoaded()
                }
            })
            .withNativeAdOptions(NativeAdOptions.Builder()
                // Methods in the NativeAdOptions.Builder class can be
                // used here to specify individual options settings.
                .build())
            .build()
        adLoader.loadAd(AdRequest.Builder().build())

    }

    when (groupPositionCllRcc){
        0->bindingCllRcc.isFirstOrLastItem = true
        else -> bindingCllRcc.isFirstOrLastItem = false
    }

}

override fun onGroupCollapsed(groupPositionCllRcc: Int) {
    super.onGroupCollapsed(groupPositionCllRcc) //        pos = groupPosition
}

override fun getChildView(
    groupPositionCllRcc: Int,
    childPositionCllRcc: Int,
    isLastChildCllRcc: Boolean,
    convertViewCllRcc: View?,
    parent: ViewGroup
): View {
    val bindingCllRcc: ListItemExpandedRecordBinding = if (convertViewCllRcc == null) {
        DataBindingUtil.inflate(
            LayoutInflater.from(parent.context),
            R.layout.list_item_expanded_record,
            parent,
            false
        )
    } else {
        DataBindingUtil.getBinding(convertViewCllRcc)!!
    }
    Log.e("position"," $groupPositionCllRcc $childPositionCllRcc")
    bindExpandedViewCllRcc(bindingCllRcc, groupPositionCllRcc, childPositionCllRcc)

    return bindingCllRcc.root
}

private fun bindExpandedViewCllRcc(
    binding: ListItemExpandedRecordBinding,
    groupPositionCllRcc: Int,
    childPositionCllRcc: Int
) {
    try {

        val recordCllRcc = getChild(groupPositionCllRcc, childPositionCllRcc)
        val fileCllRcc = Environment.getExternalStorageDirectory()
            .toString() + "/Call/" + recordCllRcc.nameCllRcc

        binding.viewModel = viewModelCllRcc
        if (viewModelCllRcc.currentRecordCllRcc.value?.nameCllRcc != recordCllRcc.nameCllRcc) {
            binding.record = recordCllRcc
            viewModelCllRcc.currentRecordCllRcc.value = recordCllRcc
        }

        binding.wave.setRawDataCllRcc(File(fileCllRcc).readBytes()) { }
        binding.wave.onProgressListenerCllRcc = object : CustomProgressListenerCllRcc() {
            override fun onProgressChanged(progress: Float, byUser: Boolean) {
                if (byUser) {
                    viewModelCllRcc.seekToCllRcc(progress, recordCllRcc)
                }
            }
        }
        viewModelCllRcc.currentPositionCllRcc.observe(lifecycleOwnerCllRcc) {
            binding.redLineSeekBar.translationX = (binding.wave.width * it.toFloat()) / 101.5f
        }
        viewModelCllRcc.isPlayingCllRcc.observe(lifecycleOwnerCllRcc) {
            binding.isPlaying = it
        }
    } catch (eCllRcc: Exception) {
        eCllRcc.printStackTrace()
    }
}
override fun isChildSelectable(p0CllRcc: Int, p1CllRcc: Int):
Boolean = false
 }


text:
Q: Uncaught Typo error Cannot read property each of null I am trying to find a checkbox from the page which contains id that starts with the specific text sku_cat. I use this below function. But it is not working. I am getting an error 'Uncaught Typo error Cannot read property each of null.
HTML Code:
<input type="checkbox" name="sku[]" id="sku_cat123_blue" value="sku123">
<input type="checkbox" name="sku[]" id="sku_cat123_red" value="sku124">
<input type="checkbox" name="sku[]" id="sku_cat110_blue" value="sku125">
<input type="checkbox" name="sku[]" id="sku_cat115_blue" value="sku126">

Jquery script:
var category=$("input[type='checkbox'][id^='sku_cat']:checked").each();

A:  var category = $("[id^=sku_cat]").each(function(index){
     console.log(index);
  });


text:
Q: multiple textures with single drawcall hello i want to create multiple cubes with different textures for each cube.
to have the best performances i've created a single mesh with merged geometries. but i have a problem with the textures because until now i must have a draw call per texture.
i want to know if exist a method to have a single merged texture like the geometry, in this way i can create a one big texturized mesh with only one draw call.
my actual code is this.
var geometry = new THREE.Geometry();
    var materials = [];

    for(var p: number = 0; p < 1000; p++){
        var height = Math.floor((Math.random() * 100) + 50);

        var box = new THREE.BoxGeometry(10, 5, 10);
        box.translate(
           Math.floor((Math.random() * 100) + 50),
           Math.floor((Math.random() * 100) + 50),
           Math.floor((Math.random() * 100) + 50));

        var texture = new THREE.MeshLambertMaterial({ map: new THREE.TextureLoader().load(textures[p])});
        texture.needsUpdate = true;

        geometry.merge(box);
        materials.push(texture);
     }

      var mesh = new THREE.Mesh(geometry, materials);
      el.setObject3D("mesh", mesh);

i think the way is to have a texture per geometry or to create different textures to merge in a single texture.
every advice is well accepted thanks in advance.
i use a-frame v.0.7.1 but in this case i think is more a threejs problem

A: You can merge all of your texture images into a single texture atlas. And then modify per geometry the UVs to point to the desired texture.
https://solutiondesign.com/blog/-/blogs/webgl-and-three-js-texture-mappi-1
Snippet from that guide:
var texture = new THREE.MeshLambertMaterial({ map: new THREE.TextureLoader().load('textureatlas.png')});

var bricks = [
  new THREE.Vector2(0, .666),
  new THREE.Vector2(.5, .666),
  new THREE.Vector2(.5, 1),
  new THREE.Vector2(0, 1)
];

geometry.faceVertexUvs[0] = [];
geometry.faceVertexUvs[0][0] = [ bricks[0], bricks[1], bricks[3] ];
geometry.faceVertexUvs[0][1] = [ bricks[1], bricks[2], bricks[3] ];

Since you are merging the geometries, just need to make sure the UVs transfer over (perhaps they do automatically).


text:
Q: Can you please tell me what's wrong with this string input code block,it keeps giving segmentation fault #include <stdio.h>
#include <stdlib.h>
#include <string.h>
main()
{
    char *str;
    int len;
    printf("Enter the expression: \n");
    scanf("%[^\n]", &str);
    printf("%s\n", str);
    len = strlen(str);
    printf("%d\n", len);
}

I am trying input a string into a string pointer but it keeps giving me a segmentation error, however when i initialize it as char array it works fine.

A: It looks like you are trying to get scanf to allocate the necessary memory for the string. That option is only available as an extension in some implementations, but here's how that would work:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {                        // note the proper declaration
    char *str = NULL;
    int len;
    printf("Enter the expression: \n");
    if(scanf("%m[^\n]", &str) == 1) {   // add `m` to malloc memory for the string
        printf("%s\n", str);
        len = strlen(str);
        printf("%d\n", len);
        free(str);                      // and `free` it after use
    }
}

A: This is because you are using the scanf function to write to an uninitialized pointer str. The & is also uneeded for passing a pointer for scanf. A better way to handle the input would be to use fgets() or getline() and allocating memory dynamically using malloc() to store the input string.


text:
Q: NullPointerException in appcompat-v22 for Eclair devices Has anyone tested their app against Android 2.1 after updating to appcompat-v22? My app works fine with appcompat-v21, and Android 2.2. I've got a navigation drawer activity with a Toolbar, and my fragment list as my activity content. I'm using build tools 22.0.1, targetSdkVersion 22 and appcompat-v7:22.0.0
My crash seems to indicate that a checkbox in my fragmentlist could be the culprit, here was the original stack:
 Caused by: java.lang.NullPointerException
        at android.graphics.drawable.StateListDrawable.mutate(StateListDrawable.java:241)
        at android.support.v7.internal.widget.TintManager.getDrawable(TintManager.java:140)
        at android.support.v7.internal.widget.TintTypedArray.getDrawable(TintTypedArray.java:62)
        at android.support.v7.internal.widget.TintCheckBox.<init>(TintCheckBox.java:49)
        at android.support.v7.internal.widget.TintCheckBox.<init>(TintCheckBox.java:41)
        at android.support.v7.app.ActionBarActivityDelegateBase.createView(ActionBarActivityDelegateBase.java:790)
        at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:548)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
        at com.myapp.myapp.adapter.MyAdapter.getView(MyAdapter.java:79)
        at android.widget.AbsListView.obtainView(AbsListView.java:2818)
        at android.widget.ListView.makeAndAddView(ListView.java:1751)
        at android.widget.ListView.fillSpecific(ListView.java:1283)
        at android.widget.ListView.layoutChildren(ListView.java:1582)
        at android.widget.AbsListView.onLayout(AbsListView.java:2478)
        at android.view.View.layout(View.java:6892)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
        at android.view.View.layout(View.java:6892)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
        at android.view.View.layout(View.java:6892)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
        at android.view.View.layout(View.java:6892)
        at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:907)
        at android.view.View.layout(View.java:6892)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
        at android.view.View.layout(View.java:6892)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
        at android.view.View.layout(View.java:6892)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
        at android.view.View.layout(View.java:6892)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
        at android.view.View.layout(View.java:6892)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
        at android.view.View.layout(View.java:6892)
        at android.view.ViewRoot.performTraversals(ViewRoot.java:1021)
        at android.view.ViewRoot.handleMessage(ViewRoot.java:1658)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:123)
        at android.app.ActivityThread.main(ActivityThread.java:4363)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:521)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
        at dalvik.system.NativeStart.main(Native Method)

Has anyone seen something similar when updating their app to v22? Is anyone even supporting Android 2.1 anymore?

A: This is fixed in support library 22.1.0 (see: https://code.google.com/p/android/issues/detail?id=161539)


text:
Q: Quick way of identifying superfluous library() in R script? Is there a quick and easy way (e.g. a function call) to identify superfluous calls to library() in a script?
Best approach so far (manual approach)
First manually inspect the script with an eye for duplicate or unnecessary calls to library(). In cases where I'm not sure, I restart the R session, do not load the package in question, and see if everything runs as it should. Depending on how long the script takes to run, this can be a little slow and laborious.
Is there a faster/more robust way of identifying superfluous calls to library()?
Example
Here is a very minimal example
# script1.R
library(dplyr)
2 + 2

In this script, dplyr is not necessary, so some function run on script1.R should return dplyr, to indicate that it doesn't need to be loaded.
# script2.R
library(rvest)
library(rvest)
read_html("www.google.com")

In script2.R the second library(rvest) is superfluous so rvest should be returned (even though it's used within the script)
These examples are trivial, but actual use cases are long EDAs/scripts of 2000+ lines of code

A: I have used packrat::clean() for this purpose (docs https://rstudio.github.io/packrat/); this combined with lintr should solve your problem


text:
Q: RHEL6.6 in which file you put the gateway configuration In RHEL6.6 OS system, which file we've to put the gateway configuration?
I tried GATEWAY=xxx.xxx.xxx.xxx in these files :
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0

and I tried the system-config-network tools as well.
No result, I 've to configure manually with route add command.
I've to configure 2 gateway on eth1 and eth0.


text:
Q: UIView drawing problem I have this big problem that i dont know how to fix. I have a UIView that i want to draw a scrolling background on. I am using NSTimer to update 30 frames per second but it seems to redraw one frame every 8 seconds. I am calling [self setNeedsDisplay] but it has no effect. I cant figure out why this is happening, does anyone have any tips?
Thanks for your time.
I have an NSTimer in my applicationDidFinishLaunching method

timer = [NSTimer scheduledTimerWithTimeInterval:0.0
        target:self
        selector:@selector(gameLoop:)
        userInfo:nil
        repeats:YES];

It's messaging this method:

-(void) gameLoop: (id) sender
{
    [myView updateAll];
    [myView setNeedsDisplay];
}

myView is a UIView. UpdateAll updates my code for drawing. It works fine, the problem seems to be the drawRect method is being executed so infrequently. I need to know how to make it execute 30 frames per second. I keep seeing people say that all you have to do is what i have above but setNeedsDisplay still only gets called every 8 seconds.
Thank you for your help...

A: Redrawing the view is an expensive operation, which will decrease performance considerably. If you can instead, just have the background as an image view move across the background using [UIView beginAnimation... or using CAAnimations.

A: Don't use NSTimer.
From the NS Timer reference

Because of the various input sources a typical run loop manages, the effective resolution of the time interval for a timer is limited to on the order of 50-100 milliseconds.

I'm not an expert on the iPhone, but you probably need to look into animation on the platform to achieve the update interval you want.

A: It turns out that my code was just incredibly inefficient and that was causing the slow down not the timer. If you have a similar problem, make sure to test your drawRect with some simple drawing (such as drawing your Frames Per Second to the screen) before you assume it is not being executed. Thanks for viewing.


text:
Q: ¿Por qué mi componente ignora el @RequestParam? Hola estoy dandole vueltas a lo siguiente:
@Component
@Path("/")
public class ClientRestService {

    @GET
    @Path("/getS")
    public String getClients(@RequestParam String s){
        return "hola"+s;
    }
}

Pero al hacer una peticion GET con localhost:8081/getS?s=gato solo me devuelve hola!
Un saludo de antemano

A: Creo que estás mezclando dos frameworks:
Usando Spring Web, lo normal sería tener algo así:
@RestController
@RequestMapping("/")
public class ClientRestService {

    @GetMapping("/getS")
    public String getClients(@RequestParam String s){
        return "hola"+s;
    }
}

Pero si usas JAX-RS, entonces sería algo así:
@Component
@Path("/")
public class ClientRestService {

    @GET
    @Path("/getS")
    public String getClients(@QueryParam("s") String s){
        return "hola"+s;
    }

}

Puesto que el request llega correctamente a responderse, asumo que tienes JAX-RS funcionando justo con Spring, pero estás usando @RequestParam donde deberías usar @QueryParam. Puesto que JAX-RS no reconoce esa anotación, no es capaz de colocar ahí el parámetro recibido.


text:
Q: css select :nth-of-child(1) not working so im trying to make the first wide box under recent promotions (at the bottom) have a a bigger height than the rest of the boxes, however nth-of-child is not working, I just need it for that first wide box. here is the code:
#listify_widget_recent_listings-2 .job_listing-entry-header:nth-child(1) {
height: 400px !important;
}

When you remove the :nth-of-child it makes all the boxes bigger as expected in that widget so I am not sure why its not working for the first. Help!

A: please try this
#listify_widget_recent_listings-2 .job_listings li:nth-child(1) .job_listing-entry-header.listing-cover.has-image {
    height: 400px !important;
}

comment please if i miss something


text: Q: Can't save images on internal memory android lollipop I'm having problem saving jpg and png images on internal memory on Android Lollipop. I'm using a simple application that download (directly or asynchronously) an image from URL an show it on imageview and than it's possible to save it in the internal memory previous create an album on image gallery. The problem is that download the image, after it show it inside imageview but it does not save in the internal memory. It show that it save a file with the right name inside the new album but the file has 0.00 bytes. The app work fine in kit kat. I'm trying with this sample because I'm running the same problem in another app that, as the sample do, works fine in kit kat and does not in lollipop.


text:
Q: How to show field on selecting a product version on liquid shopify I want to display/show a  field when user select a variant  of a product:
For example:
A product (sunglass) has 2 variant
i) normal lens
ii) Power lens
when a user selects option (ii) power lens then a file upload field should open (where user can upload his/her prescription).
I have done this with the help of a tutorial, but the file upload field is visible on both variant.
Now how to show/display it on selecting only second (ii) variant.
Thanks
Asif


text:
Q: Batch file to Replace underscore(_)from header of text file I got a Pipe(|) separated file new.txt. I want to create a batch file which replaces underscore characters from new.txt  keeping the data intact. I have created a batch which replaces underscore even from data. Please help.
new.txt contains header
Transaction_Type|Spend_Source_System|Event_ID|Expense_ID

Batch code I have written is
    @echo off &setlocal
set "search=_"
set "replace= "
set "textfile=D:\test.txt"
set "newfile=D:\test2.txt"
(for /f %%i in ('findstr  "^" "%textfile%"') do (
    set "line=%%i"
    setlocal enabledelayedexpansion
    set "line=!line:%search%=%replace%!"
    echo(!line!
    endlocal
))>"%newfile%"
type "%newfile%"

A: (for /f "DELIMS=" %%i in ('findstr  "^" "%textfile%"') do (

should fix your problem.

Ah - it would appear they you may wish to replace the underscores only in the header line.
set "search=_"
set "replace= "
set "textfile=D:\test.txt"
set "newfile=D:\test2.txt"
SET header=Y
(for /f "delims=" %%i in ('findstr  "^" "%textfile%"') do (
  IF DEFINED header (
    set "line=%%i"
    setlocal enabledelayedexpansion
    set "line=!line:%search%=%replace%!"
    echo(!line!
    ENDLOCAL
    SET "header="
  ) ELSE (ECHO(%%i)
))>"%newfile%"


text:
Q: How to convert PyObject to c++ array? I am working with python-c binding and I face with following problem. In python class there is a attribute called means which is numpy array of shape (2,3). If pInstance is PyObject* of that class, I wanted to do something like this:
PyObject* pMeans = PyObject_GetAttrString(pInstance,"means");
PyArrayObject* contig = (PyArrayObject*)PyArray_FromAny(pMeans,
PyArray_DescrFromType(NPY_DOUBLE),
    2, 3, NPY_ARRAY_CARRAY, NULL);

What I get is ValueError: object of too small depth for desired array. I also tried simple conversion:
PyArrayObject* contig = (PyArrayObject*)pMeans;

What is the proper eay to do this conversion?


text:
Q: How to get the coordinates of the dots in hand image? My image,

I've tried to get quite accurate palm from the hand image and used mediapipe(mp) library to do it. But the result is:

mp calculates and draws green strokes and red dots, but also give the coordinates of red dots. So I can get the coordinates of blue circles using given coordinates of red ones. But it can't be enough to get "accurate" palm. I need to get the black dots' coordinates.
following is my code:
import cv2
import mediapipe as mp
import utils

mp_drawing = mp.solutions.drawing_utils
mp_hands = mp.solutions.hands

def makeCircle(img,circle_y,circle_x,radius):
    image_height, image_width, _ = img.shape
    y = int(circle_y * image_height)
    x = int(circle_x * image_width)
    circle_coordinates = (x,y)
    color = (255, 0, 0)
    thickness = 2
    return cv2.circle(img,circle_coordinates,radius,color,thickness)

# For static images:
IMAGE_FILES = [
    "C:/Users/USER/workspace/palm/images/sample1.png",
    "C:/Users/USER/workspace/palm/images/sample2.png",
    "C:/Users/USER/workspace/palm/images/sample3.png",
    "C:/Users/USER/workspace/palm/images/sample4.png"
]

with mp_hands.Hands(
    static_image_mode=True,
    max_num_hands=2,
    min_detection_confidence=0.5) as hands:
  for idx, file in enumerate(IMAGE_FILES):
    # Read an image, flip it around y-axis for correct handedness output (see
    # above).
    image = cv2.flip(cv2.imread(file), 1)
    image = utils.remove_bground(image)

    # resize image's height 600 fixing the ratio
    image = utils.ResizeWithAspectRatio(image,height=600)

    # Convert the BGR image to RGB before processing.
    results = hands.process(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))

    print("results:",results)
    # Print handedness and draw hand landmarks on the image.
    print('Handedness:', results.multi_handedness)
    if not results.multi_hand_landmarks:
      continue
    image_height, image_width, _ = image.shape
    annotated_image = image.copy()
    for hand_landmarks in results.multi_hand_landmarks:
      print('hand_landmarks:', hand_landmarks)
      print(
          f'Index finger tip coordinates: (',
          f'{hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_TIP].x * image_width}, '
          f'{hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_TIP].y * image_height})'
      )

      circle_coordinates = [
        (
            (hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_MCP].y + hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_PIP].y)/2,
            (hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_MCP].x + hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_PIP].x)/2
        ),
        (
            (hand_landmarks.landmark[mp_hands.HandLandmark.MIDDLE_FINGER_MCP].y + hand_landmarks.landmark[mp_hands.HandLandmark.MIDDLE_FINGER_PIP].y)/2,
            (hand_landmarks.landmark[mp_hands.HandLandmark.MIDDLE_FINGER_MCP].x + hand_landmarks.landmark[mp_hands.HandLandmark.MIDDLE_FINGER_PIP].x)/2
        ),
        (
            (hand_landmarks.landmark[mp_hands.HandLandmark.RING_FINGER_MCP].y + hand_landmarks.landmark[mp_hands.HandLandmark.RING_FINGER_PIP].y)/2,
            (hand_landmarks.landmark[mp_hands.HandLandmark.RING_FINGER_MCP].x + hand_landmarks.landmark[mp_hands.HandLandmark.RING_FINGER_PIP].x)/2
        ),
        (
        (hand_landmarks.landmark[mp_hands.HandLandmark.PINKY_MCP].y + hand_landmarks.landmark[mp_hands.HandLandmark.PINKY_PIP].y)/2,
        (hand_landmarks.landmark[mp_hands.HandLandmark.PINKY_MCP].x + hand_landmarks.landmark[mp_hands.HandLandmark.PINKY_PIP].x)/2
        ),
        (
            hand_landmarks.landmark[mp_hands.HandLandmark.WRIST].y,
            hand_landmarks.landmark[mp_hands.HandLandmark.WRIST].x
        ),
        (
            hand_landmarks.landmark[mp_hands.HandLandmark.THUMB_CMC].y,
            hand_landmarks.landmark[mp_hands.HandLandmark.THUMB_CMC].x
        ),
        (
            hand_landmarks.landmark[mp_hands.HandLandmark.THUMB_MCP].y,
            hand_landmarks.landmark[mp_hands.HandLandmark.THUMB_MCP].x
        ),
      ]

      for (circle_y,circle_x) in circle_coordinates:
          annotated_image = makeCircle(annotated_image,circle_y,circle_x,10)

      palm_center_y = (hand_landmarks.landmark[mp_hands.HandLandmark.THUMB_CMC].y +
        hand_landmarks.landmark[mp_hands.HandLandmark.PINKY_MCP].y)/2
      palm_center_x = (hand_landmarks.landmark[mp_hands.HandLandmark.THUMB_CMC].x +
        hand_landmarks.landmark[mp_hands.HandLandmark.PINKY_MCP].x)/2
      #
      palm_range = 100

      # annotated_image = makeCircle(annotated_image, palm_center_y,palm_center_x,palm_range)

      mp_drawing.draw_landmarks(
          annotated_image, hand_landmarks, mp_hands.HAND_CONNECTIONS)
      hand_landmark_x = hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_TIP].x * image_width
      hand_landmark_y = hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_TIP].y * image_height

    cv2.imwrite(
        '/tmp/annotated_image' + str(idx) + '.png', cv2.flip(annotated_image, 1))
    cv2.imshow("img" + str(idx),cv2.flip(annotated_image,1))
    cv2.waitKey(0)

How to get the coordinates of the dots in first hand image?

A: maybe you could use cv2.convexHull and cv2.convexityDefects to find that dots. I leave you a video tutorial that I think it could be usefull:  CONTANDO DEDOS ✌ (Usando defectos de convexidad) | Python - OpenCV


text:
Q: Newton's method in higher dimensions To calculate the inverse of a quadratic matrix A, we could solve the equation
$F(X):=X^{-1}-A=0$.
I need to show that if X is invertable, then $DF(X)(\Delta X)=-X^{-1}\Delta XX^{-1}$ where DF(X) is the Frechét derivative of F.
My idea would have been to use the standard recursive formula $x_{k+1}=x_k-\frac{f(x_k)}{f'(x_k)}$, then transform to $f'$ and plug in the matrices but that didn't really work out. What could I do?

A: With matrix functions it is better to compute the Newton step $S$ in $X_{+1}=X+S$ as the solution of the linear system resulting from the tangent root equation
$$
0=F(X)+DF(X)[S]=X^{-1}-A-X^{-1}SX^{-1}.
$$
Otherwise you would need to translate everything into $n^2$ long column vectors where then the derivative is a $n^2\times n^2$ matrix.


text:
Q: I have a simple regular expression which works in one case but doesnt in another console.log(/j/i.test(undefined)); >> false
console.log(/i/i.test(undefined)); >> true

/i/i is regular expression to test i in passed string which not defined(undefined)


text:
Q: Moshi Codegen take longer time since it uses reflection(aka."Class.classForName") to create the generated adapter. Is there a way to avoid this? Adapters generated via codegen cannot be added in the Moshi.Builder().add(Type, JsonAdapter). So moshi doesn't know how to create the compile-time generated adapter.
It uses reflection to create them, which adds a significant overhead on low-end devices in terms of latency.
is there a way to avoid this? Or should we just replace this with custom type adapters?


text:
Q: Warn about newlines in comments? There are currently no plans to add support for newlines to comments (see How about newlines within comments?). However, new users often post unreadable code snippets as a comment. Comments like:

User 1: Can you show us the code?
User 2: Here is my code #include <stdio.h> int main(void) { int a = 0; char * b = malloc(SIZE) ....

I suspect that many of these are caused by users typing in code snippets with soft returns or by copying and pasting. I think these comments could be avoided by adding a message that says some variant on:

Stack overflow removes newlines on comments before display. Perhaps your comment needs to be an edit to the question or answer, a new answer, or split in to multiple comments?

There's currently no feedback that the comment is about to have the newlines stripped - and I think the quality of comments from new users would be improved by having this feedback.

A: We absolutely don't need to encourage people to split their comments into multiple comments just because they happen to contain a new line.
When someone posts code in a comment that should be an edit, that user should be educated instead. For that matter, anyone can make that edit for them and flag comments for removal.

A: This problem is much easier to solve than you think, and it doesn't require adding more error messages to the UI that no one will ever read anyway.
In fact, the problem arises in the very first comment, presumably left by an experienced user who understands that code blocks don't belong in comments and that askers have the ability to edit their questions to include additional information.
Instead of saying:

Can you show us the code?

you should be saying:

Please edit your question to include the code.

Bonus points if "edit" is an inline link to the edit page for their question, like this.
In other words, the initial comment(s) should attempt to instruct the user on the appropriate course of action.
There is never a good reason to post blocks of code in comments, so the error message you suggest showing is encouraging precisely the wrong behavior. We don't want people splitting up the code into multiple comments, and we don't want people posting new answers when they should be editing the question. Yet, it's impossible for a new user to know which of the three proposed alternatives they should choose, and most of them, unfamiliar with the idea of editing an existing post, would probably opt for one of the latter choices.

There's currently no feedback that the comment is about to have the newlines stripped

Well, not before the comment is posted. But there's feedback immediately after, which is probably even more powerful feedback than an error message they won't bother to read anyway. It is plainly apparent after the comment gets posted that it is unreadable and not useful. I see users attempt this frequently, and every time, they have deleted the comment and tried something else. Which, it seems to me, achieves everything that you hope a pop-up message would accomplish. The only problem is that they occasionally post their code as a new answer to the question, but you aren't going to prevent that either.


text:
Q: Why does the SQL timestamp not print the time? I created a column with a data type DATE and I inserted a row of record showing the current date and time. However, the record only reflected the current date and not the time. What can I do to reflect both the date and time?
insert into TFCC_EVENT_LOG(logged_time) values (select CURRENT_TIMESTAMP from dual);

I have tried to use the code below but it returns an error as shown below.
insert into TFCC_EVENT_LOG(id,userid,menu, action, description, status, logged_time) values (TEL_pk.nextval,'ngis', 'New TFCC Submission', 'New TFCC', 'New Submission Started', 'Success', (select to_char(logged_time, 'DD-MON-YYYY HH:M:SS PM') from TFCC_EVENT_LOG));

Error starting at line : 62 in command -
insert into TFCC_EVENT_LOG(id,userid,menu, action, description, status, logged_time) values (TEL_pk.nextval,'ngis', 'New TFCC Submission', 'New TFCC', 'New Submission Started', 'Success', (select to_char(logged_time, 'DD-MON-YYYY HH:M:SS PM') from TFCC_EVENT_LOG))
Error report -
ORA-01821: date format not recognized

A: What really helped me was the alteration of session.
alter session set nls_date_format = 'DD-MM-YYYY HH24:MI:SS';

A: current_timestamp returns a timestamp, not a date, so although it should get converted safely it would be better to use sysdate unless you specifically want the time zone semantics. Timestamps are fine things but they open the door to a host of issues around session vs server time zones, so I would advise using them with caution and plenty of testing.
Once you have a date value in the table, to copy it to another table you should not attempt to manipulate it with character functions. to_date() takes a character string, so using it on a date invokes an implicit conversion to a character string using the session's default territory and format settings, which can have unpredictable results.
Client-side tools may use nls_date_format or their own settings to display date values. If you don't see a time component it is most likely a display formatting issue.

A: In your query you try to change the time stamp in a specific format using to_char function but the given format is wrong . You have to give the format as 'DD-MON-YYYY HH:MI:SS PM'
Plese try the following code:
insert into TFCC_EVENT_LOG(id,userid,menu, action, description, status, logged_time) values (TEL_pk.nextval,'ngis', 'New TFCC Submission', 'New TFCC', 'New Submission Started', 'Success', (select to_char(logged_time, 'DD-MON-YYYY HH:MI:SS PM') from TFCC_EVENT_LOG));


text:
Q: How to setup a custom posts page with WPTouch Pro Plugin I have a blog using wordpress to display posts not on front page but using a custom template like http://www.koolkatwebdesigns.com/blog/ for desktop or non-mobile. For mobile I am using WPTouch Pro Plugin with  Bauhaus theme cannot display posts only show page title like screenshot below:

page-2.php
<?php if ( foundation_is_theme_using_module( 'custom-latest-posts' ) && wptouch_fdn_is_custom_latest_posts_page() ) { ?>

    <?php wptouch_fdn_custom_latest_posts_query(); ?>
    <?php get_template_part( 'index' ); ?>

<?php } else { ?>

    <?php get_header(); ?>

        <?php if ( wptouch_have_posts() ) { ?>
            <?php wptouch_the_post(); ?>
            <?php get_template_part( 'page-content' ); ?>
        <?php } ?>

    <?php if ( wptouch_fdn_show_comments_on_pages() && ( comments_open() || have_comments() ) ) { ?>

            <?php comments_template(); ?>

    <?php } ?>

    <?php get_footer(); ?>

<?php } ?>

How I can fix it?

A: I already fixed it with myself like below:
page-2.php
<?php get_header(); ?>

<a href="<?php wptouch_the_permalink()?>"><?php wptouch_the_title(); ?>

<?php if ( have_posts() ) { wptouch_the_post(); ?>

        <?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); ?>
            <?php while ( have_posts() ) : the_post(); ?>
            <?php get_template_part( 'post-loop' ); ?>
             <?php endwhile;?>

<?php } ?>

 <?php wp_reset_query(); ?>

<?php get_footer(); ?>


text:
Q: How to make the parts of my web page editable in ASP.Net? I have requirement to make parts of a dynamic web page that includes header, footer, menu, content and buttons. I require all of them to be editable/non-editable once i turn on/off editing from admin side.
I already know that DotNetNuke already does that for the developer. I like to know what are the merits and demerits if we do it without using DNN. I like to discuss this. Thanks

A: Actually this dynamic editing is done with javascript on client side.
I can suggest a nice jQuery code that make editable part of the page with a click. The rest is to handle the save of this edit using some ajax calls. Very nice and simple
Look here a working demo :
http://www.appelsiini.net/projects/jeditable/custom.html
and get the code from:
http://www.appelsiini.net/projects/jeditable

A: Take a look at ASP.NET Web Parts.
MSDN quote:
In a Web application scenario, you could offer a complete solution for end users to manage and personalize the application. This could include a set of Web Parts controls that provide the desired features for the site, a consistent set of themes and styles that allow end users to personalize the UI in a consistent way, catalogs of Web Parts controls from which users can select the ones they want to appear on a page, authentication services, and role-based management (for example, allowing administrative users to personalize Web Parts controls and site settings for all users).


text:
Q: Query to select 'Customer_Num' with digit characters using regular expression I have a table with below structure:
Example_table(Customer_Num    varchar2(50))

Some Example data in this table :
        Example_table
----------------------------
        Customer_Num
           12445
           12345
           12ttd
           2376y
           23%%*
           23467

I want to select custoemr_num records with digit characters , so these records 12ttd , 2376y , 23%%*
should not appear in the final result . Considering the fact that I can not change the table structure , which one is the correct query ?
Q-1:
  select customer_num
  from Example_table
  where REGEXP_LIKE(customer_num, '[[:digit:]]')

Q-2:
  select customer_num
  from Example_table
  where REGEXP_LIKE(customer_num, '[0-9]')

Are there any special condition in which these queries might end up producing wrong results?
Thanks in advance.

A: Neither is correct because both only check for a single digit that can appear anywhere in the string.
A regex that only selects digits in the complete string would be:
where REGEXP_LIKE(customer_num, '^[0-9]+$')

*

*^ anchors the expression at the beginning of the string (to avoid leading non-digits)

*[0-9]+ matches multiple digits but at least one

*$ anchors the expression at the end of the string (to avoid trailing non-digits)

There is no difference between using [0-9] and using [[:digit:]]


text:
Q: Marionette js upgrade 1.x to 2.x breaks my dynamic JQuery UI tab control After an upgrade from version 1.8.8 to 2.4.1 my dynamic tabs control broke.  The new Marionette won't let me do something that the old Marionette would.
A JQuery UI tab control expects a certain UI structure. At the core, it essentially wants an unordered list inside a container.  Like this:

//this guy should have li's inside it.  They'll become tabs.

//end #tabs-container

If you call $("tabs-container").tabs() in your JavaScript, it will turn all of that stuff into a tab control with the li items inside the #tabs ul becoming your tab headers.  Here's the key.  It doesn't want the li items to be wrapped by anything, like a div.  It wants the li's directly inside the ul.
Marionette wants to wrap stuff.  And that's my problem. If I have a view render those li's inside the ul, the view wants to wrap it's output in a div.  That messes things up.
In the old Marionette I used the view's "el" property to dump the view's output directly into the ul.  Like this:
    var TabCollectionView = Marionette.CollectionView.extend({
        childView: TabChildView,
        el: $("#tabs")
    });

The new marionette doesn't like that.  It says that's putting the parent (the #tabs container) inside the new child element when it goes to appendChild.  Here's the error:
"Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': The new child element contains the parent."
I'd like to rework this the right way for the new Marionette but am a bit stuck.  How do I get closer to where I need to be?
UPDATE: In studying this a bit I see that I could pull the ul inside the view generation.  So I wouldn't define the ul as a region into which a collection of li's is rendered.  Then the problem becomes what DOM element will assume the role of region containing my tabs control.  I'm wondering if this is a use case for the "Layout" component and if this would be a more solid approach.
If you think about it, a tab control is really two regions - one for the tab headers and one for the content divs associated with each tab.  Two related regions requiring coordinated construction and display?  A job for a Layout?  Am I thinking right here?  I'm looking to organize this optimally in solving it.
MORE ANALYSIS:
What I'm doing up to this point is placing a tabs container in my DOM and then dynamically rendering the tabs in it.  Maybe what I should be doing is creating the entire tabs control, container and all, dynamically.  In walking down that path there are basically three tasks that have to be completed:

*

*.tabs() has to be called on some container. (when?)

*A container has to be built.  It must have two regions in it: a #ul region for tab headers and a separate #div region for tab contents.

*Collection views for both tab headers and and tab content have to be rendered

The questions that come out of that for me are:

*

*How can I know when the two regions have been shown so that I can call .tabs() on their container?  onShow() maybe works for something like this where you have one CollectionView, but I need to know when two two CollectionViews have been shown.

*How do I tell some structure (the outer tabs container) to render itself, and then to render two regions?  Is this what Marionette Layout does?

I'm just thinking out loud here really.  I'm reading about Layout now to see if this is a fit.  Looking for an indication that I'm heading down the right path.
NEW CODE UPDATE: closer but still not working.  DOM structure rendered seems ok.  But tabs() initialization doesn't work.  Doing it on the fly during the construction of a LayoutView just doesn't seem to work.  The tabs css classes don't get added completely and the result looks nothing like a tab control.  I don't think this LayoutView approach will work with JQuery UI tabs.  I think what may be needed is to go back to the original approach, a ul region for tabs and another region for the content areas - the approach that used to work in Marionette 1.x.  Maybe there is a way to remove the wrapper around the collections. It's that extra wrapper that is breaking the control.  I can't think of another way to do this.
    var TabLayoutView = Backbone.Marionette.LayoutView.extend({
        id: "tab-layout",
        template: Handlebars.compile(
            '
' +
            '
' +
            '
' +
            '
'
        ),

        regions: {
            tabsRegion: '#tabs',
            tabContentRegion: "#tab-content"
        },

        onBeforeShow: function () {
            var tabsRegion = this.getRegion('tabsRegion');
            var tabCollectionView = new TabCollectionView({
                collection: this.collection
            });

            var tabContentRegion = this.getRegion('tabContentRegion');
            var tabContentCollectionView = new TabContentCollectionView({
                collection: this.collection
            });

            tabsRegion.show(tabCollectionView);
            tabContentRegion.show(tabContentCollectionView);

            $('#tab-layout').tabs(); //Applies the tabs styling to the outer container (TabLayoutView)
        }
    });

    //The tabs up top

    var TabItemView = Marionette.ItemView.extend({
        tagName: "li",
        template: Handlebars.compile(
            ' {{tabName}}'
        )
    });

    var TabCollectionView = Marionette.CollectionView.extend({
        childView: TabItemView,
        //el: $("#tabs") //Setting el like this used to work in Marionette js version 1.x.  Commented out now.

    });

    //The tab content areas below the tabs

    var TabContentItemView = Marionette.ItemView.extend({
        tagName: "div",
        template: Handlebars.compile(
             '
' +
             '
'
        )
    });

    var TabContentCollectionView = Marionette.CollectionView.extend({
        childView: TabContentItemView,
        //el: $("#tab-content") //Setting el like this used to work in Marionette js version 1.x.  Commented out now.
    });

Above produces output below:

                         Bob  Jones

A: To build a collection view without div wrappings to produce:

you only need to do this:
var MyListItem = Marionette.ItemView.extend({
    tagName: 'li'
});

var MyListView = Marionette.CollectionView.extend({
    childView: MyListItem,
    tagName: 'ul'
});

Perhaps doing this and not needing to handle the other scenario will fix your problem?

A: I don't know if this will jive with your design concept, but you may consider making #tabs-container a region, in which, you would .show()
var MyListView = Marionette.CollectionView.extend({
  childView: MyListItem,
  tagName: 'ul',
  id: #tabs
});

This will replicate your DOM.
If you can't do this and you want to drop a list into the ul#tabs region, I can show you a hack to get around the CollectionView wrapper. Drop me a comment.
UPDATE
A LayoutView would solve all your problems.

*

*To render the DOM dynamically you'd provide the LayoutView with the HTML in question as a template.

var TabLayout = Backbone.Marionette.LayoutView extend({
  template: _.template($("#tabs-template").html()),
  ...
});

*The LayoutView region property would find the element in your template you want to use as a container, in this case

region: {
   tabsRegion: '#tabs-region'
 }

You'd use this region to fever you CollectionView, for example. Like this:
onBeforeShow: {
  var region = this.getRegion('tabsRegion'),
      myListView = new MyListView;

  region.show(myListView);
}

Using the MyListView we defined above.

*If you're using Marionette v. 2.4.0+ then you can use the onAttach callback to ensure that your html is in the DOM. This callback was designed specifically to work with plugins that depend on elements existing in the DOM. Read here and see that entire section.
Something like,

onAttach: {
   this.$('#tabs').tabs()
}

Where #tabs is a child of #tabs-region, is the ul you rendered in that region.
UPDATE In the comments below the OP explained that he needs to know when both views are rendered. In general Region.show() is a synchronous process and thus, once both views are rendered we simply invoke
this.$el.tabs()

From the LayoutView. Like this,
onBeforeShow: function () {
    var tabsRegion = this.getRegion('tabsRegion');
    var tabCollectionView = new TabCollectionView({ collection: this.collection });

    var tabContentRegion = this.getRegion('tabContentRegion');
    var tabContentCollectionView = new TabContentCollectionView({ collection: this.collection });

    tabsRegion.show(tabCollectionView);
    tabContentRegion.show(tabContentCollectionView);

    this.$el.tabs();

}

If it happens that the views render asynchronously, then we would attach a listener to the views using the same handler. We would check the handler and once both views have checked in, we'd call this.$el.tabs().
UPDATE The OP is looking for this DOM output:

            tab1

            tab1

tab1 content elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem

tab2 content elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem

To do that we need to set up the views as follows:
var TabLayoutView = Backbone.Marionette.LayoutView.extend({
    id: "tab-layout",
    template: Handlebars.compile(
        // We want the outer #tabs el to be a div, and for it to hold a 'ul' (see
       // the TabCollectionView)
        '
' +
        '
' +
        '
' +
        '
'
    ),

    regions: {
        tabsRegion: '#tabs',
        tabContentRegion: "#tab-content"
    },

    onBeforeShow: function () {
        var tabsRegion = this.getRegion('tabsRegion');
        var tabCollectionView = new TabCollectionView({
            collection: this.collection
        });

        var tabContentRegion = this.getRegion('tabContentRegion');
        var tabContentCollectionView = new TabContentCollectionView({
            collection: this.collection
        });

        tabsRegion.show(tabCollectionView);
        tabContentRegion.show(tabContentCollectionView);

        this.$el.tabs(); //Applies the tabs styling to the outer container (TabLayoutView)
    }
});

//The tabs up top

var TabItemView = Marionette.ItemView.extend({
    tagName: "li",
    template: Handlebars.compile(
        ' {{tabName}}'
    )
});

var TabCollectionView = Marionette.CollectionView.extend({
    childView: TabItemView,
    tagName: "ul"
});

//The tab content areas below the tabs

var TabContentItemView = Marionette.ItemView.extend({
    //Don't need 'tagName'. By default Backbone will create a div el for a View
    // Give the child contet div an id
    id: function () {
        return 'tabs-' + this.model.id;
    },
    template: Handlebars.compile(
         '
<%=content%>' +  // assuming your model has a 'content' attr
         '
'
    )
});

var TabContentCollectionView = Marionette.CollectionView.extend({
    childView: TabContentItemView,
});

Note: Read the above carefully the changes to your original code are minor, but are commented.


text:
Q: R Converting reshaped data into excel I'd like to convert the following into a seperate spreadsheet:
install.packages('reshape2')
library(reshape2)
data <- read.csv("test.csv", header=FALSE)
dcast(data, V1 ~ V2, value.var="V3")

So after I have reshaped the data in the csv file, I'd like to put it in a separate excel spreadsheet. How do I go about this?


text:
Q: BigQuery v0.28 ChunkedEncodingError: ('Connection broken: IncompleteRead(46 bytes read)', IncompleteRead(46 bytes read)) I'm trying to migrate our BigQuery client library to version 0.28. Now when I'm trying to get a table reference, it fails with a ChunkedEncodingError. Here is my code:
def table_exists(client, table_reference):
    from google.cloud.exceptions import NotFound

    try:
        client.get_table(table_reference)
        return True
    except NotFound:
        return False

We are using GAE Standard Environment. Could this be a problem with the requests library?

A: I got the same ChunkedEncodingError error when using google-cloud-bigquery package with a deployed App Engine Standard with Python.
This is a problem of urllib3 with Google App Engine. As you can see in this link:

... if you're using the Standard environment then you either have to use urllib3.contrib.appengine's AppEngineManager or use the Sockets API

I used the Sockets API, which consists on adding the following to your app.yaml file:
env_variables:
  GAE_USE_SOCKETS_HTTPLIB : 'true'

You have the official google Sockets Python API docs here
After that you can just redeploy and it should work.
Also there is a latest version for google-cloud-bigquery (0.30.0), try that instead of the 0.28.0 if you keep getting some error.


text:
Q: Setup resource health alert for multiple storage accounts So the idea is to create resource health alert for multiple storage accounts using terraform. It's fairly simple for one storage account as one would pass the value
output "id" {
description = "Id of the storage account created."
value       = azurerm_storage_account.storage.id
    }

to the resource_id or hardcode the resource id with the resource actual id. But my ask here is how I can setup one single alert block for all the storage accounts provisioned by the terraform. I have been trying to use the above data block but the name variable would take only strings. Please provide a sample example as to how you would do it.
locals {
  activity_log_alerts = {
      resource_health_alerts= {
      environment         = var.environment
      resource_group_name = var.rgp
      enabled             = "true"
     ** scopes           = module.main.storage_account_name["storage_name"] **
      alert_name     = "Resource health alert for storage accounts"
      description    = format("The state of the azure resource is unknown"}
      category       = "ResourceHealth"
      level          = "Critical"
      operation_name = null
      resource_health = [
        {
          current  = ["Unknown"]
          previous = ["Available"]
          reason   = ["PlatformInitiated"]
        }
      ]

The error I received is this: Error: Null value found in list
scopes              = tolist([var.resource_id])
UPDATE: Another Approach With this approach I was hoping to get all the resource under the same RG and subscription but got the same error
data "azurerm_subscription" "current" {

  subscription_id = var.subscription_id
}

locals {
      activity_log_alerts = {
          resource_health_alerts= {
          environment         = var.environment
          resource_group_name = var.rgp
          enabled             = "true"
          scopes             = [data.azurerm_subscription.current.id]
          alert_name     = "Resource health alert for storage accounts"
          description    = format("The state of the azure resource is unknown"}
          category       = "ResourceHealth"
          level          = "Critical"
          operation_name = null
          resource_health = [
            {
              current  = ["Unknown"]
              previous = ["Available"]
              reason   = ["PlatformInitiated"]
            }
          ]
The error I received is this: Error: Null value found in list

scopes              = tolist([var.resource_id])


text:
Q: How to launch an application with a keyboard shortcut? In Windows, certain keyboard shortcuts (usually involving the Windows key) are set to launch certain applications.  For example WK+R will launch Run, before Windows 8 WK+S would open the Send to OneNote screenshot maker, in some versions of MS Office WK+N would open Send to OneNote, etc.  (WK = Windows Key)
Is there any way I can set my own such keyboard shortcuts to launch certain programs?  (Exactly like this question only for Windows 10.)

A: If you're happy to use a Ctrl Alt keys combination instead of the Windows key, you can easily create shortcuts to any program in the Start menu, without having to install any third party program.
Just navigate to the program shortcut in the Start menu and right-click->Properties. Then click on the text box for Shortcut key. Next, press the keyboard key you want to use for the shortcut. (You can only specify key combinations using the Ctrl Alt combo, e.g. Ctrl Alt C.) Then click OK to save.
To start a program for which you've added a shortcut, hold down both Ctrl and Alt and then press the keyboard key for the character you specified, e.g. Ctrl Alt C.
This is described in the following webpage under 'Method 2.' If you want to create a link to an app instead ('Metro'/'Universal'/'Modern'), then use method 1 from the same page.
http://www.laptopmag.com/articles/create-keyboard-shortcuts-windows-10

A: Not using the windows key, but after looking into this myself (in windows 10) I am using the Caps Lock key as my own shortcut key.
Using AutoHotkey I have reassigned caps lock to mimic a control key, and then control and caps lock to actually use caps lock. This means when I hit capslock on it's own nothing happens. Auto hotkey script:
;capslock = ctrl key, ctrl and capslock = capslock
Capslock::Control
+Capslock::Capslock
return

Now I have an abundance of combinations for shortcuts to use which are not used by other applications. Caps lock and ..... you choose. Unlimited options of what you want this to trigger, either use Auto Hotkey script or like I've done just trigger a .bat file.
Example that I use every morning when at work.
Capslock & A::
    ;open Outlook
    run outlook

    ;log into network locations bat
    run, C:\Users\motmi\Desktop\BATS\network-link.bat,,min

    ;open chrome
    run chrome
return

A: Pin your applications to the Windows 10 taskbar, then you can access the first 10 on the left using:
WinKey+1,WinKey+2,WinKey+3...WinKey+0
No third party software or other setup required.
I have a little piece of paper adjusted under my main monitor, so I can see which key is for which application, because the number sits exactly below the icon in the taskbar.


text:
Q: Heroku error 'Couldn't find that process type (web)' I faced with problem. When I deployed my project on heroku and wrote this command in cmd, I get this error. Thanks in advance!
(base) MacBook-Pro-:fr_scraper $ heroku ps:scale web=1
 ▸    Couldn't find that process type (web).


text:
Q: php математические операции ключ => значение Есть массив:
[
   'anyKey1' => 'anyNumber1',
   'anyKey2' => 'anyNumber2',
   'anyKey3' => 'anyNumber3',
            ...
]

Возможно ли сложить все значения (числа) и получить общее число?
P.s. Ключи все разные...

A: $ar = array("key1" => "1", "key2" => 2);
var_dump(array_sum($ar));

Документация по array_sum()

A: $ar = array("key1" => "1", "key2" => 2);
$sum = 0;
foreach( $ar as $key => $value ) {
    $sum +=  $value;
}

echo $sum;

A: т.к.

но при арифметических действиях использую bcmath

то в дополнение к ответам
$data = [ .... ] ;
$result = array_reduce($data, 'bcadd', '0');


text:
Q: Deploying EF 4.1 code-first ASP.NET MVC3 to medium trust shared hosting I think, this is quite common situation nowadays, so its surprising, that I have troubles finding nice and clean solution for it (even here at SO).
I have my ASP.NET MVC3 web application using Entity Framework 4.1 with code-first approach (using DatabaseInitializer to seed default data). I also tried two database options: SQL Express 2008 R2 and SQL Compact 4. Everything is working fine on local.
Now I want to host my app so I found hosting (middle one called 'optimal') and finally (after some issues) got into state, where I am getting medium-trust error (I believe).

The application attempted to perform
  an operation not allowed by the
  security policy.  To grant this
  application the required permission
  please contact your system
  administrator or change the
  application's trust level in the
  configuration file.

Let's take as fact that I can't configure that hosting any way and I do not think, that they are going to switch me to full-trust.
What do I have to do, to make my application work on medium-trust hosting?
Edit: I have found some answers that are usually propagating setting medium trust at local dev and just do it like that, so my question could now be something like:
What are "top 5 reasons" why your ASP.NET MVC3 EF 4.1 app won't work at medium-trust?
Edit: I have added bounty to this becuase I would like to see some discussion.. or at least more oppinions/experiences, containing more than just "set medium trust at local dev". Maybe there is nothing to discuss here, but I am just curious because I already spent more time on this than I would like.

A: I've seen other people complain of the same error when the server did not have .NET 3.5 Service Pack 1 and were able to work around it by putting the DLLs in their bin folder.
There's also a little more info here about a few things to check:
log4net throwing Security Exception in ASP.Net MVC web application

A: Do you have the latest EF Code First library?  Everything before the RC was not medium trust compatible.
If you are going to use SQL CE 4, it is medium trust compatible but did you deploy the SQL CE database engine files?
Are you sure your problem is EF Code First? AKA - Have you tried just deploying a simple MVC site first and getting it running?  Here's an article on setting up MVC in medium trust and another on bin deploying MVC3 for hosts who aren't running/supporting MVC3 yet.


text:
Q: Setting collation of full text index on SQL Server 2014 to distinguish 'ss' and 'ß' I want to distinguish 'ss' and 'ß' within the full text indexing respectively quering the dynamic management functions of the full text index (sys.dm_fts_index_keywords and sys.dm_fts_index_keywords_by_document), but I can only choose the language of the full text index (GERMAN) and not any kind of (binary) collation.
My local table test_1(id, text) contains two datasets: (1, 'Maße'), (2, 'Masse'). In German Maße and Masse are two different words, but unfortunately the following query only returns 'Masse':
SELECT display_term
FROM sys.dm_fts_index_keywords(DB_ID('Test'), OBJECT_ID('Test.dbo.test_1'))

The text column has Latin1_General_BIN as collation. The following query returns only one row as it is supposed to do:
SELECT text
FROM test_1
WHERE text like '%Maße%'

How can I configure the database or table or full-text-index to achieve a distinction between words containing 'ss' and 'ß' for quering the dynamic management functions of the full text index (sys.dm_fts_index_keywords and sys.dm_fts_index_keywords_by_document)?


text:
Q: How can I set a route for a controller without a default action in MVC 5? I have the following:
routes.MapRoute(
    "Account",
     url: "{controller}/{action}/{id}",
     defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
    );

However I don't want to specify a default action. Is there a way to do this for my MVC5 application ?

A: Of course you can.
routes.MapRoute(
    "Account",
     url: "Account/{action}/{id}",
     defaults: new { controller = "Account", id = UrlParameter.Optional }
    );


text:
Q: Read/Write CSV as binary with Python I just found out that I can save space\ speed up reads of CSV files.
Using the answer of my previous question
How do I create a CSV file from database in Python?
And 'wb' for opens
  w = csv.writer(open(Fn,'wb'),dialect='excel')

How can I open all files in a directory and saves all files with the same name as starting name and use 'wb' to reformat all files. I guess convert all CSV's to binary CSV's.

A: You can't "overwrite a file on the fly".  You have two options:

*

*if the files are small enough (smaller than the amount of available RAM by
a comfortable margin), just loop over them (os.listdir makes that loop
easy, or os.walk if you want to catch the whole tree of subdirectories,
not just one directory), and for each, read it in memory first, then
overwrite the on-disk copy.

*otherwise, loop over them, and each time write to a new file (e.g. by
appending .new to the name), then move the new file over the old.  This
is safer (no risk of running out of memory, no risk of damaging a file if
the computer crashes) but more complicated.
So, what is your situation: small-enough files (and backups for safeguard against computer and disk crashes), in which case I can if you wish show the simple code; or huge multi-GB files -- in which case it will have to be the complex code?   Let us know!


text:
Q: Prism WPF MVVM Hello World I'm trying to find a Windows friendly UI development environment that I can translate what experience I do have into something usable, maintainable, and current. I like the idea of a web based UI, but that introduces another problem since a local Windows platform is required to perform various computations (because that's where the binaries and licenses are available).
I've decided on WPF + a well supported MVVM framework like Prism as a starting point. I have looked at the WPF samples they provide here:
https://github.com/PrismLibrary/Prism-Samples-Wpf
For the Prism supplied "examples", there isn't much of a description for what is going on in each step. There is mention of a Hello World example being added 3 years ago, but that doesn't seem to exist anymore.
Does anyone know of a good, simple example, based on the current Prism WPF Template, showing how to implement a "Hello World" type application? In my mind, something where you click a button that fires off an activity that when complete, will update a text box, or any other text/numeric control on the UI?

A: Based on further explanation in the comments.
PRISM has a huge amount of cruft rather than least and I suggest you instead look at mvvmlight. The way I would usually work is to create a new wpf app then add mvvmlightibs as a package using nuget.
I put together two samples you might find relevant:
https://social.technet.microsoft.com/wiki/contents/articles/31915.wpf-mvvm-step-by-step-1.aspx
https://social.technet.microsoft.com/wiki/contents/articles/32164.wpf-mvvm-step-by-step-2.aspx
The second uses mvvmlight.
I'm not suggesting you read just my articles but I have a bunch of them on wpf and a lot are aimed at newbies.
https://social.technet.microsoft.com/wiki/contents/articles/30959.user-page-andy-oneill.aspx


text:
Q: $|A^2|=|A|$ for every infinite $A$ iff Axiom of Choice holds. I've seen this assertion in a few comments around the site, and I found the answer to the $\rightarrow$ implication here.
Does anyone know a (hopefully simple) proof of the $\leftarrow$ implication?


text:
Q: How to install PyQt on Ubuntu 12.04 with python 2.7? There may be some similar questions like this one, but I didn't find any answer for me.
I tried some ways to do it like:
sudo aptitude install python-qt4-dev python-sip4 python-sip4-dev
from: https://groups.google.com/forum/#!topic/mnemosyne-proj-devel/VQQzjhARWoA
I tried:
sudo aptitude install python-qt4
from: http://www.saltycrane.com/blog/2008/01/how-to-install-pyqt4-on-ubuntu-linux/
Every time after above installations I got error:
$python2.7
Python 2.7.3 (default, Aug  1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4

I also tried to install it from source downloading PyQt4 from:
http://www.riverbankcomputing.co.uk/software/pyqt/download
and sip from: http://www.riverbankcomputing.co.uk/software/sip/download
Then I got error tring to install PyQt4:
$ sudo python configure.py --verbose
Determining the layout of your Qt installation...
/usr/bin/qmake -o qtdirs.mk qtdirs.pro
make -f qtdirs.mk
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I. -o qtdirs.o qtdirs.cpp
qtdirs.cpp:1:28: fatal error: QCoreApplication: No such file or directory
compilation terminated.
make: *** [qtdirs.o] Error 1
Error: Failed to determine the layout of your Qt installation. Try again using
the --verbose flag to see more detail about the problem.

My question is: What is proper and effective way to install PyQt4 on Ubuntu 12.04?

A: On aws ubuntu (12.04 and 14.04):
sudo apt-get update
sudo apt-get install python-qt4
sudo apt-get install libxml2-dev libxslt1-dev python-dev
sudo apt-get install python-lxml
sudo apt-get install xvfb

Check this link and generate your-own-example.py
DISPLAY=localhost:1.0 xvfb-run python your-own-example.py

Voila.

A: You did in fact properly install the python bindings for Qt4 when you used:
sudo aptitude install python-qt4

You should usually use the Distribution-provided packages - the Ubuntu-provided packages are perfectly adequate for your needs.
What's puzzling me is the error you got after installing the Ubuntu package. I just tried this on a Ubuntu 12.04 installation and it worked for me. That suggests to me that your current installation of Ubuntu on your system is broken in some way.
You could try completely purging the python-qt4 package and reinstalling it again;
sudo apt-get remove --purge python-qt4

If you also issue:
sudo apt-get clean

... that will remove any downloaded package files from the system, so that apt will then download the package file again when you issue a
sudo apt-get install python-qt4

If that still doesn't work, then something very odd indeed is going on with your Ubuntu installation, and it might be wise to completely reinstall Ubuntu.


text:
Q: Smali type cast to primitive type I get the following dalvikvm verifier error:
Line 1041: W/dalvikvm( 2610): VFY: register1 v5 type 13, wanted 5
Line 1042: W/dalvikvm( 2610): VFY:  rejecting opcode 0x70 at 0x0032
Line 1043: W/dalvikvm( 2610): VFY:  rejected Lcom/cleanmaster/notification/aj;.b

Smali code:
.method private b(Lcom/cleanmaster/notification/normal/NotificationSetting;Lcom/cleanmaster/notification/normal/o;Landroid/widget/RemoteViews;)V
.registers 11
.prologue
const/4 v5, 0x1
.line 126
iget-object v0, p2, Lcom/cleanmaster/notification/normal/o;->s:Landroid/content/Intent;
if-eqz v0, :cond_c
.line 127
iget-object v0, p2, Lcom/cleanmaster/notification/normal/o;->s:Landroid/content/Intent;
.line 128
const-string v1, "notify_style_type"
.line 129
invoke-static {v5}, Ljava/lang/Byte;->valueOf(B)Ljava/lang/Byte;
move-result-object v5
const-string v6, "putExtra(Ljava/lang/String;B)Landroid/content/Intent;"
invoke-static {v6, v0, v1, v5}, La;->c(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
invoke-virtual {v5}, Ljava/lang/Byte;->byteValue()B
move-result v5
:cond_c
.line 130
invoke-static {}, Lcom/keniu/security/c;->a()Landroid/content/Context;
move-result-object v1
.line 131
const-string v0, "notification"
.line 132
const-string v6, "getSystemService(Ljava/lang/String;)Ljava/lang/Object;"
invoke-static {v6, v1, v0}, Lb;->a(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v6
check-cast v6, Ljava/lang/Object;
move-object v0, v6
check-cast v0, Landroid/app/NotificationManager;
iget-boolean v2, p1, Lcom/cleanmaster/notification/normal/NotificationSetting;->i:Z
iget-boolean v3, p1, Lcom/cleanmaster/notification/normal/NotificationSetting;->o:Z
.line 133
invoke-direct {p0, v1, p2, v2, v3}, Lcom/cleanmaster/notification/aj;->a(Landroid/content/Context;Lcom/cleanmaster/notification/normal/o;ZZ)Landroid/app/Notification;
move-result-object v2
iget v3, p2, Lcom/cleanmaster/notification/normal/o;->d:I
const/4 v4, 0x0
.line 134
invoke-direct {p0, v3, v4, v5}, Lcom/cleanmaster/notification/aj;->a(IZZ)I

It looks to me like the last invoke-direct parameter v5 is a problem. Somehow dalvik things its not a primitive type and therefore cannot be cast to boolean. Altough there is a:
invoke-virtual {v5}, Ljava/lang/Byte;->byteValue()B
move-result v5

Is there a check-cast missing?

A: Opcode 0x70 is invoke-direct. The only invoke-direct instruction that references v5 is the last one: invoke-direct {p0, v3, v4, v5}, Lcom/cleanmaster/notification/aj;->a(IZZ)I. It appears that v5 is being set from the method you mention, but it is a byte (B), while this method expects a boolean (Z)
In order to diagnose this sort of issue yourself, you can run baksmali on the problematic dex file with the -r option, which adds comments in the disassembly related to the types of registers at any given point.
Another useful option is -f, which adds comments with the instruction offsets, so you can identify exactly which instruction the dalvik verification error is for.
e.g. rejecting opcode 0x70 at 0x0032 - so you would look for the instruction at offset 0x32
baksmali classes.dex -o out -f -r

And finally, in order to determine the actual types that the error mentions, you can look at the enum at https://android.googlesource.com/platform/dalvik/+/kitkat-mr2.2-release/vm/analysis/CodeVerify.h#59
e.g. for W/dalvikvm( 2610): VFY: register1 v5 type 13, wanted 5: type 13 is byte, while type 5 is boolean.


text:
Q: treating web page like directory I'm a Mac user and I want to cd to a web page and then cp some files onto a local directory. Is there a way to do this?
This is the page I'm referring to: http://www0.cs.ucl.ac.uk/staff/M.Herbster/GI07/week5/

A: In general, it isn't possible to navigate a website like a directory, because there's no standard way to list the files inside a directory. In fact, there isn't even a concept of directory on the web: whether http://foo/bar/wibble serves a file called wibble in a directory called bar is a matter of how the server is designed, it doesn't have to be that way. It's also possible to have different content depending on the number of slashes (e.g. http://foo/bar/wibble and http://foo/bar/wibble/ and http://foo/bar//wibble return different content), which cannot be represented as tree of file paths.
Note that unlike what others have claimed here, it is possible to navigate remote files as if they were local. For example, you can cd into an FTP site if you mount it; ways to do that include Macfusion on OS X, gvfs-mount on Linux with Gnome, curlftpfs on Linux or OS X, and AVFS. All of these work through FUSE, which is a framework to expose basically anything as a directory tree.
There's no general way to expose a web server as a directory tree, though, because it doesn't really have this tree structure. Also, requests to the same URL can return different content (based on the client's language preferences, user agent, cookies, etc.).
The server you want happens to serve a page that looks like a directory listing when you access certain URLs. But that page is formatted on the server, it isn't something that your browser formats like when accessing an FTP site. In principle, it would be possible for the client to parse this and generate a directory listing; for example there's an httpfs that does this but it only supports the output for a specific way to format the directory listing on the server site. There's actually a standard protocol for accessing directory trees over HTTP — WebDAV — but it isn't used very often. I'm not aware of an implementation that parses Apache's standard directory listing, which I think is what your site serves.
If you want to download a file on the command line, you can use curl. If you want to download all the files in a directory, you can use wget (not included on OSX but can be installed via package managers):
wget -r -np -l1 http://www0.cs.ucl.ac.uk/staff/M.Herbster/GI07/week5/

wget -r -np http://… is analogous to cp -r http://… ., but the recursion works differently. cp copies directories by enumerating the files in them, including subdirectories on which it acts recursively, and copies regular files by creating a file with the same content. On the web, there's no distinction between directories and regular files; wget recurses by following all the links in an HTML page. The option -r tells wget to copy recursively, and -np tells it not to follow links that point "up" — which is a textual matter: it only follows links whose target begins with http://www0.cs.ucl.ac.uk/staff/M.Herbster/GI07/week5/ (with rules for relative links that achieve the same result). The option -l1 is an extra safety to tell it to stop recursing after one level (i.e. it follows links from the HTML file at the given URL, and then stops); it isn't necessary, but it's recommended to avoid situations where the recursive download gives you a lot more material than you'd originally intended because of extra links that you hadn't noticed.

A: Like DisplayName mentioned in his respond you can't cd into a website. cd command works only in directories on your local machine if not used with another command to remotely access a machine like ssh.
You need a command like wget or curl to download something from web. In addition to the curl examples you could use wget like this:
download a certain file
wget http://www0.cs.ucl.ac.uk/staff/M.Herbster/GI07/week5/dtrain123.dat
download files with a certain file extension from this directory
wget -rl1 -A .dat http://www0.cs.ucl.ac.uk/staff/M.Herbster/GI07/week5/
download all files from this directory
wget -r -np -l1 http://www0.cs.ucl.ac.uk/staff/M.Herbster/GI07/week5/

explanation of command options:
  -r recursive download (careful with that!)
  -A comma seperated list of allowed file extensions
  -l maxdepth of recursion while 'inf' or '0' means infinite.
  -np omits parent directories
url's used refer to the url you mentioned


text:
Q: How to handle circular dependencies across multiple guice private modules? I am currently writing some framework code that provides a blueprint for services within our platform so that service implementors can focus on the service specific logic rather than the boilerplate integration code. Dependency injection is done via guice.
The blueprint has 2 types of logical component;

*

*1 and only 1 integration component that integrates the service with the outside world (messaging middleware etc)

*1-n business logic components

Each logic component depends on the integration component.
The integration component depends on all the logic components.
Since this is framework code, the framework is not aware of any of the concrete details so it is not possible to statically declare the dependencies and form the dependency graph. I would like to avoid making service implementors do this because it means they are repeating themselves (just declaring that they have n business logic modules means they have this circular dependency).
My question is what approaches can I take to make this work without making service implementors write that boilerplate code?
Note that multibindings are not available here as, for various reasons outside the scope of this question, each business logic component must be a PrivateModule.
A contrived example to illustrate where

*

*business logic = ModuleA, ModuleB, ModuleC

*dependency provided by the integration = Wrapper

*Integration's dependency on the business logic is modelled by each logic module adding something to the Wrapper

This example can be made to work by changing
@Provides @Exposed @Named("result")
public String go(Container in) {
    return in.format();
}

to
@Provides @Exposed @Named("result")
public String go(@Named("a") Container in, @Named("b") Container in2, @Named("c") Container in3) {
    return in.format();
}

i.e. by actually creating a circular dependency.
import com.google.inject.Exposed;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.PrivateModule;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
import com.google.inject.name.Names;

import java.util.ArrayList;
import java.util.List;

public class GuiceCircularDependencyTest {

    public static void main(String[] args) {
        Injector in = Guice.createInjector(new Owner());
        String result = in.getInstance(Key.get(String.class, Names.named("result")));
        System.out.println("Result is: " + result);
    }

    public static class Owner extends PrivateModule {
        @Override
        protected void configure() {
            bind(Container.class).in(Singleton.class);
            install(new Integration());
            install(new ModuleA());
            install(new ModuleB());
            install(new ModuleC());
            expose(String.class).annotatedWith(Names.named("result"));
        }
    }

    public static class ModuleA extends PrivateModule {

        @Override
        protected void configure() {

        }

        @Provides @Exposed @Named("a")
        public Container go(Container in, Wrapper prefix) {
            in.add(prefix + "A");
            return in;
        }
    }

    public static class ModuleB extends PrivateModule {

        @Override
        protected void configure() {

        }

        @Provides @Exposed @Named("b")
        public Container go(Container in, Wrapper prefix) {
            in.add(prefix + "B");
            return in;
        }
    }

    public static class ModuleC extends PrivateModule {

        @Override
        protected void configure() {

        }

        @Provides @Exposed @Named("c")
        public Container go(Container in, Wrapper prefix) {
            in.add(prefix + "C");
            return in;
        }
    }

    public static class Integration extends PrivateModule {
        @Override
        protected void configure() {
            bind(Wrapper.class).toInstance(new Wrapper("Module"));
            expose(Wrapper.class);
        }

        @Provides @Exposed @Named("result")
        public String go(Container in) {
            return in.format();
        }
    }

    public static class Container {
        private List<String> strings = new ArrayList<>();

        public void add(String string) {
            strings.add(string);
        }

        public String format() {
            return strings.toString();
        }
    }

    public static class Wrapper {
        private final String prefix;

        public Wrapper(String prefix) {
            this.prefix = prefix;
        }

        @Override
        public String toString() {
            return prefix;
        }
    }
}

A: One workaround, that allows a Multibinder to be shared across private modules, is to wrap the PrivateModule in an AbstractModule implementation that simply installs the PrivateModule and binds the exposed key to the Multibinder
import com.google.inject.AbstractModule;
import com.google.inject.Exposed;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.PrivateModule;
import com.google.inject.Provides;
import com.google.inject.multibindings.Multibinder;
import com.google.inject.name.Named;
import com.google.inject.name.Names;

import java.util.Set;

public class GuiceCircularDependencyTest {

    public static void main(String[] args) {
        Injector in = Guice.createInjector(new Owner());
        String result = in.getInstance(Key.get(String.class, Names.named("result")));
        System.out.println("Result is: " + result);
    }

    public static class Owner extends PrivateModule {
        @Override
        protected void configure() {
            Multibinder<String> multi = Multibinder.newSetBinder(binder(), String.class);
            install(new Integration());
            install(new ModuleWrapper<>(new ModuleA(), multi));
            install(new ModuleWrapper<>(new ModuleB(), multi));
            install(new ModuleWrapper<>(new ModuleC(), multi));
            expose(String.class).annotatedWith(Names.named("result"));
        }
    }

    public static class ModuleWrapper<T> extends AbstractModule {
        private final WrappablePrivateModule<T> inner;
        private final Multibinder<T> multi;

        public ModuleWrapper(WrappablePrivateModule<T> inner,
                             Multibinder<T> multi) {
            this.inner = inner;
            this.multi = multi;
        }

        @Override
        protected void configure() {
            install(inner);
            multi.addBinding().to(inner.getExposedKey());
        }
    }

    public static abstract class WrappablePrivateModule<T> extends PrivateModule {

        @Override
        protected void configure() {

        }

        public abstract Key<T> getExposedKey();
    }

    public static class ModuleA extends WrappablePrivateModule<String> {

        private static final String SUFFIX = "A";

        @Override
        public Key<String> getExposedKey() {
            return Key.get(String.class, Names.named(SUFFIX));
        }

        @Provides @Exposed @Named(SUFFIX)
        public String expose(Wrapper prefix) {
            return prefix + SUFFIX;
        }
    }

    public static class ModuleB extends WrappablePrivateModule<String> {

        private static final String SUFFIX = "B";

        @Override
        public Key<String> getExposedKey() {
            return Key.get(String.class, Names.named(SUFFIX));
        }

        @Provides @Exposed @Named(SUFFIX)
        public String expose(Wrapper prefix) {
            return prefix + SUFFIX;
        }
    }

    public static class ModuleC extends WrappablePrivateModule<String> {

        private static final String SUFFIX = "C";

        @Override
        public Key<String> getExposedKey() {
            return Key.get(String.class, Names.named(SUFFIX));
        }

        @Provides @Exposed @Named(SUFFIX)
        public String expose(Wrapper prefix) {
            return prefix + SUFFIX;
        }
    }

    public static class Integration extends PrivateModule {
        @Override
        protected void configure() {
            bind(Wrapper.class).toInstance(new Wrapper("Module"));
            expose(Wrapper.class);
        }

        @Provides @Exposed @Named("result")
        public String go(Set<String> in) {
            return in.toString();
        }
    }

    public static class Wrapper {
        private final String prefix;

        public Wrapper(String prefix) {
            this.prefix = prefix;
        }

        @Override
        public String toString() {
            return prefix;
        }
    }
}


text:
Q: Android wrap_content programmatically in animation i working animation.i wrote code witch can slide right laout with animation.it working perfect but i have problem different screen size resolution
this is a my source
setAnimation(holder.layoutmain, -400, true);
private void setAnimation(View view, int xCordinnant, boolean close) {
    view.animate().translationX(xCordinnant).setDuration(500)
            .setInterpolator(new AccelerateDecelerateInterpolator());
}

my xml code
 <RelativeLayout
    android:id="@+id/DBSlideLayout"
    android:layout_width="wrap_content"
    android:layout_height="145dp"
    android:layout_alignParentRight="true"
    android:background="#2e2e2e"
    android:visibility="visible" >

    <ImageView
        android:id="@+id/DBSliderClose"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="18dp"
        android:background="@drawable/db_lose" />

    <ImageView
        android:id="@+id/counter_plus"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/DBSliderClose"

        android:layout_alignParentRight="true"
        android:layout_marginRight="89dp"
        android:background="@drawable/counter_plus" />
    <ImageView
        android:id="@+id/counter_minus"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/counter_plus"
        android:layout_below="@+id/DBSliderCounter"
        android:layout_marginTop="16dp"

        android:background="@drawable/count_minus" />

    <TextView
        android:id="@+id/DBSliderCounter"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/DBSliderClose"
        android:layout_alignLeft="@+id/counter_plus"
        android:layout_alignRight="@+id/counter_plus"
        android:gravity="center"
        android:text="10"
        android:textColor="#ffffff" />
</RelativeLayout>

i slide my layout -400 but large screen resolution  i can not show  perfect my layout.
how i can wrote code to can slide  wrap_content instead of -400?
thanks

A: Have you tried this?
TranslateAnimation anim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
anim.setDuration(500);
view.startAnimation(anim);


text:
Q: Nodemailer: require is not defined I have a problem using Nodemailer. These are the instructions I follow: http://www.nodemailer.com/docs/install
I'm using Grunt server.
Step 1
I start writing this command inside my project folder:
npm install nodemailer --save
And everything seems to be working, the nodemailer folder appears inside node_modules folder and inside package.json I have this line of code:
"dependencies": {
    "nodemailer": "^0.6.3"
  },
Step 2
I try to reference to the nodemailer by writing this inside my javascript file:
var nodemailer = require("nodemailer");
Error
But then I get this error: Uncaught ReferenceError: require is not defined
Other methods
I have also tryed to do the following:
require("nodemailer.js");
require("/..path.../nodemailer.js");
But nothing seems to work.
Have anyone any idea why I can't access nodemailer? Please keep in mind that I'm new to javascript. Thank you :)


text:
Q: Display paragraph once if tempalte conditions are met - Xsl 1 Im trying to edit a mail being formatted with XSL 1 to display one line if my template conditions are met and information is displayed in the mail. The mail has the current format:
People attending:

   person1
       -someinfo

   person2
       -someinfo

People not attending:

   person3
       -someinfo

The problem is when there are nothing displayed for people not attending, the mail will still show "People not attending:" as i currently have it before running the apply-template.
Is there any good way to display the paragraph before the information about people not attending, only if there are people not attending? The reason for two templates is that in my original code i check for changes in the xml.
Code:

People not attending

<xsl:apply-templates select="1_type/2_group/1_type_f" mode="pn"/>

<xsl:template match="1_type_f" mode="pn">
    <xsl:if test="((1_type_f_v/@old_selected='Selected') and (1_type_f_v/@selected!='Selected'))">
        <xsl:apply-templates select="t1_type_f_v" mode="pn"/>
    </xsl:if>
</xsl:template>

<xsl:template match="1_type_f_v" mode="pn">
    <xsl:if test="((@old_selected='Selected') and (@selected!='Selected'))">

<xsl:value-of select="../nameOfPerson"/>

<xsl:value-of select="someInfo"/>

<xsl:value-of select="someInfo2"/>

    </xsl:if>
</xsl:template>

A: Instead of outputting

People not attending

<xsl:apply-templates select="1_type/2_group/1_type_f" mode="pn"/>

unconditionally you need to use xsl:if
<xsl:if test="1_type/2_group/1_type_f">

People not attending

    <xsl:apply-templates select="1_type/2_group/1_type_f" mode="pn"/>
</xsl:if>

I am not quite sure if the xsl:if test condition I have used above suffices, I suppose it might not, so you will need to see whether you can adapt it to check whether the input has any elements you will output there.
Another option would be to run the apply-templates into a variable, convert it to a node-set with exsl:node-set or similar and then check whether it has any relevant content and only then to output the heading (or in your case p) and the contents of the variablee.