Posts

Showing posts from February, 2010

model view controller - How do you use the MVC paradigm in PHP with ADODB as your DAL? -

model view controller - How do you use the MVC paradigm in PHP with ADODB as your DAL? - no orm. know have php 5+ , adodb. two, how can utilize mvc? cannot utilize other frameworks , i"m not asking build scratch (i want learn!). how start off here? know how mix things incorrectly classic asp style. don't know how do, on very basic level mvc. had model adodb , sql, how go "model" view? or how phone call controller since don't have orm call? can give me concrete? hoping basis of future cms. thanks there nil magical mvc. it's purpose split user interface interaction 3 distinct roles. of import separation between model , presentation layer. presentation layer consists of controller (handles , delegates request ui model) , view (renders model data). your model core application. layered itself, instance info access layer (your adodb stuff), domain model , service layer. how organize model application want build. of import thing m...

json - How to get String value from json_decode in php -

json - How to get String value from json_decode in php - my json-data follows - [{"name": "ram"}] what want value of name in variable e.g., $fname . have tried - <?php $jsondata = '[{"name": "ram"}]'; //$obj = json_decode($jsondata); $obj = json_decode($jsondata,true); print_r($obj); // line outputs :- array ( [0] => array ( [name] => ram ) ) //what need value of key print_r($obj['name']); foreach ($obj $k=>$v){ echo $v; } ?> but unable desired output. here how value <?php $jsondata = '[{"name": "ram"}]'; $obj = json_decode($jsondata,true); //in case have multiple array foreach ($obj $k){ echo $k['name']; } //else $obj[0]['name']; //if $jsondata = '{"name": "ram"}'; $obj = json_decode($jsondata,true); //use echo $obj['name']; ?> php json

javascript - Video poster reset when mouseleave the div -

javascript - Video poster reset when mouseleave the div - hey i'm working on preview event when hover on div. when user mouseleave want html poster element reset. updated link html <div class="story-panel-wrapper" id=""> <div class="row"> <div class="col l7 m6 s12"> <div class="stories"> <span class="story-description">hello world</span> <div class="video"> <div class="videoslate"> <div class="video-container"> <video class="thevideo" width="978" poster="img/emily-poster.jpg" loop> <source src="videos/emily.mp4" type="video/mp4"> browser not back upwards video tag. </video> </div> <...

How to put characters in a text file into an array in C programming -

How to put characters in a text file into an array in C programming - i have project done , maze game. to set field , have used const char random_field[15][20]={ "####################", "#...#.....#.....#.?#", "#.#.#.....#.#.....##", "#.#.#####.#.#.######", "#.#.#.......#.#.####", "#.#.###.#######.####", "#.#................#", "#.####...#####.###.#", "#.#....####..#.###.#", "#.#.#........#.#...#", "#.#.####..####.#.###", "#.#....#.....#.#...#", "#.######.#####.###.#", "#..................#", "####################" }; and works ! but want alter thought little bit .. i want write map text file , declare 2d array , prepare map in txt file array.. i have wrote doesn't work.. const char random_field[15][20] ; file *filename; filename=fopen("map1.txt","r"); (i = 0; < 15; i++) { (j = 0;...

Error while running Linker #contiki #iar -

Error while running Linker #contiki #iar - i'm starting utilize of contiki operating scheme stm32f4 ,and need compile contiki project iar embedded workbench but next error: error[ms003]: not open file "contiki-mist-spirit1-f4.log" writing error while running linker iar contiki

ios - Video Too Long to Send -- But it isn't -

