Posts

Showing posts from June, 2015

Use of << in given Verilog code? -

in following verilog code snippet implementing input buffer router, in second line, role of 1<<`buf_width ? understand << left shift operator, happens left shifting 1 `buf_width ? or there other function of << operator? `define buf_width 3 // buf_size = 16 -> buf_width = 4, no. of bits used in pointer `define buf_size ( 1<<`buf_width ) module fifo13( clk, rst, buf_in, buf_out, wr_en, rd_en, buf_empty, buf_full, fifo_counter ); input rst, clk, wr_en, rd_en; input [7:0] buf_in; // data input pushed buffer output[7:0] buf_out;// port output data using pop. output buf_empty, buf_full; // buffer empty , full indication output[`buf_width :0] fifo_counter; // number of data pushed in buffer reg[7:0] buf_out; reg buf_empty, buf_full; reg[`buf_width :0] fifo_counter; reg[`buf_width -1:0] rd_ptr, wr_ptr; // pointer read , write addresses reg[7:0] ...

.htaccess - Redirecting to rewritten URL -

when user visits mysite.com , i'd them taken mysite.com/welcome . address rewritten version of mysite.com/index.html it's appending /welcome onto address. i've tried using redirect in .htaccess loops continuously. there way achieve , still keep index.html welcome page? rewriteengine on rewriterule ^welcome$ /index.html [l] redirect 301 / /welcome try instead: rewriteengine on rewriterule ^$ /welcome [r=302,l] rewriterule ^welcome$ /index.html [l] first line redirects request made root /welcome . second rule internally rewrites /welcome index.html .

PHP, how to set class variable value from function -

i creating class variable, can see code below, want access $allen = new guest(...); echo $allen->username; instead have use $allen->getusername(); but since username won't change after class created, there way this? <?php class guest { var $firstname; var $lastname; var $email; var $username; function guest($firstname, $lastname, $email) { $this->firstname = $firstname; $this->lastname = $lastname; $this->username = getusername(); // option 1 $this->username = $this->getusername(); // option 2 preg_match('/^.*(?=(@))/i', $this->email, $username); $this->username = $username[0]; // messy work } function getusername() { preg_match('/^.*(?=(@))/i', $this->email, $username); return $username[0]; } } ?> in order deny direct access c...

c# - Awkward Generic Repository Call -

