Posts

Showing posts from February, 2014

uiactivityviewcontroller - How to export Apple's new RAW photo format .dng in iOS 10? -

i'm having trouble exporting apple's new raw photo format .dng. uiactivityviewcontroller exports photo jpeg, defeats purpose. any appreciated. here's how fixed issue. -(void)activityaction{ phasset *asset = self.assetsfetchresults[(int)self.image_number]; phimagerequestoptions *options = [[phimagerequestoptions alloc] init]; options.synchronous = no; options.version = phimagerequestoptionsversioncurrent; options.deliverymode = phimagerequestoptionsdeliverymodeopportunistic; options.resizemode = phimagerequestoptionsresizemodenone; options.networkaccessallowed = no;//has yes download cloud , progress show /*options.progresshandler = ^(double progress,nserror *error,bool* stop, nsdictionary* dict) { nslog(@"progress %lf",progress); //never gets called };*/ [[phimagemanager defaultmanager] requestimagedataforasset:asset options:options resulthandler:^(nsdata *imagedata, nsstring *datauti, uiimageorientation imageorientation, nsdictionary *i...

html - How to fix the alignment/position of a image label (for checkboxes/radio buttons)? -

code taken 2 different sources, append dont have 10 rep post them. first attempt . notice horribly placed radio buttons. second attempt . donot know source, direct google result. notice difference between top , bottom padding/alignment. i tried using [li] element didnt work. adding img{display: block;} css gives unexpected results. "fills" whole element image, , left part of image hidden behind green part. i self-professed css/html noob, can understand things , simple things placement/alignment still mystery me. i'd know how code works. planning add green border "selected" "button" , change minor visual stuff. i'd know how center "tick" , implement "tick" mark locally/globally , not rely on content:'\2714'; . help me understand happening here, , how can fix (and apply knowledge in future). edit : updated 2nd attempt, looking quite good, imho. if alignment fixes.... sigh . ok, sound silly.....

html - How to set the width of a div equal to the width of its sibling img -