ios - Video Too Long to Send -- But it isn't - i allowing capture of live video in app of set maximum duration of 30 seconds. when 30 seconds reached app correctly stops recording , gives message max beingness reached. good. however, @ bottom shows message says "video long send.. please select smaller clip video". of course of study isn't true , video sent fine. message confusing user (given incorrect) , 1 time again programmatically controlling video length. live video , not user has selected existing library. why message showing , there way rid of it? -(void)imagefromcamera:(nsstring *)mediatype { self.mediapicker = [[uiimagepickercontroller alloc]init]; if ([mediatype isequaltostring:@"camera"] || [mediatype isequaltostring:@"video"]) self.mediapicker.sourcetype = uiimagepickercontrollersourcetypecamera; else self.mediapicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; if ([mediatype isequalto...

wpf - wrong bitmap after scale with renderOptions -

wpf - wrong bitmap after scale with renderOptions - in dialog, need scale bitmap in cell of datagrid avoid bluring here myfile.xaml <datagridtemplatecolumn.celltemplate> <datatemplate> <image margin="1" width="90" height="18" verticalalignment="center" stretch="fill" renderoptions.bitmapscalingmode="nearestneighbor" renderoptions.edgemode="aliased" snapstodevicepixels="true" horizontalalignment="center"> <image.source> <multibinding converter="{staticresource hatc...

java - Jackson custom serialization getter -

java - Jackson custom serialization getter - let's have pojo like: public class user { private long id; private string username; // usual getters , setters .... // serialisation purposes public string getupperusername() { homecoming this.id % 2 == 0 ? username : username.touppercase(); } } i create conditional serializer serialises different value actual 1 if conditions satisfied. i looked @ @jsongetter apparently it's deprecated, @jsonproperty doesn't seem work. do have idea? thank in advance :) you seek write custom serializer implementing jsonserializer , using @jsonserialize then: http://www.baeldung.com/jackson-custom-serialization seems overkill. also, if acceptable, seek set logic of getupperusername() in usual getter. ps: unusual @jsonproperty not work, match here. java json jackson

javascript - Ajax Start Event Firing after return from Controller -

javascript - Ajax Start Event Firing after return from Controller - im trying show progressbar when page doing ajax request. i creating dialog dynamically image within , show on ajaxstart event. problem when create ajax phone call ajax start fires after homecoming controller . $(document).on('ajaxstart',function(){ alert('x'); $.openloading(); //method creating dialog , image }); in case alert called immediately. there not dialog created but if write same code this $(document).on('ajaxstart',function(){ console.log('x'); $.openloading(); //method creating dialog , image }); then in console x printed after returning controller action , still dialog not created. if run $.openloading() in console works fine expected. please allow me know doing wrong?? alert() stops interaction browser until message dismissed , press ok button. while console.log() prints message console. javascript jquery aj...

PHP + HTML HOTEL FORM -

PHP + HTML HOTEL FORM - html <form name="contactform" method="post" action="send_form_email.php"> <table width="450px"> <tr> <td valign="top" "> <label for="first_name ">first name *</label> </td> <td valign="top"> <input type="text" name="first_name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="last_name">last name *</label> </td> <td valign="top "> <input type="text " name="last_name " maxlength="50 " size="30 "> </td> </tr> <tr> <td valign="top "> <label for="email ">email addr...

angularjs - "TypeError: createController is not a function in" jasmine test -

angularjs - "TypeError: createController is not a function in" jasmine test - new jasmine tests. sorry if dumb question. i'm trying simple unit test of controller's existence in angularjs code, , can't on error. it's silly i'm sure. i've looked on stackoverflow, , tried many different things based on similar error not avail. maintain getting error. here's app.js angular.module('waldo', ['ui.router']) .config(['$stateprovider','$urlrouterprovider',function($stateprovider,$urlrouterprovider){ $stateprovider .state('home', { url: '/home', templateurl: '/home.html', controller: 'maincontroller' }) .state('posts', { url: '/posts/{id}', templateurl: '/posts.html', controller: 'postscontroller' ...

jquery - How to reload jqxGrid data with new data from another url -

jquery - How to reload jqxGrid data with new data from another url - i have jqxgrid form jqwidgets library , have bound info jqxgrid so.. var url = "getconsignments.php?type="+$('#selectisdelevered').val(); var consignmentsource = { datafields: [ { name: 'consignmentid', type: 'string' } ,{ name: 'name' , type: 'string' } ], id: 'consignmentid', datatype: "json", async: false, cache:false, url: url , filter: function() { // update grid , send request server. $("#jqxgrid").jqxgrid('updatebounddata', 'filter'); }, sort: function() { // update grid , send request server. $("#jqxgrid").jqxgrid('updatebounddata', 'sort'); ...

Use CSS variables with rgba for gradient transparency -

Use CSS variables with rgba for gradient transparency - is there way utilize css variables when specifying gradient colors transparency, e.g. :root { --accent-color: #dfd0a5; } h1{ background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(red(var(--accent-color)), green(var(--accent-color)), blue(var(--accent-color)), 1)); } you can utilize variables, can't sample individual red, greenish , bluish components single hex value in css. if want utilize variables rgba() , need specify variable each color component decimal value, , reference each variable within rgba() function so: :root { --accent-red: 223; --accent-green: 208; --accent-blue: 165; } h1 { background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(var(--accent-red), var(--accent-green), var(--accent-blue), 1)); } alternatively, can specify entire rgba() value single variable, although need include alpha in case: :root { --accent-color: rgba(223, 208, 165, ...

linux - Monitor clipboard change if done by specific process? -

linux - Monitor clipboard change if done by specific process? - i'd script listens see if clipboard has been changed, but when modified specific process, , perform commands xdotool <something> based on it. standard clipboard managers linux monitor clipboard alter per se, not sure whether it's possible determine , deed on alter when it's done 'x process' (maybe another, specific clipboard manager), or not. is possible? i don't mind if it's hacky, clunky or bloaty - framework on how done or tool can it. linux unix monitoring clipboard x11

c# - How to store the classes in the respective folders in Windows application? -

c# - How to store the classes in the respective folders in Windows application? - i trying create folder in project manage code there seems problem: namespace windowsformsapplication1.deepak.connect { class clas1 { } } but don't find folder in main folder( windowsformsapplication1 ) want create so, solution problem? in visual studio, click show files icon in solution explorer. right click folder , click include in project c#

SQL Injection and Codeigniter -

SQL Injection and Codeigniter - some doubts regarding codeigniter , input handling capabilities. may little weird doubts none-the-less. if utilize active record class functions in codeigniter, input prevented against sql injection? i read somewhere does, don't understand how? or why? also xssclean deal sql injection in way? is input prevented against sql injection? not ‘automatically’, provide parameterised queries. codeigniter or no, should utilize parameterised queries in preference query string hacking whenever possible. $bof= "a'b"; $zot= 'a\b'; // insecure! don't this! // $this->db->query("select foo bar bof='$bof' , zot='$zot'"); // secure annoying write // $this->db->query("select foo bar bof='".$this->db->escape($bof)."' , zot='".$this->db->escape($zot)."'"); // want // $this->db->query('select foo bar bof=? , zot...

css - Multiple attributes in ng-style -

css - Multiple attributes in ng-style - i need have multiple raw style attributes : $scope.css = "'width': 'calc(100% - "+$scope.fixedcolumnswidth+"'),'margin-left':'"+ $scope.fixedcolumnswidth+"'"; <div ng-style="{css}"> this not working. works when use <div style="{{css}}"> but not ie. ng-style waits object literal, need adjust code to $scope.css = { width: 'calc(100% -'+$scope.fixedcolumnswidth+')', 'margin-left': $scope.fixedcolumnswidth } <div ng-style="css"></div> css angularjs ng-style

c# - LINQ to SQL or some other option -

c# - LINQ to SQL or some other option - i have linq sql classes single tables in database (ie, dragged , dropped table sql server object browser dbml design layout window). considering filtering table when fill view model observable collection so: (commented out, idea): class observabledocuments : viewablecollection<document> { public observabledocuments(dataclasses1datacontext datadc) { foreach (document doc in datadc.documents)//.where(x => x.jobid == 1)) { this.add(doc); } } } i wondering if optimal way handle filtering. linq sql wait until phone call before querying database, or entire table still pulled in datacontext.documents table, , adding ones want observablecollection? if latter, there improve way in linq sql filter results, or should move away framework? using linq sql means applying linq operators on iqueryable<t> added sql statement instead of using ienumerable<t> applies operato...

python - Tkinter listbox that scrolls with arrow keys -

python - Tkinter listbox that scrolls with arrow keys - i'm trying listbox have first object highlighted (which happens self.e1.select_set(0) . trying scroll through listbox highlighting next item downwards when hitting downwards arrow, or select next item hitting arrow. thought binding no luck. ideas? def body(self, master): self.e1 = tk.listbox(master, selectmode=tk.single, height = 3, exportselection=0) self.e1.insert(tk.end, "1") self.e1.insert(tk.end, "2") self.e1.grid(row=0, column=1) self.e1.select_set(0) self.e1.bind("<down>", self.onentrydown) self.e1.bind("<up>", self.onentryup) def onentrydown(self, event): self.e1.yview_scroll(1, "units") def onentryup(self, event): self.e1.yview_scroll(-1, "units") thanks! as name says, yview_scroll changes view, not selection. like select first object select_set(0) , can utilize select_set s...

Azure AD Graph API - Getting token on iOS/Android -

Azure AD Graph API - Getting token on iOS/Android - i able access graph api using .net native client. means end-user redirected dialog page requires him sign-in, , access token allows me query graph. meanwhile i'm trying implement same on ios , android. find information saying that's possible, cannot find sample code or documentation on how it. any help appreciated. for acquiring token, have checked out azure advertisement code samples page ? there ios , android samples demonstrate adal/oauth. android ios objective-c azure office365

Sending SMS from Twilio doesnt show friendly name on phone -

Sending SMS from Twilio doesnt show friendly name on phone - when send test sms https://www.twilio.com/user/account/developer-tools/api-explorer/message-create predefined friendly name, doesnt apear on phone. see number. -if isnt possible, know other providers function work? twilio developer evangelist here. you're absolutely right, friendly name defined in business relationship uses , not intended appear in place of number when sending sms. have few reasons this, might interesting depending on utilize case. i don't have particular company can recommend allow this. google search might help though. sms twilio user-friendly

r - dplyr and checking previous 24-60 months for observations -

r - dplyr and checking previous 24-60 months for observations - i have bunch of unique cusip codes(unique id) , need check create sure there 24-60 previous month observations, not sure how check dplyr reproducible illustration : tdata <- structure(list(cusip = c(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2), fyear = c("1971", "1971", "1971", "1971", "1971", "1971", "1971", "1971", "1971", "1971", "1971", "1971", "1972", "1972", "1972", "1972", "1972", "1972", "1972", "1972", "1972", "1972", "1972", "1972", "1972", "1973", "1973", "1973", "1973", ...

Google Maps API how to add current traffic conditions on routes -

Google Maps API how to add current traffic conditions on routes - any help great give thanks in advance. i have code display main route , alternative route, i'm trying display traffic conditions of route example: if go maps , directions show reddish or yellowish lines on route. determined traffic conditions. there way show traffic conditions on map? i know theirs traffic status service, shows traffic of area. need traffic on route. my code var lontlatobejct = sharedproperties.getstring(); var myoptions = { zoom: 10, center: new google.maps.latlng(lontlatobejct.strloclatitude, lontlatobejct.strloclongitude), maptypeid: google.maps.maptypeid.roadmap, maptypecontrol: false }; var mapobject = new google.maps.map(document.getelementbyid("divmap"), myoptions); var mapcanvas = document.getelementbyid('divmap'); var start = document.getelementbyid('t...

Can not save data via wysiwyg field in RefineryCMS form (Rails 4) -

Can not save data via wysiwyg field in RefineryCMS form (Rails 4) - ruby 2.0 rails 4.1 we using newest version of refinerycms. we added new extension. trying add together wysiwyg field called "final_comments". created database migration , ran it. in database records like: id: 5 user_id: 16 program_id: 1 created_at: 2015-04-09 20:17:00 completed_at: 2015-04-09 21:15:00 is_active: 0 certificate_id: null position: null updated_at: 2015-04-09 21:25:46 is_completed: 0 final_comments: null i add together form: <%= render '/refinery/admin/wysiwyg', :f => f, :fields => [:final_comments], :object => "enrollments/enrollment" -%> i html: <div class='field'> <div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'> <ul id='page_parts'> <li class='ui-state-default ui-state-ac...

objective c - NSDictionary Search -

objective c - NSDictionary Search - my nsdictionary retrieving first array in dictionary. have no thought why behaving way. here search //loop through datadictionary origin , destination (nsmutabledictionary *floors in [mapdata allfloors]){ //check if found set roomlisttxt , defaultimage dictionary values if ([floors[origin] isequaltostring:origin] && [floors[destination] isequaltostring:destination]) { searchresults.roomlisttxt = floors[destination_rooms]; searchresults.defaultimage = floors[map_image]; [self.navigationcontroller pushviewcontroller:searchresults animated:yes]; //break; } else { uialertview *alert = [[uialertview alloc] initwithtitle:@"oops!!" message:@"working add together more routes." delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil]; [alert show]; break; } } here definition of di...

javascript - How can I copy a block on one page to another page retaining css stylings? -

javascript - How can I copy a block on one page to another page retaining css stylings? - say i've got 2 pages javascript can talk each other, via homecoming value of window.open(), or window.opener. pages can (and typically will) have different css rules. i pick arbitrary node in dom heirachy of 1 page (say, div element). insert clone of other document, @ arbitrary (but legal) location in hierarchy. now want create css rules maintain looking similar on new page. prefer minimal number of properties on css rules. can doing kind of comparing of styles , computed styles on dom elements of both documents? help if remove classes elements temporarily, or otherwise modify them, can computed styles on elements "default" styles, , compare that? http://jsfiddle.net/1ruvsqw1/1/ var e = document.getelementsbyclassname('test')[0], div = e.clonenode(true), newstyles = getcomputedstyle(e); document.body.appendchild(div); var existingstyles = getc...

reactjs - How can we use react jsx templates in node-webkit -

reactjs - How can we use react jsx templates in node-webkit - i'm having troubles using react's jsx templates in node-webkit. basic problem boils downwards this; using next code react.createclass({ render:function(){ homecoming <h1>hello flux</h1> } }); will have node-webkit telling me uncaught syntaxerror: unexpected token < i have been searching , did not find satisfying solution. best thing came with, compiling jsx-based files proper js , storing them in separate directory (using gulp). solution annoys me means requiring files technically not there. what other solutions there? you can utilize node-jsx require .jsx files , parse them appropriately. most simply, require , install so: require('node-jsx').install({extension: '.jsx'}) and future files require .jsx extension parsed. reactjs gulp node-webkit nw.js

ios - How to loop over data in a UITableView in Swift -

ios - How to loop over data in a UITableView in Swift - i’m using alamofire library http request. i know how loop in plain text field: for alternative in json["options"] { allow opts = json["options"]["is_selected"].string if json["options"][ctr]["is_selected"] == 1 { if json["options"][ctr]["id"] == "8" { self.emailswitch.on = true self.unameswitch.on = true } } println(json["options"][ctr]["id"]) ctr++ } but how do in table view? you can iterate on uitableview this: for section in 0..<tableview.numberofsections() { row in 0..<tableview.numberofrowsinsection(section) { allow indexpath = nsindexpath(forrow: row, insection: section) var cell = tableview.cellforrowatindexpath(indexpath) // want cell } } ios uitableview swift loops foreach

.net - How are applications run on multi-core machines? -

.net - How are applications run on multi-core machines? - i'm trying gain improve understanding of how multi-core processors work , how programmer can take advantage of them. let's have standard .net console app. doesn't multithreading. run on 1 of cores? if core run on , same 1 everytime? now let's have console app spins bunch of threads internally. threads divided amongst available cores or all run on same core the initial thread on , have special utilize other available ones? the relationship between cores, threads, processes, , classes can complicated one. more when start considering how code may not have written (e.g. .net framework itself) scheduled run. the simplistic reply unless specifically write console application utilize multiple threads, run on single core. now, there .net framework classes behind scenes may utilize multiple threads, in case process may utilize more 1 core then. much of bcl doesn't utilize threads, frameworks ...

matlab - Are there any keyboard shortcuts for formatting in Python? -

matlab - Are there any keyboard shortcuts for formatting in Python? - after write code in matlab can utilize ctrl+a+ctrl+i , ctrl+a+ctrl+j format our code (comments, loops alignment etc). there similar or helpful keyboard shortcuts in python? also, can utilize upward arrow re-create our previous command window history in matlab, possible or keyboard shortcut in python? thanks! python programming language, not integrated development environment (ide), hence has no "keyboard shortcuts" or like. each given development environment may offer different facilities or like. appear consider gnu readline (typically used in simple text-mode interpreter environment many python executables bundle) "part of python" -- that's misconception; readline general library interactive input in command-line environments, , python 1 of many programs using it. environment bundled python idle , gui one, , of course of study editing facilities , drastically diffe...

php - Mediawiki skin creation - Javascripts don't get loaded -

php - Mediawiki skin creation - Javascripts don't get loaded - trying new skin mediawiki. css files loading, not javascript files. in script.js file, have simple alert statement, nil happens when page gets loaded. newskin.php file: <?php if( !defined( 'mediawiki' ) ) { die( 'this skin mediawiki bundle , cannot run standalone.' ); } $wgextensioncredits['skin'][] = array( 'path' => __file__, 'name' => 'newskin', 'url' => 'http://exmaple.com/', 'version' => '1.2-alpha', 'author' => array( 'author name', ), 'descriptionmsg' => 'newskin-desc' ); $wgvalidskinnames['newskin'] = 'newskin'; $wgautoloadclasses['skinnewskin'] = __dir__ . '/newskin.skin.php'; $wgmessagesdirs['skinnewskin'] = __dir__ . '/i18n';...

jquery - How to keep grid width if colums are switched in column menu -

jquery - How to keep grid width if colums are switched in column menu - jqgrid has fixed width. i tried code below based on how alter column name in column chooser pop in jqgrid? to create column switcher. after turning column on or off grid width changes total screen. how prepare grid keeps width after column seelcton in column menu ? <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>http://stackoverflow.com/q/27617764/315935</title> <meta name="author" content="oleg kiriljuk"> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/redmond/jquery-ui.css"> <link rel="stylesheet" href="http://net...

laravel 5 double validation and request -

laravel 5 double validation and request - i did validation , works: public function salvar(createequipamento $vequip, createlocalizacao $vlocal) { $this->equipamento->create($vequip->all()); $equipamento = $this->equipamento->create($input); homecoming redirect()->route('equipamento.index'); } what want lastly created equipment id , include in array validate , create local validation ( createlocalizacao $vlocal ) because i've 2 tables, 1 equipment , 1 stores places equipment in. $input['equipamento_id'] = $equipamento->id; $this->localizacao->create($vlocal->all()); how this?? thx in advance ! i "workarround" solution ;) $localizacao = [ 'equipamento_id' => $id, 'centrocusto_id' => $input['centrocusto_id'], 'projeto' => $input['projeto'], 'data_movim...

ssl - UnrecoverableKeyException when sending mails with Jenkins -

ssl - UnrecoverableKeyException when sending mails with Jenkins - i setting mail service plugin jenkins @ company intern at. want utilize ssl have ssl else use. when seek send email using certificate, next exception: javax.mail.messagingexception: not connect smtp host: omitted.omitted.omitted, port: 587; nested exception is: java.net.socketexception: java.security.nosuchalgorithmexception: error constructing implementation (algorithm: default, provider: sunjsse, class: sun.security.ssl.sslcontextimpl$defaultsslcontext) scrolling downwards find: caused by: java.security.unrecoverablekeyexception: password must not null @ sun.security.provider.javakeystore.enginegetkey(unknown source) @ sun.security.provider.javakeystore$jks.enginegetkey(unknown source) @ java.security.keystore.getkey(unknown source) @ sun.security.ssl.sunx509keymanagerimpl.<init>(unknown source) @ sun.security.ssl.keymanagerfactoryimpl$sunx509.engineinit(unknown...

linux - Decrypt SSL Data in wireshark -

linux - Decrypt SSL Data in wireshark - in tutorials saw in web, pointed me add together key file in edit->prefereces->protocols->ssl->ssl key file but there no such ssl key file in version use. can guide how decrypt ssl traffic in wireshark 1.12.4 ? it not depend on version of wireshark, on ssl lib compiled against. in order utilize it, need have wireshark compiled using gnutls rather openssl or bsafe. linux ubuntu wireshark

Android softkeyboard not triggerring -

Android softkeyboard not triggerring - i have multiple edittext on screen , 1 of them focussed. softkeyboard not trigger screen pops up. want soft keyboard trigger screen pops up. works if don't implement onfocuschangelistener(). need onfocuschangelistener() observe edittext focused. have tried setting setfocusable(true) , setfocusableintouchmode(true). don't want modify android:windowsoftinputmode property in androidmenifest.xml. have next criteria : onfocuschangelistener implemented (to observe edittext focused) no modifications in androidmenifest.xml here code snippet final inputmethodmanager inputmethodmanager = (inputmethodmanager) getcontext().getsystemservice(context.input_method_service); minput.setonfocuschangelistener(new onfocuschangelistener() { @override public void onfocuschange(view view, boolean hasfocus) { misfocused = hasfocus; if(hasfocus) inputmethodmanager.showsoftinput(minput, i...

Android Lollipop system icons in Android Studio -

Android Lollipop system icons in Android Studio - how android lollipop scheme icons in android studio utilize in app? strictly working on lollipop , whenever seek , android:icon="@android/drawable/... old kit kat era icons. want icons referred on page here. stuff this: edit: found neat little plugin available android studio. created reply question. help others in future looking same. after more digging found great solution. not quite built in great alternative , didn't find 100% definitive reply on here i'll create post future people. so there plugin android studio called android drawable importer man named marc prengemann allow import whichever icons lollipop scheme icons, given download them first. to download them go here , can download, available on github. but, plugin offers ability download them. choice. so plugin go to: windows: file > settings > plugins > browse repositories mac: android studio > preferences > plugi...

binary - Is it possible in python to pack a set of integers in non-byte increments? -

binary - Is it possible in python to pack a set of integers in non-byte increments? - let's have 3 unsigned integers, a , b , , c , , know maximum values of each. both a , b less 214, , c less 24. since 14 + 14 + 4 = 32 , should able store these 3 integers in 32 bits, right? if so, how can in python? struct.pack appears back upwards byte-sized registers, limited 'hhb', 40 bits (8 more need). can done, or missing fundamental concepts here? pack bit operators: (a<<18)|(b<<4)|c then utilize struct.pack on 32-bit result. python binary

gradle - Creating a static global varible that I can increment in subprojects -

gradle - Creating a static global varible that I can increment in subprojects - i have project many sub-projects. in parent project need define variable port . each time subproject executes particular task, need increment port (thereby ensuring port number never used twice run in --parallel). how do this? update clarity so project construction this parent - |->sub-project-1 | |->sub-project-2 the parent project should define initial port number. project.ext.portnumber = 4200 //set global port number somehow in each sub-project want utilize port number project.portnumber++; //increment in way println "${project.name} using port: ${project.portnumber}" so running gradlew build on parent project output: sub-project-1 using port: 4201 sub-project-2 using port: 4202 if run gradlew build while within parent/sub-project-2 get sub-project-2 using port: 4201 as each project builds need portnumber stat...

unit testing - Rails test: test image_tag on view -

unit testing - Rails test: test image_tag on view - i'm writing view tests , want test image: <%= image_tag "icon.png", class: "img-responsive" %> so made test, not working: it 'app logo' render assert_select 'img.img-responsive[src=?]', asset_path('icon.png') end it works if utilize following, think not right way of doing it: it 'app logo' render assert_select 'img.img-responsive[src=?]', '/assets/icon.png' end what problem? right why test rspec? try using capybara: page.should have_selector(:xpath, xpath_of_the_image_element) ruby-on-rails unit-testing view rspec

How to pass Datagridview value to the Dataview in SharePoint? -

How to pass Datagridview value to the Dataview in SharePoint? - i have created 1 connectable web-part in have taken 2 webparts i.e. provider , consumer. in sending info table provider consumer , in consumer have bind info table grid view. so want add together gird view dataview in sharepoint webpart. sharepoint-2013

javascript - WebStorm - debugger terminates a process on breakpoints. Process finished with exit code -1073741510 -

javascript - WebStorm - debugger terminates a process on breakpoints. Process finished with exit code -1073741510 - today, webstorm began behave strangely. when stop on breakpoint - process falls. occurs @ breakpoint. work nodejs javascript. i tried record gif, quality bad (sorry that), can imagine problem if @ gif. can see here: debugger catched breakpoint, process stop. @ bottom of webstorm written: "process finished exit code -1073741510 (0xc000013a: interrupted ctrl+c)". everything works yesterday, can wrong? problem occurs because of 1 of old watched expression. delete , debugger works again. javascript debugging intellij-idea webstorm

c++ - g++ linking a static library error -

c++ - g++ linking a static library error - i'm relatively new c++ , i'm used working in visual studio 2013 environment. need utilize library in project i'm working on: https://github.com/s3rvac/cpp-bencoding my first question is: matter if build library in visual studio or gcc (mingw-w64)? anyway, built using gcc (4.9.2) since author did in instructions on github. got no errors , produced library called libbencoding.a now want link lib-file own project. stuck. created simple hello world programme (main.cpp). location of libbencoding.a in folder c:\...\cpp-bencoding\build\src g++ main.cpp -l "c:\...\cpp-bencoding\build\src" -l libbencoding -o foo.exe -std=c++11 however produces error message: c:/program files (x86)/mingw-w64/i686-4.9.2-posix-dwarf-rt_v4-rev2/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llibbencoding collect2.exe: error: ld returned 1 exit status i appreciate help here....

ocaml - Map a subset of a polymorphic variant -

ocaml - Map a subset of a polymorphic variant - i want apply function values within variant, result of function has same type input. how can create types work out? here's current attempt: module t : sig type generic = [ `foo of int | `bar of int ] val map : (int -> int) -> ([< generic] 'a) -> 'a (* val : [`foo of int] *) end = struct type generic = [ `foo of int | `bar of int ] allow map fn = function | `foo x -> `foo (fn x) | `bar x -> `bar (fn x) allow map : (int -> int) -> ([< generic] 'a) -> 'a = obj.magic map (* allow : [`foo of int] = `foo 1 |> map succ allow b : [`bar of int] = `bar 1 |> map succ *) end this works as-is, if uncomment let a line get: values not match: val map : (int -> int) -> [ `foo of int ] -> [ `foo of int ] not included in val map : (int -> int) -> ([< generic ] 'a) -> 'a it seems defining a ...

string - Ruby Hash bug help! -

string - Ruby Hash bug help! - i'm trying create ruby hash of objects, keys object @name member: # m object @name instance variable (a string) myhash = {} myhash[m.name] = m it's giving error: #<typeerror: can't convert string integer> anyone know why? i'm sure m.name valid string... does irb illustration help? > class myclass > attr_reader :name > def initialize > @name = "myname" > end > end => nil > m = myclass.new => #<myclass:0x47c3e0 @name="myname"> > puts m.name myname => nil > myhash = {} => {} > myhash[m.name] = m => #<myclass:0x47c3e0 @name="myname"> > puts myhash.inspect {"myname"=>#<myclass:0x47c3e0 @name="myname">} => nil notice attr_reader :name creates getter method name. ruby string hash integer typeerror

gdi+ - How do applications like Firefox calculate text height efficiently? -

gdi+ - How do applications like Firefox calculate text height efficiently? - i'm curious technique fast applications (maybe safari improve illustration here) calculate height of terribly long page of text (for example, chat log or huge document). considering there huge amount of text same line height, can multiplied number of lines. however, how know how many lines <p> span in specific width? what can come they: calculate width of every character , store quick addition, use calculate width of words, add words , spaces' widths while comparing block-level width, adding lines needed. this seems indeed fast, since additions , comparisons way, way faster measuring string in gdi+. have no thought if done, since reliability comes first, , afaik text rendering introduces kerning, , have no thought how easy or hard info gdi+. also, a screenshot reactos made me believe firefox calculates each letter's size , position. text gdi+ measurement kerning