Posts

Showing posts from February, 2012

VS 2015 c++ compile issue -

i have code snipped i've been using while create dynamic arrays, , stopped working. this meant create dynamic array without use of vector in c++ console applications. older programs have worked fine in past no longer compile while included though. int main() { int n = 5; allocatearray newarray(n); int *myarray = newarray.create(); delete[] myarray; return 0; } class allocatearray { private: int *newarray; int size; public: allocatearray(int); int* create() { return (newarray = new int[size]); } ~allocatearray() { delete newarray; } }; allocatearray::allocatearray(int n) { size = n; } with in header int* allocatearray(int n); this error log, can find whats happening? severity code description error c2065 'allocatearray': undeclared identifier error c2146 syntax error: missing ';' before identifier 'newarray' error c3861 'newarray': identifier ...

sql server - How to write a GET SQL Procedure? -

i'm trying make rest api in visual studio 2012 using asp.net mvc 4. so, right i'm trying make sql procedure , post methods. have little experience sql need help. ( using microsoft sql server management studio ) right i'm trying make procedure tells me values of every row's "a", "b", "c", , "d" columns. helpful method in api, plan loop through number of rows table has! the problem right sql won't accept select top @counter, accept select top 10 or actual number. how fix this? also, there easier way of doing i'm trying do? feel not efficient way write procedure simple api. create procedure gethotticketevent (@counter integer, @a bigint out, @b bigint out, @c varchar(500) out, @d int out) begin select top @counter mytable except select top @counter-1 mytable select top @counter b mytable except select top @counter-1 b mytable select top @counter c mytable except select top @counter-1 c mytable sel...

javascript - How to call custom directive on form submit -

