Posts

android - convert protobuff class as model and store its value using realm -

i generating protobuf class using squareup wire protobuf libary here proto file syntax = "proto2"; package squareup.dinosaurs; option java_package = "com.squareup.dinosaurs"; message dinosaur { // common name of dinosaur, "stegosaurus". optional string name = 1; // urls images of dinosaur. repeated string picture_urls = 2; } and here auto generated code // code generated wire protocol buffer compiler, not edit. // source file: dinosaur/dinosaur.proto @ 8:1 package com.squareup.dinosaurs; import com.squareup.wire.fieldencoding; import com.squareup.wire.message; import com.squareup.wire.protoadapter; import com.squareup.wire.protoreader; import com.squareup.wire.protowriter; import java.io.ioexception; import java.lang.object; import java.lang.override; import java.lang.string; import java.lang.stringbuilder; import java.util.list; import okio.bytestring; public final class dinosaur extends message<dinosaur, dinosaur.builder...

Getting all of the variables of a dart class for json encoding -

i have class class person{ string _fn, _ln; person(this._fn, this._ln); } is there way list of variables , serialize it? want make tojson, wanted have generic enough such key variable name, , value value of variable name. in javascript like: var myobject = {}; //.... whatever want define as.. var tojson = function(){ var list = object.keys(myobject); var json = {}; ( var key in list ){ json[list[key]] = myobject[list[key]] ; } return json.stringify(json); } dart doesn't have built in functionality serialization. there several packages different strategies available @ pub.dartlang.org. use mirrors, harmful client applications because results in big or huge js output size. new reflectable packages replaces mirrors without disadvantage don't know if serialization packages ported use instead. there packages use code generation. there question answer lists available solutions. i'll when i'm back.

video - Why is youtube's "still" screen blurry? -

on youtube video @ bottom of this page , screencap blurry once hit play, it's clear. there way fix this? okay, think i'm understanding question... i'm not 100% sure. (you're asking why it's blurry in "thumbnail"/screencap before hit play, correct?) my guess youtube's embedding using frame @ beginning of video as it's fading in . if video, suggestion have eliminating delete video, go editing, , remove fade-in effect @ beginning of video. if youtube grabbing frame beginning of video i'm positive fix way. hope helps! best of luck!

postgresql - Django model reference like loop? -

i want know how django model circular reference... like, class family(models.model): fname = models.charfield(max_length=30,unique=true) member_id = models.foreignkey(member) class member(models.model): name = model.charfield(max_length=30,unique=true) family_id = models.foreignkey(family) these 2 familiy , member models. want circular reference... main goal bind member under each families. that's works fine. query parse family table , want main member of particular family like, want family head each family means shall do? explain circular reference or better method available that. or shall foreign key both. please solution. that's not right approach, shouldn't have circular reference in models. if want have relationships that, depend on requirement: if 1 person can has 1 family, put family foreign key in member model. if 1 person can have multiple families, put member manytomany field in family model. also, don't name fie...

matlab - Caffe using hdf5 layer and imagedata input layer together in train_val.proto -

i using hdf5 data layer reading input images(around 30000) have , metadata images. i unable crop-flip data augmentation, since when use centre crops, storing data of 1500 images leads around 1.5 gb h5 file, total size of hdf5 dataset(30 h5 files) becomes ~40 gb, , can not use augmentation hdf5 dataset large. so, thinking if use imagedata layer reading images , hdf5 data layer metadata, problem can solved. didn't find material on this. possible so? yes is, thought getting error due else in proto file, below input layers proto layer { type: "hdf5data" name: "data" top: "meta" hdf5_data_param { source: "/path/to/train.txt" batch_size: 50 } include { phase: train } } layer { name: "data" type: "imagedata" top: "x" top: "labels" include { phase: train } transform_param { mirror: true crop_size: 227 mean_file: "data/ilsvrc12/imagenet_m...

.net - WCF service multiple behaviors -

Image
i've done wcf, it's been while, , i've never had configure service scratch. apparently, while can have 1 behavior configuration , it's possible attach multiple behaviors wcf service: servicehost servicehost = new servicehost(typeof(services.fooservice), serviceendpointuri); webhttpbinding binding = new webhttpbinding(); serviceendpoint sep = servicehost.addserviceendpoint(typeof(contracts.ifooservice), binding, string.empty); sep.behaviors.add(new webhttpbehavior()); sep.behaviors.add(new mycustomendpointbehavior()); i'm wondering: is possible attach multiple service behaviors service? ... or, matter, multiple endpoint behaviors? or limited @ 1 of each? that's not clear me snippet (which closest thing answer i've turned far in search). is possible via configuration (rather programmatically)? you create named behavior list behaviors sub-items of named behavior. <system.servicemodel> <behaviors> <e...

mesos - How to update the number of topic partitions on dcos-kafka? -

i'm using dcos-kafka on mesos , cannot figure out how update number of partitions topic. seems can update topic using dcos kafka update [topic-name] [parameter]=[value] unfortunately, can't figure out parameter updating number of partitions be. possible?