i have html code this: <div class="card"> <div class="card-content"> <img src="somesource.png" width=480px height=320px> <footer> text here makes width of footer greater width of sibling img tag. </footer> </div> </div> i want footer have same width of sibling img no matter width of image. widths of images different depending upon images contained want footer have same width of image. have tried following: .card { display: inline-block; } .card-content { display: flex; flex-direction: column; } but widens img if footer wider image. not want. want width of footer dependent on width of image , not other way round. please me. suggestions in advance. try this $(document).ready(function(){ var x = $(".card-content > img").width(); var y = $(".card-content > footer").width(); y = x; if(y == x) { $...

hadoop - Total number of replicated files after copying hdfs file into hive table -

suppose if load file in hdfs hive table total replicas of file. in hdfs file replicated 3 times , copying hive table results in additional replicas sums 6 replicas or not?? in hdfs, number of replicas based on replication factor set. in case, since replication factor 3, there 3 copies. when sqoop import hdfs hive(into internal table) , data copied 1 location on hdfs table in hive. replication of hive data again happens based on replication factor. in total end 3(hdfs) + 1(hive copy)*3 => 3copies on hdfs , 3 copies of data stored hive (this not 6 copies, hive doesn't store data in same file format). or if load data inpath internal table old copy lost , newer hive copy exists. end hive table(and replicated copies). in case, 3 hive table copies (as rep set 3). or if create external table, no new copy created. meta of data created hive. end hdfs copies + hive meta storage copies . in case, 3 copies in hdfs + 3 copies of meta data stored on hive. ...

android - how i retrive the data in edit text from shared preference? -

hi can tell me hod saved data in edit text after saving , mean when save text want text appear in edit text time thanks. here code: public class mainactivity extends appcompatactivity { private toolbar toolbar; private edittext inputname; private textinputlayout inputlayoutname; private button btnsave; public static final string mypreferences = "myprefs" ; public static final string message = "namekey"; sharedpreferences sharedpreferences; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); inputlayoutname = (textinputlayout) findviewbyid(r.id.input_layout_name); inputname = (edittext) findviewbyid(r.id.input_message); btnsave = (button) findviewbyid(r.id.btn_save); inputname.addtextchangedlisten...

ios - MVVM and RxSwift for Search Screen -

in purpose of education mvvm , rxswift want build simple search screen, have table view , search bar. when user types search bar show have in table. sounds pretty simple, can't find tutorial suits me. i have written code in view controller, can't understand have observe search text changes , call database method, filter items search text. some code, have. my viewcontroller import foundation import uikit import rxswift import rxcocoa class placesearchviewcontroller: uiviewcontroller { //mark: - @iboutlet weak var searchbar: uisearchbar! @iboutlet weak var tableview: uitableview! //mark: - dependencies private var viewmodel: placesearchviewmodel! private let disposebag = disposebag() //mark: - lifecycle override func viewdidload() { super.viewdidload() viewmodel = placesearchviewmodel() addbindstoviewmodel(viewmodel) } //mark: - rx private func addbindstoviewmodel(viewmodel: placesearchview...

Is there a variable to set so that "make" command searches for makefiles -

is there variable set, make command searches makefiles in other directories rather searching makefiles in current working directory? update : scenario this, in our project have script defines & sets of environment variables. make given in root folder (to build) doesn't have makefile. hence, don't think "-c" or other make options can in this. found, after investigation, makefile in internal folders , being invoked. so, question there environmental varibles makes "make" command search makefiles in specified directories (by environment variable). the short answer no, it's not possible have make search makefiles in different directory 1 started in (or switched due -c option, gnu make) default. you have 2 options: 1 use -f option above. the other set makefiles variable list of makefiles want read in before invoke make . note must actual files want read in, not directory contains them. downside of default target never taken these m...

centos - installing MailHog on Linux virtual box to capture outgoing emails -

i wanted ease development installing mailhog on centos linux development environment in virtual box. php mail() function doesn't report issues (that is, returns true) outgoing mails did not appear in mailhog. how should set correctly? follow these steps: download appropriate mailhog version https://github.com/mailhog/mailhog/releases . use mailhog_linux_amd64 in example may need different version. assume use home directory store files. in case don't this, please, make required modifications accordingly. if vm uses ip filtering should allow communication through port 8025 adding line iptable config , restarting it: vim /etc/sysconfig/iptables -a input -m state --state new -m tcp -p tcp --dport 8025 -j accept service iptables restart launch mailhog following command: ./mailhog_linux_amd64 -hostname=mylocal.vbox:8025 where mylocal.vbox domain name how host sees vm. should see lines detailing ip addresses , ports uses. download mhsendmail here: https://g...

sql - drop the bulk table from database -

i want drop bulk table database name starts string. create table #temp ( tablename varchar(50) ) insert #temp select name sys.objects type='u' name '%' declare @name varchar(50) declare cursorname cursor -- declare cursor local scroll static for select tablename temp open cursorname -- open cursor fetch next cursorname into @name while @@fetch_status = 0 begin fetch next cursorname into @name drop table @name end close cursorname -- close cursor deallocate cursorname -- deallocate cursor note : work if table u talking abt doesnt have table depedencies .

ios - Applying a CIFilter to a Video File and Saving it -

is there fast, lightweight-as-possible way apply cifilter video? before it's mentioned, have looked @ gpuimage - looks powerful magic code, it's overkill i'm trying do. essentially, to take video file, stored @ /tmp/myvideofile.mp4 apply cifilter video file save video file different (or same) location, /tmp/anothervideofile.mp4 i've been able apply cifilter video that's playing extremely , using avplayeritemvideooutput let player = avplayer(playeritem: avplayeritem(asset: video)) let output = avplayeritemvideooutput(pixelbufferattributes: nil) player.currentitem?.addoutput(self.output) player.play() let displaylink = cadisplaylink(target: self, selector: #selector(self.displaylinkdidrefresh(_:))) displaylink.addtorunloop(nsrunloop.mainrunloop(), formode: nsrunloopcommonmodes) func displaylinkdidrefresh(link: cadisplaylink){ let itemtime = output.itemtimeforhosttime(cacurrentmediatime()) if output.hasnewpixelbufferforitemtime(itemtime){...

java - Unable to render design of XML in Android Studio -

Image
i have installed java 1.8 , installed android studios. after started new project (blank activity), tried click on 'design' tab of xml file display screen. however hitting error i checked configuration , saw have java 1.8 setup in ide. any advise on how can resolve issue? thanks possible duplicate of android n requires ide running java 1.8 or later? maybe answer mac in question you: https://stackoverflow.com/a/38493792/6714194

jquery - JavaScript: addClass when element is in viewport using animate.css -

i using animate.css nice , simple beginner. can animation work , can delay animation animation-duration: 3s , animation-delay: 0s; can't find how trigger when comes viewport scroll down it. here code have tried far: html <div class="about-container"> <p>content here...</p> </div> css .about-container{ background-color: #a3c17f; width: 500px; height:500px; margin: 0 auto; } javascript $(function() { if ($("#about-container").length > 0) { addclass('animated pulse') } }); </script> look @ element. using class. should $('.about-container'). can change id. $(function() { if($('#about-container').length > 0) { // check if there's element $('#about-container').addclass('animated pulse'); // how add class in jquery } }); plain javascript var abtcontainer = document.getelementbyid('about-co...

mysql - add column value from a 1 row of a table and display the other column -

i want add multiple column , display other column. here database table: id | firstname | lastname | score1 | score2 | score3 1 | mark | lupez | 5 | 7 | 4 2 | james | cruz | 6 | 3 | 5 i want add score1, score2 , score3 in every row , display this: id | lastname | firsname | total_score | 1 | mark | lupez | 16 | 2 | james | cruz | 14 | i try google , find answer no luck, mind not working though. just add score columns: select id, firstname, lastname, score1 + score2 + score3 total_score yourtable

java - getLastRowNum not returning correct number of rows -

Image
i having small conundrum in using getlastrownum(). trying number of rows data excel sheet. supposing have 3 rows, should return in print out statement stating 3 rows. issue no matter how many rows populate, returning me fixed number. following excerpt of code: fileinputstream fis = new fileinputstream("c:\\test data\\login.xlsx"); xssfworkbook wb = new xssfworkbook(fis); xssfsheet sheet = wb.getsheet("login"); system.out.println("no. of rows : " + sheet.getlastrownum()); my excel sheet consist of following from attached image, should getting row count of 4, getting 6 instead. any advice appreciated. thank in advance. speaking attached file, should return row number of 3 because of xssfsheet.getlastrownum() zero-based. if receive number of 6, seems have 3 additional blank rows in sheet. if open existing file , contains blank rows, here example how clean it. if fill table yourself, seems need check code places empty line created. ...

rust - Understanding lifetime management while modeling containment relationship -

i'm trying wrap head around rust objects lifetime. performing relationship modeling exercise ran following error. error: cannot borrow `bob` mutable because `bob.gender` borrowed immutable [e0502] the code here: // business case: // design person type. person may own car. person should able buy , sell cars. // 2 persons should able exchange (or trade) cars. // // purpose of exercise: // understand lifetime management in rust while modeling containment relationship. // (meaning: when object contains reference object.) struct car { make: &'static str, model: &'static str, year: &'static str, } struct person<'a> { name: &'static str, gender: &'static str, car: option<&'a car>, } impl<'a> person<'a> { fn new(name: &'static str, gender: &'static str, car: option<&'a car>) -> person<'a> { person { na...

javascript - Passing getChildContext() to reactjs higher order components throws unexpected token error in webpack -

i got following example here make higher order component passing context reliably. however, there unexpected token error passing getchildcontext() function when compiling script using webpack: getchildcontext = () => getchildcontext(this.props); ^^^ code: const providecontext = (childcontexttypes, getchildcontext) => (component) => { class contextprovider extends react.component { getchildcontext = () => getchildcontext(this.props); render() { return <component {...this.props} />; } } contextprovide.childcontexttypes = childcontexttypes; return contextprovider; }; is there workaround way of passing function? my webpack config: var common = { output: {path: build_dir}, module: { loaders: [ { test: /\.js$/, loader: 'babel', include: app_dir, query: { presets: ['es2...

extent reports with selenium and java - how to see progress of tests on screen/console -

i using selenium + java + testng + extent reports combination. a)i see progress of tests on console easy monitor progress. extent reports can seen in end , not show on screen while test in progress. b) how combine testng , extent reports output. thanks in advance. q: see progress of tests on console easy monitor progress. a: add @aftermethod or @beforemethod print current state of suite using testng data (e.g. itestresult, itestcontext). q: extent reports can seen in end , not show on screen while test in progress. a: nope, wrong. provides real-time reporting. see basic-usage . q: how combine testng , extent reports output. a: mean? may log output extent methods. see examples .

Wrapping an object around javascript json format, how to get angular to parse it -

Image
when json coming web api wrapped in object called "devices" cannot seem @ data angular 2 observable this pic of data in console when use .json file without devices object wrapped works fine... if call .json file works display private _producturl = 'api/devices/devices.json'; but observable code not see add in .devices private _producturl = 'http://localhost:42822/api/device'; constructor(private _http: http) { } getproducts(): observable<idevice[]> {//observable<iproduct[]> { return this._http.get(this._producturl) .map((response: response) => <idevice[]>response.json()) .do(data => console.log("all: " + json.stringify(data))) .catch(this.handleerror); } you may have cros issue. on server side, add following entry in response header api/device : access-control-allow-origin: * @component({ selector: 'json-com', template: ` <h2><a [href]="titleu...

Javascript Date issues returning 1 day less than set date - timezone -

date formatting issues javscript date(). background: i'm modifying jquery ui datepicker , having trouble months , dates returning incorrect values. $('#datefield').datepicker({ beforeshowday: function(date) { // issues experienced here - isolation test code below // mon aug 01 2016 00:00:00 gmt+1000 (aus eastern standard time) // datemonth: 8 - iso: 20160731 } }) based js date() construction on http://www.w3schools.com/jsref/jsref_obj_date.asp sample code: var d1 = new date(); var d1month = d1.getmonth()+1; var d1iso = d1.toisostring().slice(0,10).replace(/-/g,""); console.log(d1); console.log('1month: '+d1month+' iso: '+d1iso); var d2 = new date(2016,06,31); var d2month = d2.getmonth()+1; var d2iso = d2.toisostring().slice(0,10).replace(/-/g,""); console.log(d2); console.log('2month: '+d2month+' iso: '+d2iso); var d3 = new date('2016-07-31'); var d3month = d3.getmonth()+1;...

javascript - Elasticsearch search with multi fields -

how can create body elasticsearch select * table full_name '%q%' or address '%q%' or description '%q%' order full_name , description , address a wildcard query can expensive, if search in several fields. right way using ngram token filter on fields want search part of. first create index below custom analyzer slice , dice fields searchable tokens: curl -xput localhost:9200/tests -d '{ "settings": { "analysis": { "analyzer": { "substring_analyzer": { "tokenizer": "standard", "filter": ["lowercase", "substring"] } }, "filter": { "substring": { "type": "ngram", "min_gram": 1, "max_gram": 15 } } } }, "mappings": { "test": { "properties":...

vb.net - VB programming. Integer array and prime numbers -

i'm new programming , stack overflow blogs, following 'do's , dont's' properly. i have been given assignment question asking me store 5 integers in array , determine if prime number or not. the questions have follows: how store them integer array? how make program divide every input every number less input? the code have written far this: sub main() dim a, b, c, d, e integer dim isprime boolean = true console.writeline("please enter value a: ") = console.readline console.writeline("please enter value b: ") b = console.readline console.writeline("please enter value c: ") c = console.readline console.writeline("please enter value d: ") d = console.readline console.writeline("please enter value e: ") e = console.readline if mod (a - 1) > 0 or = 2 , <> 0 console.writeline("a prime number") elseif mod (a - 1) = 0 ...

javascript - Add "0" to countdown timer after it reaches 0 -

so basicly have countdown timer add "0" once reaches below "10". far have tried if statement (in code below) did not work. here full code: countdowntimer('01/1/2017 12:0 am', 'countdown'); countdowntimer('01/1/2017 12:0 am', 'newcountdown'); function countdowntimer(dt, id) { var end = new date(dt); var _second = 1000; var _minute = _second * 60; var _hour = _minute * 60; var _day = _hour * 24; var timer; function showremaining() { var = new date(); var distance = end - now; if (distance < 0) { clearinterval(timer); document.getelementbyid(id).innerhtml = 'expired!'; return; } var days = math.floor(distance / _day); var hours = math.floor((distance % _day) / _hour); var minutes = math.floor((distance % _hour) / _minute); var seconds = math.floor((dis...

swift - SystemStatusBar statusItem title being cut short on OS X -

Image
i trying display os x application statusitem in system status bar , having success except fact title being cut off. initializing so: let statusitem = nsstatusbar.systemstatusbar().statusitemwithlength(-1) func applicationdidfinishlaunching(anotification: nsnotification) { let icon = nsimage(named: "statusicon") icon?.template = true statusitem.image = icon statusitem.menu = statusmenu statusitem.title = "this test title" } the problem statusitem.title appearing so: as can see application next mine (istatmenubar) cutting off title application (or similar happening) if comment out icon statusitem, works , shows entire title when re-add icon cuts off again. there way 2 (icon , title) co exist? have reviewed apple docs , may have missed critical piece explains this. thanks guys. one option assign custom view statusbaritem , within view's class override drawrect(dirtyrect: nsrect) e.g. private var icon:statusmenuvie...

python - restframework 'tuple' object has no attribute '_meta' -

django throws next exception: restframework 'tuple' object has no attribute '_meta' model class bdetail(models.model): lat = models.floatfield(blank=true, null=true) lng = models.floatfield(blank=true, null=true) class meta: # managed = false db_table = 'b_detail' view from .models import bdetail .serializers import bdetailserializer rest_framework import viewsets class bdetaillist(viewsets.modelviewset): queryset = bdetail.objects.all() serializer_class = bdetailserializer urls from django.conf.urls import url, include bdetail import views rest_framework import routers router = routers.defaultrouter() router.register(r'bdetail', views.bdetaillist) urlpatterns = [ url(r'^', include(router.urls), name='bdetail') ] serializers from .models import bdetail rest_framework import serializers class bdetailserializer(serializers.hyperlinkedmodelserializer): class meta: ...

javascript - Summing Int of Range and blocking Range when maximum is reached -

so i'm trying script character generator of rpg , want people set stats. these stats can go 1 10 each. user uses regular html ranges set them. i'm summing these until user reaches 18 points overall. issue here is, don't know how stop the rages go when 18 points hit. i'm summing stats this: <fieldset id="attribute" oninput="streight.value=parseint(staerke.value);wisdom.value=parseint(weisheit.value);agility.value=parseint(geschick.value);apwert.value=parseint(staerke.value)+parseint(weisheit.value)+parseint(geschick.value)+' / 36'"> <legend>attribute</legend> <label for="staerke">stärke</label> <input type="range" id="staerke" value="1" min="1" max="10"> <output name="streight" for="staerke">1</output> ...

Calcuate MD5 hash of a large file using javascript -

how upload 500mb file , md5 hash cryptojs? here code: $('#upload-file').change(function(){ var reader = new filereader(); reader.addeventlistener('load',function () { var hash = cryptojs.md5(cryptojs.enc.latin1.parse(this.result)); window.md5 = hash.tostring(cryptojs.enc.hex); }); reader.readasbinarystring(this.files[0]); }); if file under 200mb, works. bigger, this.result empty "". i've tried: filereader api on big files javascript filereader - parsing long file in chunks and got work , console complaining .join("") http://dojo4.com/blog/processing-huge-files-with-an-html5-file-input cryptojs has progressive api hash digests . rest taken form alediaferia's answer slight modifications. function process() { getmd5( document.getelementbyid("my-file-input").files[0], prog => console.log("progress: " + prog) ).then( res => console.l...

png - generate png24 asset with a transparent background -

Image
i using file->generate->image assets command in photoshop cc generate png file out of layer. i have tried myfile.png8, myfile2.png24, myfile3.png32, myfile4.png . noticed *.png24 file doesn't have transparent background, while other files do. why , how can fix it? please check attached image. did uncheck body background layer? if not try , find other layers covering full background. press ctrl+alt+shift+s save image web find png24 along other format. confirm check transparency button before saving. hope work you. please confirm worked.

python - how to generate n random integers of k digits -

is there way create n random integers of k digits. for example.. 2000 random integers comprising of [0, 2, 3] my trick use random number of generator , assign values based on the ranges? but wondering if there better way in python? edit: example: [0,0,0, 2, 2,3,0,0,2,2,..... 2000 elements] comprising of 0,2 , 3 approach def assign(x): if x< 0.3: return 0 elif x<0.6: return 2 else: return 3 x = np.random.rand(num) x = map(lamdba x:assign(x),x) from sounds of it, looks want generate sequence of length n using values found within list k . python's random.choice function combined list comprehension perfect this. the following function generate list of length n each element being random element chosen k . from random import choice def random_choices(n, k): return [choice(k) _ in xrange(n)] here same thing simple list comprehension. from random import choice foo = [choice(k) _ in xrange(n)] *thanks mr....

javascript - How to have component interact with nested dialog component in Angular 2? -

i have generic component. component has n buttons, n can set parent. parent component can have multiple instances of generic component. when button clicked on generic component, need notify parent component button has been pressed, , way identify button has been pressed. need have parent component able call function on nested component. here's rough example of i'm looking do: @component({ selector: 'parent-component', ... }) export class parentcomponent{ public ongenericcomponentbuttonpress(someid){ if (someid === "foo"){ genericcomponentinstance.closecomponent(); }else{ dootherthing(); } } } @component({ selector: 'generic-component', ... }) export class genericcomponent{ public closecomponent(){} } i need way communicate , forth this. assuming parent component can have multiple instances of genericcomponent, possible? you need 2 communication forms: child par...

gz - Is there any way I can check how many flush points in a gzip file? -

i have huge .gz file created zlib , want examine how many flushes points in (see http://www.zlib.net/manual.html gz flush operation). there way can it? you can use infgen disassemble stream, , search empty stored blocks (a line containing "stored" followed line containing "end").

fuzzy comparison - Python: Fuzzywuzzy not working for foreign characters -

when try simple fuzzywuzzy expression foreign characters, erroneous results using process.extractone method (i've tried , without u): >>> choices= [u"הלכות חנוכה",u"הלכות פורים",u"הלכות סוכה"] >>> process.extractone("הלכות סוכה", choices) (u'\u05d4\u05dc\u05db\u05d5\u05ea \u05d7\u05e0\u05d5\u05db\u05d4', 0) yet runs smoothly fuzz.ratio: >>> fuzz.ratio("הלכות ראש השנה", "הלכות תעניות") 69 and same code works great regular characters: >>> choices= ['this','that','those'] >>> process.extractone("these", choices) ('those', 80) what might problem? pass fuzz.ratio in scorer= argument , add u in front of string you're trying match for. below works: choices= [u"הלכות חנוכה",u"הלכות פורים",u"הלכות סוכה"] process.extractone(u"הלכות סוכה", choices, scorer=fuzz.ratio)...

json - ASP.NET Forms Authentication plus Basic Authentication -

so, if want make single page web application, can set website forms authentication, create accounts, authorize ajax request, etc forms authentication. user logs in, browser gets auth cookie, browser makes ajax/json request auth cookie, server determines , sends ajax/json response, , right world. similarly, if want make mobile app, can set rest service. rest service uses basic authentication. user logs in, user gets authorization token response header, app sends restful/json request authorization token request header, server determines am, , sends restful/json response, , right world. but, want same asp.net site/code/webconfig same thing identical requests? sounds it's virtually impossible. missing something?

command line - git undo does not revert file back to its original state -

i have created new repository , had readme.md file added it. added on remote repository. cloned remote local machine , added .ignore file , staged file in master branch. later on decided wanted revert readme original state while commiting other files first staged , committed .ignore files , tried following commands undo changes readme: git reset head readme.md git checkout -- readme.md when did not work tried out git checkout head -- readme.md git reset --hard <commit id> readme.md git reset --hard head readme.md git reflog readme.md git checkout <commit id> readme.md git checkout readme.md none of these seem have worked. when hit command git status see following output:- on branch master branch ahead of 'origin/master' 1 commit. (use "git push" publish local commits) changes not staged commit: (use "git add <file>..." update committed) (use "git checkout -- <file>..." discard changes in work...

neural network - Passing Individual Channels of Tensors to Layers in Keras -

i trying emulate equivalent separableconvolution2d layer theano backend (it exists tensorflow backend). first step need pass 1 channel tensor next layer. have 2d convolution layer called conv1 16 filters produces output shape: (batch_size, 16, height, width) need select subtensor shape (: , 0, : , : ) , pass next layer. simple enough right? this code: from keras import backend k image_input = input(batch_shape = (batch_size, 1, height, width ), name = 'image_input' ) conv1 = convolution2d(16, 3, 3, name='conv1', activation = 'relu')(image_input) conv2_input = k.reshape(conv1[:,0,:,:] , (batch_size, 1, height, width)) conv2 = convolution2d(16, 3, 3, name='conv1', activation = 'relu')(conv2_input) this throws: exception: tried call layer "conv1". layer has no information expected input shape, , cannot built. can build manually via: layer.build(batch_input_shape) why layer not have required shape information? i'm us...

How to Communicate With Serial Port on a WWAN Modem Using C# -

Image
i have written program in c# allows me communicate (using @ commands) serial ports inside of our computers. code find ports looks this: managementobjectsearcher searcher = new managementobjectsearcher("root\\cimv2", "select * win32_pnpentity"); //this loops through results searcher foreach (managementobject queryobj in searcher.get()) { //if finds port, if (queryobj["caption"].tostring().contains("##### wireless at")) { //it writes file sw.writeline("serial port : {0}", queryobj["caption"] + "\n"); sw.flush(); } this code works splendidly our older modems, searches through com ports , finds @ wireless command port. port send @ commands to. here 2 pictures of device manager of ports searching for the issue is, rolling out our com...

python 3.x - pip install hotqueue not working -

i trying run following command install hotqueue sudo pip install hotqueue but not seem work. following output command generates on computer. the directory '/home/viraj_96/.cache/pip/http' or parent directory not owned current user , cache has been disabled. please check permissions , owner of directory. if executing pip sudo, may want sudo's -h flag. directory '/home/viraj_96/.cache/pip' or parent directory not owned current user , caching wheels has been disabled. check permissions , owner of directory. if executing pip sudo, may want sudo's -h flag. collecting hotqueue downloading hotqueue-0.2.7.tar.gz complete output command python setup.py egg_info: downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz extracting in /tmp/tmptqdyx8b8 working in /tmp/tmptqdyx8b8/distribute-0.6.14 building distribute egg in /tmp/pip-build-cz3_ivfm/hotqueue creating build creating build/src creating build/src/docs creati...