i have custom directive works when once change input value when submit form without changing input field value directive not display error message. html code: <form name="myform" role="form" class="form-horizontal" method="post" novalidate> <div class="form-group"> <label class="control-label col-sm-3" for="firstname">first name :</label> <div class="col-sm-9"> <input name='firstname' class="form-control" type='text' required ng-model='name' string> </div> </div> <div class="form-group"> <input type="submit" value="submit" class="btn btn-success" /> </div> </form> directive : validationmodule.directive('string', function () { return { restrict: ...

sqlalchemy - Add table creation task to Flask-Admin model creation -

i'm still learning flask-admin. have field called table_name part of department model. when create new instance, value of table_name becomes row in department table. that's flask-admin designed do. want use form data i.e. value of table_name create table sqlalchemy. know how create table dynamically sqlalchemy. i'm wondering how incorporate flask-admin me. example: if type 'my_table' table_name field in flask admin form, new table called 'my_table' created in schema. how need this? thanks. you can override modelview's on_model_change , on_model_delete methods, called flask-admin right before commit ing changes: class tableconfig(modelview): def on_model_change(self, form, model, is_created): if is_created: sqlalchemy_create_table(model) def on_model_delete(self, model): sqlalchemy_drop)table(model) where sqlalchemy_create_table , sqlalchemy_drop_table custom methods create tables, using informatio...

jekyll - How to remove sponsored links from github pages' post footer -

Image
i have created blog github pages using jekyll . but below every post there sponsored links. how remove them. thanks guys help. add site in disqus admin. create shortname site in settings >>general. uncheck discovery in settings >>general. change disqus short_name in _config.yml .

Admob Unable to request for new Pin due to disable all option -

Image
trying new pin request unfortunatelry disable , cannot able anything. not getting error message nor warning admob via mail. have correct mail address on saturday , after updating screen i'll getting. check below image this seen in account. i resolved using adsence. please try login using adsence , find option generating new pin there. in adsence follow menu same following in admob.

How to show a message when focus on a view in android app -

Image
my code is...... <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="com.example.user.designingapp.capcustomize"> <item android:id="@+id/navigate" android:orderincategory="300" android:title="user" android:icon="@drawable/back" app:showasaction="ifroom"/> <item android:id="@+id/share" android:orderincategory="300" android:title="use" android:icon="@drawable/share" app:showasaction="ifroom"/> i want when bring cursor on these 2 item's image .there should show message name of items in above image... you can use popupwindow in android achieve this. here example . if want menu items or want use menu xml, can use popupmenu have v7 compatibilit...

sql - MS Access query: between two numbers -

this isn't simple sounds. have scenario enter number text field form, want press button search number close (or exact) number. if leave field blank want return results. i (very) new sql , access i'm having bit of trouble. know how find exact value: like "*" & [forms]![navigation form]![navigationsubform].[form]![txtfuelconsumption] & "*" (my textbox called txtfuelconsumption) an example of want returned: say type in number "10" textbox , run query. want show me data entries fuel consumption rate of 7 13. i tried using between function, not wrap head around it. thankyou! edit: thought of approach take. create standalone combo box values "small, medium, large" , use query assign specific values 'small, medium , large'. although, again, not know how this. i've put here suggestion in case people can't figure out first problem. edit: select [car table].car_vin, [car table].car_class, [car tab...

c++ - back and forward edges in directed graph -

i new graph theory. writing code find forward , edges in directed graph. searched , implemented code below. code going infinite loop. please have look. greateful you. void dfsvisit(u) { u->color="gray"; u->time=count; count++; for(every child node v of u) { if(v->color == "black") { if(u->time < v->time) cout<<"edge "<<u<<"->"<<v<<" forward edge"<<endl; else cout<<"edge "<<u<<"->"<<v<<" cross edge"<<endl; } if(v->color == "gray") cout<<"edge "<<u<<"->"<<v<<" edge"<<endl; if(v->color == "white") cout<<"e...

angularjs - Angular javascript array is empty? -

angular javascript array empty? have array of checkboxes databound angular scoped list need check few checkboxes , send bind them second angular scoped array: my html: <tr ng-repeat="item in pageditems[currentpage]" ng-controller="dealercommaintainctrl"> <td align="center"> <input type="checkbox" id="{{item.idarticle}}" ng-value="item.idarticle" ng-checked="selected.indexof(item.idarticle) > -1" ng-click="toggleselect(item.idarticle)" /> </td> <td> <a href="/dealercoms/articledownload?filename={{item.filename}}&idarticle={{item.idarticle}}" class="btn btn-xs btn-total-red btn-label"><i class="ti ti-download"></i></a> </td> <td>{{item.datearticle | date:'dd/mm/yyyy'}}</td> <td>{{item.title}}</td> ...

vb.net - Loading a report with Sub reports with Same RecordSelectionFormula -

im trying load crystal report file reporta.rpt 2 subreports a-1.rpt , a-2.rpt . crystalreportviewer1.refreshreport() rptdocument1.load(system.appdomain.currentdomain.basedirectory & "reporta.rpt") rptdocument1.recordselectionformula = "{tbl_pv.pv_num}= 'pv2015-09-004'" rptdocument2.load(system.appdomain.currentdomain.basedirectory & "a-1.rpt") rptdocument2.recordselectionformula = "{tbl_pv.pv_num}= 'pv2015-09-004'" rptdocument.load(system.appdomain.currentdomain.basedirectory & "a-2.rpt") rptdocument.recordselectionformula = "{tbl_pv.pv_num}= 'pv2015-09-004'" crystalreportviewer1.reportsource = rptdocument im loading 2 subreports 2 separate reportdocument . loading main report file rerporta crystalreportviewer1 im getting wrong records database. im new working subreports.

Bidirectional Messaging Queue -

this seems question belonging faq, cannot phrase question find answered. anyway, investigating message queues (glossed on zeromq, rabbitmq tutorials) , think mqs fit nicely transformational dataflow - listen on q1 messages in format f1, transform f2 , put transformed message on q2. natural question arises of happens if transformation inherently bidirectional , there no defined consumer , producer, e.g. yaml<->json converter? as far understand message queues inherently unidirectional , bidirectional messaging see 2 "solutions": have 2 distinct input output queues, translates 4 in example: json.in, json.out, yaml.in, yaml.out; connect converter both ends of json queue, distinguish between raw json , converted yaml, wrap messages in messages specifying whether incoming or outgoing message. consequence, converter gets ton of messages has parse , reinsert queue - sounds hellishly inefficient. former solution sounds way go, unless latter delegated mq broker in f...

Search an Oracle table in PHP -

i've written page tries search oracle database. can't see i've gone wrong. can't result display, despite changing query "select * table book_name="..." (guaranteed return result). $query = "select * books book_name = 'my life'"; $dbuser = "username..."; $dbpass = "password..."; $db = "ssid"; $connect = oci_connect($dbuser, $dbpass, $db); if (!$connect) { echo "an error occurred connecting database"; exit; } $stmt = oci_parse($connect, $query); if(!$stmt) { echo "an error occurred in parsing sql string.\n"; exit; } oci_execute($stmt); ?> html... <?php while(oci_fetch_array($stmt)) { $fg1 = oci_result($stmt,"book_name"); echo ($fg1); $fg2 = oci_result($stmt,"author"); echo ($fg2); $fg3 = oci_result($stmt,"price"); echo ($fg3); $fg4 = oci_result($stmt,"image_location"); echo ("<b...

iFrame's https content blocking Jquery code on page to run in IE8. Do you any have ideas? -

i asked question code not working iframe yesterday. i found out, problem wasn't frame, loaded content - adding https src="" caused jquery stop running after searching time, became clear should not mix simple http page https content. do how solve problem. don't have server. local page accessing local page (which actully server https login page , have local access it). don't know how add ssl sertificate or make page https. if have ideas please help...

php - Top NAV not showing in Magento -

i installed fresh magento community version 1.9.2.1 localhost. added new category (beverages) , added new product (pepsi). assigned pepsi beverages @ front end, top nav not showing. i'm new magento. can me out? i'll grateful. please make sure following things is active = yes include in navigation = yes it must sub category of default category otherwise not able see it clear magento cache let me know if still facing problem thanks

file get contents - file_get_contents: get full response (PHP) -

i'm using following code post information url. $query = http_build_query($myvars); $options = array( 'http' => array( 'header' => "content-type: application/x-www-form-urlencoded\r\n". "content-length: ".strlen($query)."\r\n". "user-agent:myagent/1.0\r\n", 'method' => "post", 'content' => $query, ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); is possible show complete header information of response. first used curl, took cpu. curl used following option: curl_setopt($ch, curlopt_header, 1); and received following header information: http/1.1 100 continue http/1.1 200 ok date: mon, 21 sep 2015 07:06:35 gmt server: apache/2.4.7 (ubuntu) x-powered-by: php/5.5.9-1ubuntu4.11 content-description: file transfer...

Calculate Time Difference of two consecutive rows in one column of a table in SQL Server -

i have query table1 ____________________________________________________________________ uniqueid ticketnumber action date -------------------------------------------------------------------- 1 123456 dependency occured 3/25/2015 7:40:39 2 123456 tech support requested 3/25/2015 10:00:47 3 123456 tech support given 3/25/2015 11:30:40 4 123456 dependency occured 3/25/2015 02:30:40 pm 5 123456 tech support given 3/25/2015 03:30:40 pm here same ticketnumber there various actions performed @ given time. have find total time ' dependency occured '. date of action, dependency occurred has subtracted row below it, have calculate total time dependency has occurred. 1st row - 2nd row gives 2 hrs 20 mins. , 4th row - 5th row gives 1 hour. total dependency occurred 3 hrs 20 mins. thanks in advance. assuming use sql server 2012 ...

javascript - How can I make my Select Box Match the size of other text elements in Bootstrap 2.1.1? -

i want make select box have same size text boxes above. see in bootply you can find select box smaller other 2 input fields. want them have same size. i using bootstrap 2.1.1. you need give box-sizing:border-box css property select box: .form-signin-signup select { margin-bottom: 15px; box-sizing: border-box; } with cross browser support: .form-signin-signup select { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } check bootply mdn doc some css tricks

angularjs - how to push all values from the txt file to local storage using angular js -

i have sample application can store values local storage when user clicks local button want values txt file in local storage "note2": [] . plunker demo to put data in localstorage in angularjs can use library angular-localforage . example: angular.module('yourmodule', ['localforagemodule']) .controller('yourctrl', ['$scope', '$localforage', function($scope,$localforage) { $localforage.setitem('myname','olivier combe').then(function() { $localforage.getitem('myname').then(function(data) { var myname = data; }); }); }]);

java - MySQL Commands into .DBF Tables -

i writing database system in java writes , reads mysql database hosted on xampp. system , running using mysql commands select, update, add, delete etc. the issue using old database written in visual foxpro has tables stored .dbf files. rather taking few years working system , moving on mysql system @ once, have both systems working concurrently gradually more people beginning move on , use mysql system. this having issues. there way both update mysql table , .dbf file when job added through java program? simple using mysql command directly modify file? understand there possibilities in python or php have never learnt either of these languages , prefer easier solution. trying keep 2 databases in synch bad idea. if miss , data no longer matches, how know right? (a man 1 clock knows time is; man 2 never sure.) if existing system complex enough, maybe consider moving 1 module @ time. if existing system well-written, might possible switch work mysql without effort. said...

swift2 - cannot invoke reduce with an argument list of type swift 2.0 -

when upgrade swift 1.2 swift 2.0 following error occurs cannot invoke reduce argument list of type here code let escaped = reduce(string, "") { string, character in string + (character == mark ? "\(mark)\(mark)" : "\(character)") can me how solve problem reduce() method collections such arrays have call on list of characters can access using characters property of string, not on whole string itself: let escaped = string.characters.reduce("") { string, character in string + (character == mark ? "\(mark)\(mark)" : "\(character)") }

ios8 - System font for both iOS 8 and iOS 9 -

i want support both ios 8 , ios 9 systems app. , maybe ios 7. know, system font ios 7 , 8 helvetica neue. in ios 9 system font san-francisco. , if don't set helvetica font explicitly via [uifont fontwithname:@"helveticaneue" size:15]; , use [uifont systemfontofsize:15]; , you'll helvetica ios 7 , 8 , san-francisco ios 9 automatically. , it's great! interface builder's labels , buttons can set thin, ultra thin, medium etc. system fonts. great too. how can set these thin, ultra, medium system fonts in code, programmatically? need create category fork ios 9 , previous ios? use + systemfontofsize:weight: . it's available ios 8 , above. for ios 7, interface builder settings work, , code need create uifontdescriptor appropriate weight.

c# - Parallel.ForEach over AuthorizationRuleCollection -

hopefully point out doing wrong here. have process reads in file access rules , trying run in parallel. here code have far: public list<folderaccessrule> getsecuritygroupsforfolder(long importid, string subdirectory, bool includeinherited) { concurrentqueue<folderaccessrule> groups = new concurrentqueue<folderaccessrule>(); concurrentqueue<exception> exceptions = new concurrentqueue<exception>(); directoryinfo dinfo = new directoryinfo(subdirectory); directorysecurity dsecurity = dinfo.getaccesscontrol(); authorizationrulecollection authorizationrulecollection = dsecurity.getaccessrules(true, includeinherited, typeof(ntaccount)); parallel.foreach( authorizationrulecollection, fsar => { try { folderaccessrule group = this.getgroup(fsar); if (group != null) { ...

c - Gnu-Make fails to include a makefile -

from docs : the include directive tells make suspend reading current makefile , read 1 or more other makefiles before continuing. directive line in makefile looks this: include filenames... filenames can contain shell file name patterns. now, given makefile: # define 'include' command-line. ifdef include # create included makefile $(shell echo 'all : ;' >makefile.include) # , include it. # docs say: "filenames can contain shell file name patterns." include *.include else endif running, get: $ rm -rf makefile.include && make include=1 makefile:6: *.include: no such file or directory so, happened here? had: created makefile included, in: $(shell echo 'all : ;' >makefile.include) and later included makefile, given can using "shell file name patterns", quoted above documentation - , thus, have in makefile: include *.include so, why did gnu-make failed find newly-created mak...

javascript - Behaviors of JQuery sortable and draggable -

i have 2 draggable objects 'field' , 'container' , sortable object 'ui-main'. want drag 2 above objects 'ui-main', , allow add objects 'container', creating nested sortable form. here demo: https://jsfiddle.net/tblaziken/a2qbnygb/1/ the javascript far: $('.ui-select .ui-select-item').draggable({ revert : "invalid", helper: 'clone', connecttosortable : '.ui-sortable' }); $( ".ui-sortable" ).sortable({ connectwith: '.ui-sortable', placeholder: 'ui-hovering' }); the problem can add or move new object ui-main , 2 existed ui-container objects, unable newly created ui-container . makes existed , newly created ones different , how fix it? for me in jsfiddle works expected. however, use clone helper, not give full control on happens when clone. jquery's clone() function expects 2 parameters. .clone( [withdataandevents ] [, deepwithdataandevents ]...

android - Local Notification in ionic framework -

Image
i developing android music app in ionic framework gaana.com or saavn . if song playing 1 notification should appear (shown in image) image, buttons or song details . problem is, don't have idea how bring it. shall need use cordova local notification plugin ? if use how add buttons , button events? , 1 large image? followed docs didn't add buttons. (or missing something?) if cordova local notification not solution should use? i want add feature like: user can't close notification. if song stopped notification gets automatically closed. possible ? may question very silly.. stucked.

functional programming - How to deal with global, mutable configuration variables (or files) in FP? -

in complex program, in trying apply functional programming patterns whenever can, 1 problem many config files loaded , become global variables accessible everywhere in program. approach leads entanglement. how should handle config files in functional programming style? modelling configuration variables function seems reasonable me. inferes function impure , dependant on state, namely config file.

c# - creating form inside webforms.aspx -

i newbie asp.net webform. how create form inside asp.net webform page .i tried create follow not working <form id="form1" runat="server"> <div> <form name="user_detail"> </form> </div> </form> you can remove the <form name="user_detail"> </form> you can name main form user_detail

which minimap should I use with custom image in leaflet -

i'm using leafletjs custom large image serving tiles local server. i need display minimap shows visible on screen, best use in these circumstances? is there available in leafletjs or need use plugin or build custom one? i saw 1 seems kind of specific using map: https://github.com/norkart/leaflet-minimap

console - Is there any new version of Weinre? -

i searching similar project or new version of weinre has latest dev tools console. need timeline , profiling current version of weinre not have lot of tools. so, there new version of weinre? sorry, there isn't version of weinre profiling, because that's weinre can't do. if you're not aware, there modern versions of browser debugging tools available various mobile platforms. i've placed links them here: http://people.apache.org/~pmuellr/weinre/docs/latest/

c# - Search DataGridView using search query and like operator -

i want search name in datagridview using search query , like operator. public static dataset searchitems(string key) { string cmd = @"select lt.ledgerid,la.ledgername ledgertranscationinfo lt join ledgeraccreation la on lt.ledgerid = la.ledgerid; la.ledgername concat('" + key.trim() + "','%') ;"; dataset ds = mysql_helper.getdataset(commandtype.text, cmd, "ledgeraccreation"); return ds; } it show error while searching text. please give me proper solution text search.

javascript - When I click any button in my view page the form is submitted -

hi using codeigniter in view page have abutton add table row dynamically , have form submit button. when click add button form gets submitted. how stop form submitting when add button clicked , how make form submit when actual submit button clicked. <html> <head> <meta charset="utf-8"> <link href="<?php echo base_url(); ?>assets/css/elfanto_css.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>assets/css/style.css" rel="stylesheet"> <link href="<?php echo base_url(); ?>assets/css/demo.css" rel="stylesheet"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <script type='text/javascript' src='//code.jquery.com/jquery-compat-git.js'></scri...

java - How to commit consumer offsets using Camel-kafka? -

i using apache camel integerate kafka messaging. using java dsl consume messages kafka endpoint. using apache kafka api's known how commit consumer offsets given properties toggling. if disbale auto commit in camel-kafka component how can commit offsets in apcahe camel then? i using below endpoint disable auto commit in apache camel kafka.consumer.uri = kafka://{{kafka.host}}?zookeeperhost={{zookeeper.host}}&zookeeperport={{zookeeper.port}}&groupid={{kafka.consumergroupid}}&topic={{kafka.topic.transformer_t}}&{{kafka.uri.options}} kafka.uri.options = autocommitenable=false

jquery - Easyresponsivetab is not working with MVC5 -

working site - http://184.106.114.93/origolo/website/help.html same html when integrated mvc5 throws error - "typeerror: $(...).easyresponsivetabs not function" mvc5 integrated - http://184.106.114.93/origolo/home/help the issue says $(...).easyresponsivetabs not function , it's because in http://184.106.114.93/origolo/home/help can not find files: <script src="/origolo/js/jquery-1.9.1.min.js" type="text/javascript"></script> <script type="text/javascript" src="/origolo/js/easyresponsivetabs.js"></script> make sure it's pointing right place, because browser says error 404 not found tha files.

Upload a prebuilt file to Crashlytics -

i trying automate our build/release process. concerned android app @ moment, may need extend similar support our ios app. until now, uploads crashlytics have been triggered crashlyticsuploaddistributionrelease. building , testing apk first, looking upload same pre-built apk crashlytics. new process means need way of uploading apk crashlytics directly, without having dependencies on rebuilding or being within project's directory. i can see can through android studio dragging , dropping apk. there command line tool or script can use automate similar our build machine? this operation not supported. see comment above response crashlytics team

Can I use the C# preprocessor to skip Kinect v2.0 code? -

quick question, i'm developing small program i'd work kinect versions 1 , 2. there preprocessor command can use c# compiler skips kinect v2.0 code if don't have kinect 2.0 sdk installed? (when i'm working on windows 7 example). basically, this: #if kinect1 // ... kinect1 specifict code #endif #if kinect2 // ... kinect2 specific code #endif of course, have define symbols manually , there no builtin capability in compiler or framework detect version available, if @ all. you might able detect installed kinect sdk (version) using msbuild. example, specific registry keys, paths on local drives and/or set environment variables , set symbols inside project files. for example, include following fragment on top of .csproj file (or put separate file <import> ). <propertygroup condition="exists('c:\program files\...\whatever\v1.0')"> <defineconstants>kinect1;$(defineconstants)</defineconstants> </pr...

sql - Convert NULL value to blank string in SSIS -

Image
as title says i'm trying convert null values empty strings. i'm using following code: isnull((dt_wstr,10,1252)[serial no.])?"" : (dt_wstr,10,1252)[serial no.] it returns: i've tried several similar solutions above, returns same. update: why need this. got 4 columns (serial no. included), need combine 1 column, done in derived column: ((dt_str,150,1252)([col1]) + (dt_str,150,1252)([col2]) + (dt_str,150,1252)([serial no.]) + (dt_str,150,1252)(col4)) in case 1 of these null, combined : null. therefore can't used in lookup next step. i think issue type cast inside isnull() statement: try this. (dt_str, 150, 1252) (isnull([serial no.]) ? "" : [serial no.]) if doesn't work, try no casting statements @ all: (isnull([serial no.]) ? "" : [serial no.])

javascript - Require a directory in ES6 -

i've seen several es6 code examples directory being required, this: import * things '../some_directory' where some_directory directory, not regular file. appears in case some_directory/index.js ends getting required. is case? documented?

Python: Button widget in Tkinter -

i have begun gui programming in python 2.7 tkinter. i want have button browse , when clicked opens windows file explorer , returns path of file selected variable. wish use path later. i following code given here . outputs window displaying 5 buttons, buttons nothing. on clicking first button, doesn't open selected file. likewise, on clicking second button, askopenfilename(self) function called , should return filename. mentioned, need filename later. how value returned function variable future use? there no point in using return inside callback button. won't return anywhere. way make callback save data store in global variable, or instance variable if use classes. def fetchpath(): global filename filename = tkfiledialog.askopenfilename(initialdir = 'e:') fwiw (and unrelated question): you're making common mistake. in python, when foo=bar().baz() , foo takes value in baz() . thus, when this: button = button(...).pack() button ...

UI view frame not refreshing in UItableview ios -

i trying set frame uiview @ runtime frame not updating reason. cgrect newframe = cell.candidatespollprogress.frame; float c = [[dcandidatespollprogress objectatindex:indexpath.row]floatvalue]; newframe.size.width = (c/100)*120; newframe.size.height = 8; [cell.candidatespollprogress setframe:newframe]; cell.candidatespollprogress.backgroundcolor = [uicolor bluecolor]; i debugged , frame contains actual values not being updated.any ideas? if used autolayout it's did't work. have update constraints below change constraints value using take custom cell & provide iboutlet view custom cell class header file @property (strong, nonatomic) iboutlet nslayoutconstraint *viewheight_constraint; in cell row or action below cell.viewheight_constraint.constant = 40.0; //value [cell.contentview setneedsupdateconstraints]; [cell.contentview layoutifneeded];

python server-client nat traversal -

i've done reading on udp nat traversal, , i'm reasonably confident understand basics i'm still struggling implementation. my project has globally accessible server, , clients behind nat. game, basic join_game request send client server, , server sends out updates every interval. i've been testing @ home, , forgotten have dmz on router turned on worked fine. sent friends test , cannot receive updates server. here current methodology, packets udp: client opens socket, , sends join request server. server gets request , reply-to address of message, , replies client: yes can join, , way sending updates reply-to ip/port looks this. client catches reply closes socket, , starts udp threaded listener class listen reply-to port server told about. client catches server updates flooded over, , processes them required. every , client opens new socket , sends udp packet update server (what keys pressed etc). my understanding reply-to address server receives should ha...

ssl - Signing / Verifying HTTPS Responses -

is possible verify response originated website? for example, it's trivially easy forge screenshot of website - can make politician tweeted awful. twitter's website protected https - means responses encrypted. signed? is possible signed https response out of server can prove / verify served data? for example, can wget or curl https://twitter.com/barackobama/status/645299508897714176 , back response can use prove twitter served content? (i can't see relevant wget -s or curl -iv --raw ) an https response is signed. unless ask them not to, curl , wget verify certificate chain. chain must end certificate of authority computer trust. authority certify certificate valid, , wget/curl has verify certificate correspond domain name. thus, owner of private key of certificate can encrypt/decrypt data. with "curl -v " can see more informations tls authentication.

javascript - Regex For Letters/Numbers combination -

trying come regex capture groups ab1234 or ba2321 . need capture starts ab or ba , followed 4 digits. currently, have this, seems not take numbers account (ab|ba)\d{4} may want: \b((?:ab|ba)\d{4})\b letters + digits in group 1

android - How do I propagate changes from my main strings.xml to localized copies? -

i created localized copy of strings.xml , translated strings. however, went main strings.xml make changes. there easy way propagate changes downstream translated xml files without losing translation? android studio 1.3.2 thanks in advance help! e.g. original strings.xml <string name="order_summary_name">"name: "</string> original zh/strings.xml <string name="order_summary_name">"名字: "</string> modified strings.xml <!-- name order summary. shown in format of "name: amy" amy user's name. [char limit=none] --> <string name="order_summary_name">name: <xliff:g id="ordername" example="amy">%s</xliff:g></string> edit: @bdr looks there's no first party android studio method propagate localization changes downstream. suggestion. the way i've done keep track of strings in separate spreadsheet, , generate strings....

php - Display error message from Admin_Controller -

i had create core/admin_controller.php , created page controller when run page controller there error displaying "fatal error: class 'admin_controller' not found in d:\xampp\htdocs\myproject\application\controllers\admin\page.php on line 4" class admin_controller extends my_controller { function __construct() { parent::__construct(); } } page controller defined('basepath') or exit('no direct script access allowed'); class page extends admin_controller { public function __construct() { parent::__construct(); $this->load->model('admin_m'); $this->load->model('page_m'); } public function index(){ $data['title'] = 'press release'; $data['page'] = $this->page_m->show_list(); $this->load->view(theme_dir_admin.'common/admin_header'); $this->load->view(theme_d...

cordova - when trying to debug I get: Unable to Attach. The system could not find specified file -

after doing update 2 visual studios 2015 tools apache cordova, when trying debug get: unable attach. system not find specified file. on ripple , emulator. i've uninstalled , reinstalled, ran repairs, nothing works, running july rtm community version, not rollback that. i've read couple other answers 2013, did not or apply. also if know can july 2015 release, go , install that, know update 2? installing typescript vs 2015 https://www.microsoft.com/en-us/download/details.aspx?id=48593 solved issue me.

javascript - To count length of each word in sentence by using jQuery ,and send the largest word's length -

this question has answer here: find longest word in string? 7 answers function findlongestword(str) { var length = 0; var j; var newstr = str.split(" "); for(var = 0;i<15;i++){ var lentemp = newstr[i].length(); if( lentemp >length){ length === lentemp ; } } return length ; }; findlongestword("the quick brown fox jumped on lazy dog"); i want result length of word largest? i'm new jquery. can me sort this?i'm learning jquery , can't proceed further without finishing this. you using === comparison operator need assignment operator = . use = instead of === . so line length === lentemp ; should length = lentemp ; also 1 more thing length not function in javascript can't use length() remove braces , use .length . this complete snippet: fun...

Android gridview with dotted/dashed separator -

Image
i have design layout having gridview dashed/dotted separator. can please let me know how can it? this question may resemble another question asked here in stackoverflow , it's different because: a] need dotted line b] dotted line shouldn't touch edge of cell can't done based on answer given @ question . you can try below code: drawable/ dotted_shape.xml : <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <stroke android:color="#c7b299" android:dashwidth="15px" android:dashgap="15px" android:width="2dp"/> </shape> this give dotted line separator. thanks.

ios - How to merge a user signed up by facebook with an exising user signed up with the same email -

i using parse in ios app , there 2 ways of signup, either using email/password or facebook login. the problem happen when user sign using email/password logout , try sign using facebook account have same email. i using [pffacebookutils logininbackgroundwithreadpermissions:block: signup facebook creates new user object in users table in parse now have 2 records same user , can not update record has facebook information user email because parse not allow duplicate emails so should best solution solve problem? update i have used @kriz solution login using plain facebook code either create new user or link user facebook data - (void)loginwithfacebookwithsuccesscallback:(apisuccesscallback)successcallback andfailurecallback:(apifailurecallback)failurecallback { // login pfuser using facebook nsarray *permissionsarray = @[@"public_profile", @"email"]; fbsdkloginmanager *login = [[fbsdkloginmanager alloc] init]; ...

visual c++ - error C2664: 'int LSexecuteScriptLng(void *,const char *) -

// salam001dlg.cpp : implementation file // #include "stdafx.h" #include "salam001.h" #include "salam001dlg.h" #include "dlgproxy.h" #include "afxdialogex.h" #ifdef _debug #define new debug_new #endif // csalam001dlg dialog implement_dynamic(csalam001dlg, cdialogex); csalam001dlg::csalam001dlg(cwnd* pparent /*=null*/) : cdialogex(csalam001dlg::idd, pparent) { m_hicon = afxgetapp()->loadicon(idr_mainframe); m_pautoproxy = null; } csalam001dlg::~csalam001dlg() { // if there automation proxy dialog, set // pointer dialog null, knows // dialog has been deleted. if (m_pautoproxy != null) m_pautoproxy->m_pdialog = null; } void csalam001dlg::dodataexchange(cdataexchange* pdx) { cdialogex::dodataexchange(pdx); } begin_message_map(csalam001dlg, cdialogex) on_wm_close() on_wm_paint() on_wm_querydragicon() end_message_map() // csalam001dlg message handlers bool csalam001d...

php - combine two different queries into one -

i have following query: select distinct id, title ((select distinct offers.id id, offers.title title offers inner join categories on offers.category=categories.title categories.title="fashion clothes" group offers.id order offers.id) union (select distinct offers.id id, offers.title title offers inner join cities on offers.city=cities.title cities.title="australia" group offers.id order offers.id)) subquery i fetch table offers rows have category=fashion clothes , city=australia when use union returns rows . don't know how make work. if can appreciate it. you don't need union this. join tables , have both conditions in clause: select distinct offers.id id, offers.title title offers inner join categories on offers.category=categories.title inner join cities on offers.city=cities.title categories.title="fashion clothes" , cities...

exe - GDAL compile using pyinstaller (ImportError: DLL load failed: The specified module could not be found.) -

Image
i'm hoping can me debug following error message pyinstall. i'm trying compile script exe , have been dealing hidden modules days, i've come across new error message seems missing .dll file. problem is, can't tell 1 causing problem. hoping experienced in compiling can assist me in debugging error message. looking @ traceback, 'scipy.interpolate' , 'scipy.linalg' seem important. however, have included them in .spec file pyinstall , not change output. the script uses gdal , have therefore included gdal111.dll, geos_c.dll in build folder. i have run script through dependency walker don't know doing or for. here screenshot of dlls. maybe it's not obvious me, don't python ones. # installing zipimport hook import zipimport # builtin # installed zipimport hook import marshal # builtin import _struct # builtin import nt # builtin import imp # builtin import zlib # builtin import errno # builtin import _weakref # builtin import _codecs ...

Cakephp 3.0.x: helpers for errors -

in error layout ( src/template/layout/error.ctp ) i'm trying use custom helper, see cakephp loads automatically html , form helpers. how load other/custom helpers in case of error? thanks.

c++ - Vector, iterators and const_iterator -

i have started learning vectors , iterators. can't understand 2 things. why can change constant iterator , role of "*"? #include <iostream> #include <string> #include <vector> using namespace std; int main() { vector<string> inventory; inventory.push_back("inventory1"); inventory.push_back("inventory2"); inventory.push_back("inventory3"); vector<string>::iterator myiterator; vector<string>::const_iterator iter; cout << "your items:\n"; (iter = inventory.begin(); iter != inventory.end(); iter++) { cout << *iter << endl; } when iter = inventory.begin() makes iter refer first string in vector. iter++ moves refer next string. in output use *iter way access string iter refers to. in first output inventory1 . the slight confusion constness vector<string>::const_iterator iter; is iterator refers things c...