Image
i implementing generic repository pattern , have done quite few times every time there bugging me. if have database design below. (all tables relate 1 another.) , make call following public ienumerable<domain> getrealestate() { return _repository.getall(); } i can models 1 call (the wonders of ef ). thing bugs me fact have domain in method call, domain entity relevant entity ( lazy loading ) companies etc. etc. feels wrong use domain entity companies etc. etc. repo pattern using straight forward one. is there better way of writing methods not weird? below sample code have controller [routeprefix("api/realestate")] public class realestatecontroller : apicontroller { private readonly irealestateservice _service; public realestatecontroller(irealestateservice service) { _service = service; } [route("")] public task<domain> getrealestates() { ...

c++ - Create ranking for vector of double -

i have vector doubles want rank (actually it's vector objects double member called costs ). if there unique values or ignore nonunique values there no problem. however, want use average rank nonunique values. furthermore, have found question @ ranks, ignore non-unique values. example, have (1, 5, 4, 5, 5) corresponding ranks should (1, 4, 2, 4, 4). when ignore non-unique values ranks (1, 3, 2, 4, 5). when ignoring nonunique values used following: void population::create_ranks_costs(vector<solution> &pop) { size_t const n = pop.size(); // create index vector vector<size_t> index(n); iota(begin(index), end(index), 0); sort(begin(index), end(index), [&pop] (size_t idx, size_t idy) { return pop[idx].costs() < pop[idy].costs(); }); // store result in corresponding solutions (size_t idx = 0; idx < n; ++idx) pop[index[idx]].set_rank_costs(idx + 1); } does know how take non-unique values account? prefer usi...

regex - Retain carriage returns in text filtered through a regular expression -

i need search though folder of logs , retrieve recent logs. need filter each log, pull out relevant information , save file. the problem regular expression use filter log dropping carriage return , line feed new file contains jumble of text. $reg = "(?ms)\*{6}\sbegin(.|\n){98}13.06.2015(.|\n){104}00000003.*(?!\*\*)+" get-childitem "logfolder" -filter *.log | where-object {$_.lastaccesstime -gt [datetime]$test.starttime} | foreach { $a=get-content $_; [regex]::matches($a,$reg) | foreach {$_.groups[0].value > "myoutfile"} } log structure: ******* begin message ******* <info line 1> date 18.03.2010 15:07:37 18.03.2010 <info line 2> file number: 00000003 <info line 3> *variable number of lines* ******* end message ******* basically capture between begin , end dates , file numbers value. know how can without losing line feeds? tried using out-file | select-string -pattern $reg , i've nev...

.htaccess - Problems adding SSL redirect to htaccess file on host -

i have htaccess rewriterule ^(?:languages|sources|upload|templates_c)\b.* index.php/$0 [l] and when add rewriteengine on rewritecond %{https} !=on rewriterule ^/?(.*) https://%{server_name}/$1 [r,l] it not work how add ssl made htaccess file. thanks do not use server_name variable. not configured on shared hosting , dependent on usecanonicalname directive. depending on server may off or not configured among other things. try this. rewriteengine on rewritecond %{https} !^on rewriterule ^/?(.*)$ https://%{http_host}/$1 [r=301,l] rewriterule ^(?:languages|sources|upload|templates_c)\b.* index.php/$0 [l]

java - Android, killing an Activity from another Activity from GCM message -

i've wrote app receives gcm message , stores in database creates alertdialog show above app new message is, problem have if new message received before current alertdialog closed don't see new message, if sit , close each message fine. so think ive been trying ask 'is alertdialog showing...if not show message, if showing close , open new 1 new message'. does sound feasible? cheers mark i recommend using notification rather alert dialog showing incoming messages. notificationmanager lets set id , tag when post notification. if later post 1 same id , tag, existing 1 updated. on lollipop (and newer) devices can similar effect describe notification coming on top of current app using heads notifications: http://developer.android.com/guide/topics/ui/notifiers/notifications.html#heads-up

c# - Query to entity framework 7 using linq and related entities -

i have query witch working fine : list<igrouping<country, visitedcity>> tempquery = null; using (var db = new mydatacontext()) { tempquery = db.visitedcities.include(c => c.personwhovisited).include(c => c.personwhovisitednationality).include(c => c.city) .groupby(c => c.personwhovisitednationality) .tolist(); } var datainput = tempquery .orderby(c => c.key.name) .select(cp => new { countryname = cp.key.name, visitationsbycity = cp .groupby(x => x.city, x => x.cityid) .select(c => new { city = c.key, numberofvisits = c.count() }) }).tolist(); but problem is loading data application (i have 300 000 rows on largest table) , getting slow day day of course because loading in tolist() met...

makefile - Detect if make command target is a path or a phony -

background i writing several books in markdown. files structured follows: description writing/ makefile 1. main makefile (shown below) book.template 2. pandoc template uses title books/ current.txt 3. contains current book name book1/ meta.mk 4. sub-makefile defines title chapters/ 01.md 5. actual text of book 1, chapter 1 02.md ... book2/ meta.mk chapters/ 01.md 02.md ... ... here makefile: curr_book_name:=$(shell cat books/current.txt) curr_book_dir:=books/$(curr_book_name)/ curr_chapters_dir:=$(curr_book_dir)chapters/ curr_chapters:=$(wildcard $(curr_chapters_dir)*.pdf) # suppose each meta.mk defines title variable include $(curr_book_dir)/meta.mk all: pdfs ...

google cast - Chromecast not available for testing -

i added chromecast device on "google cast sdk developer console" , it's showing "ready testing" on console. unfortunately, device isn't showing available when i'm launching un-published app. additionally, remote debugger isn't loading @ http://[ip]:9222 any clue on how resolve? i've tried removing/adding device again , rebooting few times. make sure have entered correct serial number (take photo , enlarge since easy read incorrectly) in dev console. reboot chromecast read config again. if still doesn't work, contact our help center further assistance.

c++ - XLib application not redrawing unless resized -

so, have application in c++ uses xlib. in it, access date , time using ctime library, , in expose event, create string , put in window, centered. problem that, time updates when resized, instance, seconds not change unless continually resize window. here code: #include <stdio.h> #include <cstdio> #include <stdlib.h> #include <string.h> #include <x11/xlib.h> #include <ctime> int main (int argc, char *argv[]) { display *display; visual *visual; int depth; int text_x; int text_y; xsetwindowattributes frame_attributes; window frame_window; xfontstruct *fontinfo; xgcvalues gr_values; gc graphical_context; xkeyevent event; char contents[80] = " "; ...

c++ - Explicit DLL function calling any function -

Image
i'm trying make experimental interpreted language based on tutorial http://compilers.iecc.com/crenshaw/ in c++. want implement system calling dll functions @ runtime, i'm trying use explicit linking in c++. type of data , amount of arguments undefined, depends of code processed interpreter, tried use variadic function(because unknown amount of arguments) , void pointers(because unknown type of parameter) still don't works. the below code test later implemented in project: typedef void* (winapi *_dllproc)(...); // it's variadic because parameters undefined // tried using variadic (like this) // void* calldllfunction(lpcwstr dllname, lpcstr funcname, int numargs, ...) void* calldllfunctiona(lpcwstr dllname, lpcstr funcname, void* val1, void* val2, void* val3, void* val4) { //va_list ap; // tried use variadic // hinstance hinstlib = loadlibrary(dllname); void* retval; _dllproc func = (_dllproc)getprocaddress(hinstlib, funcname); // ...

AltBeacon's Android Beacon Library getting major, minor and UUID -

the first thing is first time using beacons. i'm using library altbeacon currently have several things working, example, when enter region or when leave .. distance beacon correctly. works perfectly. uuid, major , minor .. not know if i'm doing correctly. this code: public class hello extends activity implements beaconconsumer { protected static final string tag = "readme"; private beaconmanager beaconmanager; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.hola); beaconmanager = beaconmanager.getinstanceforapplication(this); beaconmanager.getbeaconparsers().add(new beaconparser(). setbeaconlayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24")); beaconmanager.bind(this); } @override public void onbeaconserviceconnect() { try { beaconmanager.startrangingbeaconsinr...

Using PHP Variables as HTML Form Input Attributes -

is possible use php variables attributes in form inputs? i have following variable declared: $instock //number of items in stock i use variable per below, code isn't working (the max constraint not being applied field): print "<td><input type='number' name='product1' id='product1' min='0' max='<?php echo $instock ?>' value='0'></td>"; is legal, or attempting syntactically impossible? sorry if stupid question - i'm new @ this, , embarrass myself frequently. : / it's possible, syntax incorrect though. you're double dipping on php brackets. i prefer instead of using print, it's easier read, if ide doing syntax highlighting: ?><td><input type='number' name='product1' id='product1' min='0' max='<?php echo $instock ?>' value='0'></td><?php you within print/echo statement, need have va...

nonblocking - ZeroMQ pattern for load balancing work across workers based on idleness -

i have single producer , n workers want give work when they're not processing unit of work , i'm struggling find zeromq pattern. 1) req/rep the producer requestor , creates connection each worker. tracks worker busy , round-robins idle workers problem: how notified of responses , still able send new work idle workers without dedicating thread in producer each worker? 2) push/pull producer pushes 1 socket workers feed off, , workers push socket producer listens to. problem: has no concept of worker idleness, i.e. work gets stuck behind long units of work 3) pub/sub non-starter, since there no way make sure work doesn't lost 4) reverse req/rep each worker req end , requests work producer , sends request when completes work problem: producer has block on request work until there work (since each recv has paired send ). prevents workers respond work completion could fixed separate completion channel, producer still needs polling mech...

hash - PHP Compare a crypted password from db with an inserted password from a form -

i've db crypted password. when user logs in, make this: $result = mysqli_fetch_assoc(mysqli_query($conn,$query)); $cryptedpass = $result['password']; $pass = $_post['password']; if(strcmp($cryptedpass,md5($pass))==0) echo "yeah!"; it works, know if right manner, or if there of safer! don't use md5. there plenty of online documents explain how insecure is. example: https://en.wikipedia.org/wiki/md5 i recommend using crypt() function. read here: http://php.net/crypt a 1 use crypt_blowfish here's function found while back, use. unfortunately can't remember found it, can't reference author. function blowfishencrypt($string,$rounds) { $salt = ""; $saltcharacters = array_merge(range('a','z'),range('a','z'),range(0,9)); ($i=0;$i<22;$i++) { $salt .= $saltcharacters[array_rand($saltcharacters)]; } $hashstring = crypt($str...

networking - C# Protobuf .NET Using Preexisting Byte Array -

so working protobufs in .net , trying incorporate them buffer pool , asyncsocketeventargs pool. buffer pool assigns sections of huge byte array event args. so, problem, can't figure out way have protobufs serialize directly onto 1 of buffers. instead methods appear serialize onto there own buffers, wastes time/memory... way i'm looking for? edit: have created proto scheme , generate messages contain deltas not entirely serialized classes, believe using attributes/serializer class won't me. want write bytes directly 1 of buffers. believe memorystream, have read still point created byte array, still waste lot of time/memory. use memory stream using system; using system.collections.generic; using system.linq; using system.text; using system.xml; using system.xml.serialization; using system.io; namespace consoleapplication1 { class program { static void main(string[] args) { person person = new person(); xmls...

javascript - Failure to calculate the total monthly payment for a car loan. What's going wrong? -

updated code. calculate() still not working. monthly payment amount not being passed "total" id box. see underlying problem here? syntax seems correct, believe there may problem specification of each variable applied in code. i having problems getting function calculate() pass correct result in "total." possible solutions? action of clicking calculate button should display total, displaying nothing @ all, if button not activate calculate function @ all. <!doctype html> <html> <head> <script type="text/javascript"> function calculate() { var p = document.getelementbyid("price").value; var d = document.getelementbyid("dp").value; var r = document.getelementbyid("r").value; var n = document.getelementbyid("n").value; var = (r / 1200); var n = (n * 12); var m = ((p - d) * * math.pow(1 + i,n)) / (math.pow(1 + i,n) - 1); var result = document.getelementbyid('total'); result.v...

css - BootStrap Grid not working properly? -

Image
i've been working on website bootstrap , reason grid i've set isn't working. have website thats 2 columns, 1 column takes 4 grid spaces , other 8 spaces. once size of page reaches mobile, width of 8 grid picture screws up. here code <!doctype html> <!-- website template freewebsitetemplates.com --> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width; initial-scale=1.0"> <title>contact</title> <link rel="stylesheet" href="css/contact.css" type="text/css"> <link rel="stylesheet" href="bootstrap/css/bootstrap.css"> <style> .header{ padding:0;} .leftcol{ width:100%; height:800px; } .rightcol{ width:112.3%; height:...

Odd C error: Adding a print statement before a line makes it run, but it errors without it -

i'm writing basic tokenizer practice c, running odd error. doing wrong? this crashes: char* maketoken(char* string, char deliminator) { char* token; char* counter=token; char currentchar; string-=1; while((currentchar=*(string+=1))!=deliminator) { *counter=currentchar; counter++; } *counter='\0'; return token; } but runs fine: char* maketoken(char* string, char deliminator) { char* token; char* counter=token; char currentchar; string-=1; while((currentchar=*(string+=1))!=deliminator) { printf("making token\n"); *counter=currentchar; counter++; } *counter='\0'; return token; } both versions give error on machine. because of no garbage collection in c, second version seems work on machine. there several problems code here's working version char* maketoken(char* string, char delimiter) { //you need initialize token char* token=malloc(strlen(strin...

xcode - Class declaration cannot close over value 'fulfill' defined in outer scope - Swift 2.0 -

i'm trying convert app swift 1.2 swift 2.0 , i'm encountering following error: class b { func test() -> promise<a> { return promise<a> { (fulfill, reject) -> void in anotherpromise.then { _ -> void in return fulfill(a()) // class declaration cannot close on value 'fulfill' defined in outer scope } } } } how can make b (or then closure) capture fulfill properly? ps: promise comes promisekit , , i'm running xcode 7 beta 1. you should able workaround assigning fulfill local capture instead. class b { func test() -> promise<a> { return promise<a> { (fulfill, reject) -> void in let innerfulfill = fulfill // close on instead anotherpromise.then { _ -> void in return innerfulfill(a()) // class declaration cannot close on value 'fulfill' defined in outer scope } } ...

angularjs - Controller is not being reset after href call -

i have angularjs controller in ionic framework. .controller('locationdetailctrl', ['$scope','$cordovageolocation','$cordovacamera', '$cordovafile','$stateparams','location', locationdetailctrl]); function locationdetailctrl ($scope, $cordovageolocation, $cordovacamera, $cordovafile, $stateparams, location) { $scope.locationrow = {}; $scope.test = ""; $scope.images = []; location.getbyid($stateparams.locationid).then(function(result){ //alert("i'm in"); $scope.locationrow = result; }); } i have code in view somewhere this: <ion-item class="item-remove-animate item-icon-right" ng-repeat="location in locations" type="item-text-wrap" href="#/locations/{{location.id}}/all"> <h2>{{ location.aplicant_name}}</h2> <p>{{ location.form_type }}</p>...

Partition of Space for Android Studio -

i have 2 hard drive space: c , d. c lacking (small) saved android studio on d. however, when run emulator, says "lack of space", due saving onto c. thus, wondering how run android studio things on disk d, not c, appears automatic (or other possible fix). thanks! it's not android studio it's self. there 2 huge parts of development environment. android sdk (can grow few gb depends on how many components install) , ide cache (more 2 gb in case) described here both locations can changed - android sdk needs moved , android_home environmental variable needs set. cache location defined in ide's configuration .

javascript - Sinon spy with a Promise not being called -

the test (below) piece of code failing: module.exports = function(user, jwt) { 'use strict'; return function(req, res) { user.create(req.body) .then(function(id) { var token = jwt.sign({id: id}); res.json({token: token}); }); }; }; here test: 'use strict'; var chai = require('chai'); var sinon = require('sinon'); require('sinon-as-promised'); chai.should(); chai.use(require('sinon-chai')); describe('routes/signup', function() { var user; var request; var response; var jwt; var signup; beforeeach(function() { user = {create: sinon.stub()}; request = {body: 'body'}; response = {json: sinon.spy()}; jwt = {sign: sinon.stub().withargs({id:'id'}).returns('token')}; signup = require('../../../routes/signup')(user, jwt); }); it('returns token when resolving', function() { user.create.resolves('id'); si...

python - How can I change the string object inside a string object? -

i'm trying create mutable string object subclassing str ( unlike answer other question ). here's code far: class mstr(str): def __new__(self, s): self.s = list(s) return str.__new__(self, s) def __getitem__(self, index): return self.s[index] def __setitem__(self, index, value): self.s[index] = value def __eq__(self, other): return ''.join(self.s) == other def __ne__(self, other): return ''.join(self.s) != other def __lt__(self, other): return len(self.s) < len(other) def __gt__(self, other): return len(self.s) > len(other) def __le__(self, other): return len(self.s) <= len(other) def __ge__(self, other): return len(self.s) >= len(other) def __add__(self, other): return ''.join(self.s) + other def __mul__(self, other): return ''.join(self.s) * other def __hash__(self): ...

android - Determining the side of the road I'm travelling using GPS -

how proceed program side of road i'm travelling on in android(left side or right side). got street name , compass direction, don't need know how road placed whether north south or east west determine side i'm going on? basically, how should find orientation of road example : road placed on east-west axis , move towards east, device should tell me i'm on left side of road. the side of road on depends upon country in, regardless of direction being travelled. instance, in united states, on right side. in united kingdom, on left side. you should find country user in , determine traffic rules country, if side of road (supposed) on looking for.

php - upload image to server and saving url to server -

i building image uploader, upload image server , replacing old image url in database new one. upload part working perfectly, unable imageurl in database. can take @ code please , tell me i'm doing wrong? <?php $target_dir = "media/images/"; $target_file = $target_dir . basename($_files["filetoupload"]["name"]); $uploadok = 1; $imagefiletype = pathinfo($target_file, pathinfo_extension); // check if image file actual image or fake image if(isset($_post["uploadimage"])) { $check = getimagesize($_files["filetoupload"]["tmp_name"]); if ($check != false) { echo "file image - " .$check["mime"]. "."; $uploadok = 1; } else { echo "file not image"; $uploadok = 0; } } // check if file exists if (file_exists($target_file)) { echo "sorry file exists"; $uploadok = 0; } // check fle size if ($_files[...

dictionary - Is RiTa framework supporting Android? -

i'm english learner,and i'm using wordnet make dictionary app , know rita framework wordnet, on homepage http://rednoise.org/rita/index.html it's saying "now 1 api java, javascript, node, & android", download jar file rita-1.0.90.jar http://rednoise.org/rita/download/index.html , test in android studio, , it's not working,the in source code in rita.wordnet.jwnl.dictionary.file_manager.filemanager.java , find java.rmi.remote , on,we know android not support java.rmi.remote. i'm wondering rita supports android? if so, download? downloaded wrong page? reply or comments appreciated logcat in eclipse this: 06-14 02:15:44.960: i/dalvikvm(2081): failed resolving lrita/wordnet/jwnl/dictionary/file_manager/filemanager; interface 1431 'ljava/rmi/remote;' 06-14 02:15:44.960: w/dalvikvm(2081): link of class 'lrita/wordnet/jwnl/dictionary/file_manager/filemanager;' failed 06-14 02:15:44.970: i/dalvikvm(2081): failed resolving...

javascript - in the google-sheet script editor - Can't use subsrting function for a string in array -

in code function calls array , string, looks same begging in strings within array. it goes this: function tavnit(train, str) { f=0; i=0; while ((f==0) && (i<train.length)) { var trs=train[i]; if (str.substring(0,2)==trs.substring(0,2)) { f=1 } i++ } return f; } there no errors when saving, when running there - typeerror: cannot find function substring in object xxvxj. (line 7). why doesn't reconize string? , how should make recognize it? i found problem - when google sheet function using column argument - isn't simple array - matrix implemented array of arrays: [[tvg],[ttxv],[..],..] so if want call string, first need call array, , second first (and only) object in array - this way resolved it: function tavnit(train, str) { f=0; i=0; while ((f==0) && (i<train.length)) { line=train[i]; trs=line[0]; if (sametavnit(str, trs)==1) { return 1; } i+...

jQuery FadeOut FadeIn -

i messing html, css , jquery, , i've run in problem. have slideshow gets images using fadein , fadeout container, when press 'next', it's resetting page , loads next image somewhere @ bottom. can tell me what's problem? html <div class="slideshow "> <div class="container"> <div class="slides"> <img class ="slide active-slide" src="http://gearnuke.com/wp-content/uploads/2015/06/gta-5.jpg"> <img class ="slide" src="http://cdn.wegotthiscovered.com/wp-content/uploads/gta5.jpg"> <img class ="slide" src="http://www.igta5.com/images/official-artwork-trevor-yellow-jack-inn.jpg"> <img class="slide" src="http://cdn2.knowyourmobile.com/sites/knowyourmobilecom/files/styles/gallery_wide/public/0/67/gtav-gta5-michael-sweatshop-1280-2277432.jpg?itok=nkehentw"> </div> </div> <div class="container ...

How are Strings created and stored in Java? -

to understand how string objects created , stored, tried following program , see output against have query. can please help? package corejava.immutable; public class stringtester { public static void main(string[] args) { // todo auto-generated method stub string s1 = "omkar patkar"; string s2 = "omkar patkar"; string s3 = "omkar" + " patkar"; string s4 = "omkar"; string s5 = s4 +" patkar"; string s6 = new string("omkar patkar"); system.out.println("hashcode s1 = "+s1.hashcode()); system.out.println("hashcode s2 = "+s2.hashcode()); system.out.println("hashcode s3 = "+s3.hashcode()); system.out.println("hashcode s4 = "+s4.hashcode()); system.out.println("hashcode s5 = "+s5.hashcode()); system.out.println("hashcode s6 = "+s6.hashcode()); ...

sql - Postgres 9.4 jsonb array as table -

i have json array around 1000 elements of structure "oid: aaa, instance:bbb, value:ccc". {"_id": 37637070 , "data": [{"oid": "11.5.15.1.4", "value": "1", "instance": "1.1.4"} , {"oid": "11.5.15.1.9", "value": "17", "instance": "1.1.4"} , {"oid": "12.5.15.1.5", "value": "0.0.0.0", "instance": "0"}]} oid , instance unique per json array. if given option change structure have changed format key:value : {"11.5.15.1.4-1.1.4":"1", "11.5.15.1.9-1.1.4": "17", "12.5.15.1.5-0": "0.0.0.0"} however, if need stay old structure what fastest way specific oid array? what fastest way table 3 columns of oid , instance , value . or better pivot table oid+instance column header. for 2. tried follo...

xamarin - Connecting Python Backend to Android APP -

how use python backend android app built using c#? python backend written using flask framework. android app built using xamarin. no matter type of technology server or client use if can communicate each other using sort of standard "protocol". there many ways communicate both sides (client , server) sockets, xml, json, etc. need understand each other. in particular case suggest build rest or restful api ( https://flask-restful.readthedocs.org/en/0.3.3/ ) on server , rest client library on client. there many ways , libraries call rest apis c#: the built-in method using httpwebrequest can see on link : private async task<jsonvalue> fetchweatherasync (string url) { // create http web request using url: httpwebrequest request = (httpwebrequest)httpwebrequest.create (new uri (url)); request.contenttype = "application/json"; request.method = "get"; // send request server , wait response: using (webresponse ...

ssl - Bad MAC after porting OpenSSL 1.0.2 to ECOS -

we have openssl running on our embedded system, running ecos os . upgrading our openssl 1.0.2 version. have ported , compiled openssl library. when when try connect our device using ssl (via https), handshake fails bad record mac alert always. have enabled openssl debug option, unable identify why failing. have ported latest openssl code ecos? need take of special compilation flags latest openssl code ecos? for reference, here relevant part of ssl3_get_record : mac = rr->data + rr->length; i=s->method->ssl3_enc->mac(s,md,0 /* not send */); if (i < 0 || crypto_memcmp(md, mac, (size_t)mac_size) != 0) { al=ssl_ad_bad_record_mac; sslerr(ssl_f_ssl3_get_record,ssl_r_decryption_failed_or_bad_record_mac); goto f_err; } after debugging found random library ( rand ) failing ecos. there lot of places in openssl checks random_bytes return type. due failure, pre-master key decryption failing. , incoming packets not decrypted properly. hence ...

html - Centered logo in navigation bar -

ok have made naviagtion bar: html: http://pastebin.com/mgurej6l css: http://pastebin.com/va7b1dt6 i "unity code" in middle of navigation bar i've tried can't seem work. any help? well, in order make navigation in center of page need rope navigation in div add div class .rope , style .rope { display: flex; justify-content: center;} in code below: /*css navigation code*/ .rope { display: flex; justify-content: center; } .unity-code-logo { background-size: 100px 59px; width: 50px; height: 59px; position: absolute; top: 20px; left: 460px; } .main-navigation { display: inline; font-family: ubuntu; font-size: 15px; font-weight: bold; } .main-navigation ul { list-style: none; margin: 0; padding-left: 0; } .main-navigation li { color: #fff; background: #181818; display: block; float: left; margin: 0 2px 0 0; padding: 12px; position: relative; text-decoration: n...

excel - Sum row based on criteria across multiple columns -

i have googled hours, not being able find solution need/want. have excel sheet want sum values in 1 column based on criteria either 1 of 2 columns should have specific value in it. instance b c 1 4 20 7 2 5 100 3 3 100 21 4 4 15 21 4 5 21 24 8 i want sum values in c given @ least 1 of , b contains value of less or equal 20. let assume a1:a5 named a, b1:b5 named b, , c1:c5 named c (for simplicity). have tried: ={sumproduct(c,((a<=20)+(c<=20)))} which gives me rows both columns match summed twice, and ={sumproduct(c,((a<=20)*(c<=20)))} which gives me rows both columns match so far, have settled solution of adding column d lowest value of , b, bugs me can't formulas. any highly appreciated, in advance. have found when googling "multiple criteria same column" problem. your problem "summing twice" in formula ={sumproduct(c,((a<=20)+(c<=20)))} is due addition turning...

How can I push git-replace to a remote repo? -

i have used "git replace" substitute branch (with no common ancestor) 22b2b25 commit in master. want change permanent. i'm not interested in previous history. in output below top 5 commits original master branch , bottom 2 come different branch. when pushed new repository git-replace lost , old history reappeared. there way make change permanent? branch master looks below in original repo. want see in remote repo , subsequent clones. [mike@localhost canal_site]$ git log --oneline --decorate cdf0ae3 (head, origin/master, master) mm: sqlencode course name ad-hoc courses 2b57df5 mm: fixes changes far 7916eaf mm: ad hoc - more refactoring 1e00d22 mm: reformatted code e36cee1 factored out equal ops 22b2b25 (origin/prod20140313, prod20140313) initial load production 9-june-2015 08379cd initial inclusion of production files 9-june-2015 git replace alone isn't enough: replacing 1 commit isn't enough. the next commit must reference replaced commi...

sql server - Creating a Report with Multiple Paramters in SSRS -

if have sql server table 3 columns id int, date date, name varchar(max) my question assuming created 3 parameters @id , @date , @name if want make report table returns me data based on parameter provided , can done in 1 report ? or going have create 3 reports 3 parameters , each report filters data own parameter ? if possible done in 1 report , please provide me links check. yes can create report multiple parameters. hope links help. https://technet.microsoft.com/en-us/library/aa337396(v=sql.105).aspx https://msdn.microsoft.com/en-us/library/dn385719(v=sql.110).aspx and yes possible in 1 or more reports. have tried using multiple parameters on reports. can watch tutorials on youtube

jquery - Showing and hiding divs on click -

i have nav bar 3 menu points. called "home" "bildformate" , "kontakt". on load div class "home" displayed below navbar, displaying text etc. other 2 divs hidden. when click on "bildformate" want home div disappear , div class "formate" should visible. same goes div "kontakt". lets focus on "bildformate" div first. code right now: <script> $(document).ready(function(){ $('.bildformate').click(function() { // show , hide $('.home').hide(); $('.formate').show(); }); }); so when click "bildformate" works split of second. can see "home" div becoming invisible , "formate" div flahes second. looks before. why? css of 3 divs: .home { margin: 0 auto; margin-top: 30px; width: 60%; padding: 0px; background-color:#ededed; color: #787878; border-radius: 5px; } .formate { margin: 0 auto; margin-top: 30px; width: ...

properties - Gradle - Fails to show: org.gradle.java.home -

i thought simple thing. far i'm unable access string gradle job's java.home, official name: for example, see: org.gradle.java.home apparently can set value gradle.properties settings file. i've done , gradle output confirms this. for that, none of these print statements work... print "org.gradle.java.home = $org.gradle.java.home" print "org.gradle.java.home = "+ project.properties['org.gradle.java.home'] print "org.gradle.java.home = $gradle.java.home" print "${project.property('org.gradle.java.home')}" looking @ @ this question, have thought 1 of options tried yield result. how can access system level properties? only 2 options may work: print "org.gradle.java.home = "+ project.properties['org.gradle.java.home'] print "${project.property('org.gradle.java.home')}" and second fail since there's no checking if such property exists. gradle ...