Posts

Showing posts from July, 2011

Python Selenium: How to let human interaction in a automated script? -

i working on script shows captcha , few other stuff in pop window. writing script firefox. possible feed values , on hitting submit button script resume operations? guess, kind of infinite loop? you wait submit button clicked user: from selenium import webdriver selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec # load page driver.get("https://www.google.com/recaptcha/api2/demo") # submit button bt_submit = driver.find_element_by_css_selector("[type=submit]") # wait user click submit button (check every 1s 1000s timeout) webdriverwait(driver, timeout=1000, poll_frequency=1) \ .until(ec.staleness_of(bt_submit)) print "submitted"

wpf - Best way to achieve custom ui layout in Visual Studio (c#) -

Image
i have simple layout what best way achieve this? using wpf or win forms custom list view? you use wpf styles , templates . please notice there difference between controltemplates , datatemplates, though can use either 1 given goal, in different ways.

javascript - Angularjs need ng-model update before ng-change -

i create customdirective , want ng-model update before ng-change fire. ng-change fire before udpate ng-mdoel value below code. main issue coming when change page number in dropdown list. alert previous value. think ng-mdoel update after ng-change fire. want ng-model fire before ng-change. app.directive('bottompagination', function () { var directive = { templateurl: '/app/common/directives/bottompagination.html', restrict: 'a', replace: true, scope: { currentpage: '=', changepagesize: '&' } }; return directive; }); //here html directive (/app/common/directives/bottompagination.html) <select id="pagesizeddl" ng-model="pagesize" ng-change="changepagesize()"> <option>5</option> <option>10</option> <option...

jain sip - sip stack implementatin outside the servlet container -

i want know if it's possible implement sip stack outside servlet container , interact between them interface. want have sip transactions , dialogs first part , can host servlet inside servlet container tomcat. whenever sip request comes, first part receives it, parses it, sip transaction , dialog created, servlet , application should invoked chosen , the message sent servlet container through interface. servlet hosted in servlet container invoked , creates response. response goes first part , sent destination. any idea how accomplish stack?

haskell - Data.List.iterate lazy evaluation not happening -

i'm having above function, when call it, gets stuck, data.list.iterate evaluates without stopping. rp:: randomgen g => g -> ([int], g) rp g = (map (\x -> (last (fst x))) lst , snd (next g)) lst = (data.list.iterate id ([1], g_second)) (g_first, g_second) = (split g) why happend? thank you! while i'm not sure you're trying achieve function, reason doesn't stop because you're mapping on infinite list , giving no reason to stop. the infinite list originates in use of iterate : lst = (data.list.iterate id ([1], g_second)) what you've done there create infinite list contains infinite number of tuple value ([1], g_second) . seems logic error - list of tuple has no variation; every element same, infinity. clear, list building looks this: [([1], g_second), ([1], g_second), ([1], g_second), ([1], g_second)...] g_second unchanging , never gets reason evaluate, is, in essence, discarded. if use take or t...

angularjs - Yeoman 'grunt test' fails on clean project with 'port already in use' -

with: mac os 10.8.4 node 0.10.12 npm 1.3.1 grunt-cli 0.1.9 yo 1.0.0-rc.1 bower 0.9.2 generator-angular@0.3.0 i encounter following error clean yo angular project, followed grunt server grunt test : running "connect:test" (connect) task fatal error: port 9000 in use process. i'm new yeoman , stumped. i've deleted original project , created new 1 in fresh folder make sure wasn't overlooking invisible configs. restarted machine make sure wasn't running temporary server processes had forgotten about. after attempts, basic server starts fine, attaches chrome, , watcher updates browser on changes. (notably, server running on 9000, seems odd test-runner trying use 9000.) same error on attempting start test runner. is can fix, or issue should report yeoman team? thanks. add port: 9001 test, this: test: { options: { port: 9001, ... } }

numpy - How to generate PWM using python -

Image
i using python codes generate pwm signal in using vectorization method.but still facing issues.could me in this. import numpy np import matplotlib.pyplot plt percent=input('enter percentage:'); timeperiod=input('enter time period:'); cycles=input('enter number of cycles:'); y=1; x=np.linspace(0,cycles*timeperiod,0.01); t=(percent/100)*timeperiod; n in range(0,cycles): y[(n*timeperiod < x) & (x < n*timeperiod+t)] = 1; y[(n*timeperiod+t < x)& (x < (n+1)*timeperiod)] = 0; plt.plot(y) plt.grid() end a vectorized solution : percent=30.0 timeperiod=1.0 cycles=10 dt=0.01 t=np.arange(0,cycles*timeperiod,dt); pwm= t%timeperiod<timeperiod*percent/100 plot(t,pwm) above speed (100x loop version here), numpy docs : vectorized code more concise , easier read fewer lines of code means fewer bugs the code more closely resembles standard mathematical notation (making easier, typically, correctly ...

java - How to use a different class from an application's activity? -

i created java file in same package main activity class named sup . now, need use class in main activity file. mainactivity.java: package com.example.phy.myapplication; import android.support.v7.app.appcompatactivity; import android.os.bundle; public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } sup mola = new sup(this); mola.as(); } sup.java: package com.example.phy.myapplication; import android.content.context; import android.widget.toast; public class sup { public sup(context context){ charsequence text = "hello toast!"; int duration = toast.length_short; toast toast = toast.maketext(context, text, duration); toast.show(); } void as(context context){ charsequence text = "as method"; int duration = toast...

python - PyQt: Modifying Widget Object from another Function -

i making multi-page application in pyqt4, whenever user specific action (clicking button example) there update in widgets. for example, there 5 widgets , 1 button: 3 widgets hidden, 2 widgets shown. whenever click button, hide 2 widgets, , show 3. so in code, should this: # startup def somefunc(self): widget1 = qtgui.qlabel("widget1", self) widget2 = qtgui.qlabel("widget2", self) widget3 = qtgui.qlabel("widget3", self) widget4 = qtgui.qlabel("widget4", self) widget5 = qtgui.qlabel("widget5", self) widget1.sethidden() widget2.sethidden() widget3.sethidden() widget4.show() widget5.show() btn = qtgui.qpushbutton("click", self) btn.clicked.connect(self.someotherfunc) # question: (code down below doesn't work, it's example) def someotherfunc(self): self.somefunc.widget1.show() self.somefunc....

css - Absolute Position Element Within Centered Div -

i have div centered using auto margins. 900px wide. have login button want position above it, can't figure out how left , right stays in constant place relative div. want inside right edge of div. first set centered div position relative #centered-div{position: relative; width: 900px; margin: auto;} then set login button position absolute #login{position: absolute; left: 0; top: 50px;}

Disable Samsung Hacks on Standard Android Styles and Themes -

samsung seems overriding default android styles , themes (they've been doing years). doing simple things putting seekbar in layout: <seekbar android:layout_width="match_parent" android:layout_height="wrap_content" /> works fine on every other device, except samsung. on samsung device seekbar thumb not centered vertically, it's moved above seekbar's center line. the seekbar isn't example of standard ui not working correctly on samsung devices. it's general problem across many of standard components. how can disable samsung's hacks on android standard styles / themes in app?

javascript - component.query versus component.getcomponent in performance -

is component.query() faster component.getcomponent() ? what pros , cons of using component.query ? while ext.componentquery queries underlying components ( you may define traversing start second param after query string) allow query various set of params, attributes, pseudo classes, functions, etc. full reference , result in set (array) compinstance.getcomponent('itemid') queries direct childs of calling component itemid property , return 1 reference or null. note itemid need unique it's siblings. so yes getcomponent() bit faster. i don't think there huge pros , cons. getcomponent() cannot used because may not looking in level. take menu groups the buttons, getcomponent() find group not within it. don't care it.

python - IPython on Emacs 24.2 doesn't work -

i'm beginner in emacs , i'm trying extend acts comfortable python ide. trouble can't seem integrate ipython emacs. i'm running emacs 24.2 ipython 0.13.2 on xubuntu 13.04. i tried adding .emacs file: (setq python-shell-interpreter "ipython" python-shell-interpreter-args "" python-shell-prompt-regexp "in \\[[0-9]+\\]: " python-shell-prompt-output-regexp "out\\[[0-9]+\\]: " python-shell-completion-setup-code "from ipython.core.completerlib import module_completion" python-shell-completion-module-string-code "';'.join(module_completion('''%s'''))\n" python-shell-completion-string-code "';'.join(get_ipython().completer.all_completions('''%s'''))\n") but running python console emacs (python > start interpreter) brings "inferior python mode". tried "emacs-ipython-notebook" doesn't seem i'm...

JAVA Android: Logging in... (freezes) -

i have no clue why app freezes while tries connect tcp server. establish connection know that, because signs me off other messenger when connect it, freezes says "logging in.." 07-01 05:37:55.297: e/androidruntime(280): fatal exception: main 07-01 05:37:55.297: e/androidruntime(280): java.lang.runtimeexception: unable provider com.android.providers.contacts.calllogprovider: java.lang.illegalstateexception: error upgrading database version 309 07-01 05:37:55.297: e/androidruntime(280): @ android.app.activitythread.installprovider(activitythread.java:4509) 07-01 05:37:55.297: e/androidruntime(280): @ android.app.activitythread.installcontentproviders(activitythread.java:4281) 07-01 05:37:55.297: e/androidruntime(280): @ android.app.activitythread.handlebindapplication(activitythread.java:4237) 07-01 05:37:55.297: e/androidruntime(280): @ android.app.activitythread.access$3000(activitythread.java:125) 07-01 05:37:55.297: e/androidruntime(280): @ android.app.activityth...

permissions - Linked SQL table in Access 2003 (!) not updatable -

i'm working in legacy app moment, upgrading access 2003 link sql server tables (2008 r2 or later). tables linked code, can insert, not update or delete. i've tried on web, no dice. details below. being terse not tl;dr. tables first created using upsizing wizard. in use, app has connect different ones in same schema, can't set , forget. can't local dsn's, many installs, though dsn file possible. problems there too, dsn not found. details later. before rest: i'm further updating app access 2016 or so. if different enough / easier there, i'll wait few days. maybe suggest best refsite that. * problem details follow * using dsn , ui link table, editable table. hurray. but when use code below (found on every refsite), link made selecting , inserting work. else fails fails fails, no matter what. public function linktosqltable(sqlinstance string, sqldb string, sqltablename string, localtablename string) dim linked new tabledef ...

scala - Play! framework staging causing NoSuchFieldError when calling routes.Application.index -

we using play 2.1.0. when launch using "play run", works fine. when play stage; ./target/start -dconfig.file=/users/xxxx/desktop/application.conf , cause error. below trace: ! @6enc6p16c - internal server error, (get) [/] -> play.api.application$$anon$1: execution exception[[runtimeexception: java.lang.nosuchfielderror: application]] @ play.api.application$class.handleerror(application.scala:289) ~[play_2.10.jar:2.1.0] @ play.api.defaultapplication.handleerror(application.scala:383) [play_2.10.jar:2.1.0] @ play.core.server.netty.playdefaultupstreamhandler$$anon$2$$anonfun$handle$1.apply(playdefaultupstreamhandler.scala:132) [play_2.10.jar:2.1.0] @ play.core.server.netty.playdefaultupstreamhandler$$anon$2$$anonfun$handle$1.apply(playdefaultupstreamhandler.scala:128) [play_2.10.jar:2.1.0] @ play.api.libs.concurrent.playpromise$$anonfun$extend1$1.apply(promise.scala:113) [play_2.10.jar:2.1.0] @ play.api.libs.concurrent.playpromise$$anonfun$exten...

ruby on rails 3 - Coffeescript - inherit parent class from different coffeescript file -

i creating spine-rails application , have 2 coffeescript files in lib folder. wanted inherit parent class in coffeescript file unable so. #= require coffeescript_file_1 above statement finds target coffeescript file cannot find parent class. i found utlity: https://github.com/fairfieldt/coffeescript-concat just wanted know if using correct way find parent class in coffeescript file inside file in rails app. i'm not using npm. you need "export" class. coffeescript uses iife wrapper avoid polluting scope. in application.js : #= require coffee_parent #= require coffee_child in coffee_parent.js.coffee : @parent = class parent dostuff: -> in coffee_child.js.coffee : @child = class child extends @parent dostuff: -> super 1

Listen for font reductions on iOS -

this question has answer here: how can set same font-scale multiple labels depending on 1 autoshrinked? 1 answer when use uilabel , can set adjustsfontsizetofitwidth along appropriate scale factor. how can notified when scales down? use-case when 1 label down-sizes, others around uniformity. there no observation mechanism, you'd need calculate size required fit text in available space , use size on all. the alternative use autolayout allow text wrap , doesn't need scale down.

CamelCaser function in Java, problems with debugging -

i creating camelcase function in java takes string this_is_a_sentence , returns thisisasentence main problem comes handeling different characters in string. so far have: import java.util.scanner; public class main{ public static string camelcaser(string str){ char[] strchr = str.tochararray(); strchr[0] = strchr[0].touppercase; for(int = 0; < strchr.length; i++){ if (strchr[i] == '_'){ strchr[i] = strchr[i+1].touppercase; strchr[i+1] = ""; } } string newstr = new string(strchr); return newstr; } public static void main(string[] args){ scanner input = new scanner(system.in); system.out.println("string: "); string str = input.next(); system.out.printf("converting: %s %s", str, camelcaser(str)); } } my main problems seems can not alter individual characters same way used in c...

php - Show data from database based on user input -

i'm creating way "teacher" make exam , "student" can take exam. first off, possible teacher make new questions, using query: insert questions (question, type) values ('$question', '$type') in database, set questions have question_id auto incremented after each entry. on separate page, can pick questions add exam. just: select * questions then there checkbox them check questions add use query: insert exams (question_id) values ('$question_id') the table exams has auto incremented exam_id. display questions teacher picked, don't know type should store question_id in exams (right int) can loop through them. ie. teacher picks questions 1,2,4,10 , query getting question select question questions question_id='1,2,4,10' assuming getting question id post or get, try this: $selected = implode(',', $_request['selectedquestionids']); select question questions question_id in ($sele...

reactjs - how do i pass data between views in react js -

i have 2 views. 1 left nav has list of items other main screen need change depending on item select. here toggle function change "name" i'm trying update ontogglefilter(checked) { let d = this.props.data this.setprojectname(d.id) //console.log("name" + d.id) d.onfilter = checked if( d.children && d.children.length > 0 ) { d.children.foreach( item => { item.onfilter = checked }) } this.setstate({ selected: checked }) if( this.props.onfilterchanged ) { this.props.onfilterchanged(checked) } } setprojectname (data){ console.log ("name" + data) let projectname = data } that consoles out name remarkable (thats 1 of projects on left nav) somehow need pass projectname component. i'm new react , i'm sure simple reading documentation i'm little stuck. ok think know how first part: i have data service file has function getnavinfo (){ ...

Cloud Vision API - PDF OCR -

i tested google cloud vision api read text, if exist, in image. until installed maven server , redis server. follow instructions in page. https://github.com/googlecloudplatform/cloud-vision/tree/master/java/text until able tested .jpg files, possible tiff files or pdf?? i using following command: java -cp target/text-1.0-snapshot-jar-with-dependencies.jar com.google.cloud.vision.samples.text.textapp ../../data/text/ inside text directory, have files in jpg format. then read converted file, don't know how that, run following command java -cp target/text-1.0-snapshot-jar-with-dependencies.jar com.google.cloud.vision.samples.text.textapp and message enter word or phrase search in converted files. there way see whole document transformed? thanks! unfortunately pdf , tiff formats not supported cloud vision. the accepted formats : (taken the doc ) jpeg png8 png24 gif animated gif (first frame only) bmp webp raw ico

localization - Should i use _ (underscore) or - (dash) while using locale id? -

why java.util.locale.us show en_us, when construct why need pass "en-us"? what difference between this. you see both versions quite often. however, rfc 5646 (which part of ietf bcp 47 document series) prescribes hyphen separator character: https://tools.ietf.org/html/rfc5646 java seems allow both versions: http://docs.oracle.com/javase/7/docs/api/java/util/locale.html quote: "well-formed variant values have form subtag (('_'|'-') subtag)* subtag = [0-9][0-9a-za-z]{3} | [0-9a-za-z]{5,8}. (note: bcp 47 uses hyphen ('-') delimiter, more lenient)" cheers, martin

r - Make step function adopt 90 degree transitions -

Image
i suspect may extremely stupid question, here goes! (also, apologies if better suited crossvalidated, i'm not sure @ point whether programming issue, or needs approaching more statistically... i have created step-function cumseg (a.k.a staircase function, a.k.a peicewise constant function) , fit discontinuous (x axis) data, in code/figure below. that's fine, i'm pretty happy it, i'm wondering if can make step function (red line) have vertical transition (i.e both 'shoulders' of function 90 degrees). in order value on x-axis have between current 2 jump points. possible? if so, brings me question, how might 1 represent st. deviation on line on chart if has these 90 degree transitions , vertical descent? # plotting step-functions on gc-operon data. require(ggplot2) library("ggplot2") require(reshape2) library("reshape2") require(scales) library(rcolorbrewer) library(cumseg) df <- structure(list(pvc1 = 0.4019026, pvc2 = 0.447925...

how to allow user sign up in gitlab but restrict their email to specific domain? -

Image
i can enable user sign edit config/gitlab.yaml ## users management signup_enabled: true # default: false i want restrict user email domain mycompany.com when signuped people in company can create gitlab account. such as: tom@mycompany.com # ok sign jerry@mycompany.com # ok sign abc@example.com # disallow sign how configure in gitlab? 2013: requested ( issue 4413), not yet implemented . implemented in 2016 ( merge request 598 , gitlab 7.11, may 2015) in admin area: original answer (2013): that similar atlassian confluence setting: so pull requests welcome. [edit] feature request moved here .

Visual Studio 2010 crashing 10-20 times a day -

ultimately, may have been resolved after removing , re-installing .net framework , visual studio 2010, , running ccleaner on registry. not seen error few days i'm hoping has gone away good. suggestions. in summary, have vs2010 professional (10.0.40219.1 sp1rel) , using vb.net development @ moment ankhsvn , tortoise latest versions. crashes no detail other than: unhandled exception @ 0x77d415de in devenv.exe: microsoft c++ exception: vbruntimeexception @ memory location 0x08e0f594.. and happens 10-20 times day , becoming nightmare. have re-installed whole thing (not repaired). have deleted temp files, .suo , .user etc , switched off hardware acceleration. none of has helped. if debug crash, following stack: ntdll.dll!_zwraiseexception@12() + 0x12 bytes ntdll.dll!_zwraiseexception@12() + 0x12 bytes kernelbase.dll!_raiseexception@16() + 0x58 bytes msvcr100.dll!__cxxthrowexception@8() + 0x45 bytes > msvbide.dll!pebuilder::definepiatypes() + ...

sql server - SQL Query - Combine multiple rows to one row -

this question has answer here: simulating group_concat mysql function in microsoft sql server 2005? 9 answers how write sql combine data multiple columns , rows 1 row. organizationid name type active -------------------------------------- 1 baker county yes 2 curry county yes expected result: somecolumnname ------------------------------- 1bakercountyyes2currycountyyes mysql use group_concat . select row_id, group_concat( value order value separator ' ') (select @row_number:=1 row_id, concat(organizationid ,name,type,active) value table1 order file_fields_id ) t group row_id;

html - Is it possible to start a video file in a specific time in html4? -

i want play video file (avi) @ specific time (for example, 40s) in html4. found it's possible manipulate mp4 file in html5 using javascript. apparently html5 doesn't cover avi file. it's quite burden convert avi files mp4, on 100. there solutions? not html4 features, there other solutions... html5 video supported few video types - none of them .avi -> http://en.wikipedia.org/wiki/html5_video#supported_video_formats most web sites , applications support html5 video have flash player fallback. when user's browser doesn't support html5 video, flash player play 1 of encoded videos (.mp4 extension) through .swf video player. sites youtube use query string url supply video player start time in seconds. video player either html5 or flash, not html4. avi videos aren't use on web, i'd recommend using miro video encoder encode avi's mp4.

sql server - Codeigniter - pass single query result to controller with json - if exists -

wanting pass single codeigniter query result controller using json. my model function is: function get_linked_loads_qty($q){ $sql = $this->db->query(" if exists( select qtylinkedorders linked_order_summary join linked_order_lines on linked_order_summary.linkedorderid= linked_order_lines.linked_order_id load_number='$q' ) begin select qtylinkedorders linked_order_summary join linked_order_lines on linked_order_summary.linkedorderid= linked_order_lines.linked_order_id load_number='$q' end else begin select 1 qtylinkedorders customer_order_lines customerorderid='$q' group customerorderid end "); $query = $this->db->get(); if($query->num_rows > 0){ foreach ($query->result_array() $row){ $row_set[] = htmlentities(stripslashes($row[qtylinkedorders])); //build array } return $row_set; } } and controller is: function get_linked_loads_qty(){ $this->load-...

c# - How to find and replace a large section of bytes in a file? -

i'm looking find large section of bytes within file, remove them , import new large section of bytes starting old ones started. here's video of manual process i'm trying re-create in c#, might explain little better: https://www.youtube.com/watch?v=_knx8wttcva i have basic experience c# learning go along, appreciated! thanks. refer question: c# replace bytes in byte[] use following class: public static class bytepatternutilities { private static int findbytes(byte[] src, byte[] find) { int index = -1; int matchindex = 0; // handle complete source array (int = 0; < src.length; i++) { if (src[i] == find[matchindex]) { if (matchindex == (find.length - 1)) { index = - matchindex; break; } matchindex++; } else { matchindex = 0; ...

android - Recyclerview, otifyItemChanged() and image loaded by Picasso -

i have problem picasso cache (i think so). created recyclerview , recyclerview.adapter. single item on list contain imageview. imageview load image using picasso library this: public void onbindviewholder(pageviewholder holder, int position) { final int positionadp = holder.getadapterposition(); (new picasso.builder(mcontext).addrequesthandler(new pagethumbrequesthandler(mpagescontainer.get())) .build()) .load(pagethumbrequesthandler.request_scheme + "://" + mpages.get(positionadp).mtag) .memorypolicy(memorypolicy.no_cache, memorypolicy.no_store) .networkpolicy(networkpolicy.no_cache) .into(holder.mthumbview); holder.mthumbview.settag(mpages.get(positionadp).mtag); holder.mthumbview.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { string tag = (string) v.gettag(); mpagelistener.onpageselected(tag); } })...

Clojure - Recursively Semi-Flatten Nested Map -

in clojure, how can turn nested map this: (def parent {:id "parent-1" :value "hi dude!" :children [{:id "child-11" :value "how life?" :children [{:id "child-111" :value "some value" :children []}]} {:id "child-12" :value "does work?" :children []}]}) into this: [ [{:id "parent-1", :value "hi dude!"}] [{:id "parent-1", :value "hi dude!"} {:id "child-11", :value "how life?"}] [{:id "parent-1", :value "hi dude!"} {:id "child-11", :value "how life?"} {:id "child-111", :value "some value"}] [{:id "parent-1", :value "hi dude!"} {:id "child-1...

session - MVC 4 code file (.cs) redirect to an action -

i have created .cs file checking session values. using session below httpcontext.current.session["usrprof"] it written in simple .cs file. can use if in controller can use in normal .cs file can use redirect action if don't in session if (httpcontext.current.session["usrprof"] == null) //redirect action. you can use redirect response object if (httpcontext.current.session["usrprof"] == null) { httpcontext.response.redirect("/controller/action"); } hope helps

Text To Speech is not working in Ginger Bread - Android 2.3 -

i developing text speech application. code working fine in android 4.0 ice cream sandwich , above. in android 2.3 ginger bread no voice coming without error. voice coming in emulator not in phone. have checked app on 2 handsets: xperia x10 , galaxy pop mini having ginger bread. here's code: import java.util.locale; import android.view.viewgroup; import android.app.activity; import android.content.context; import android.graphics.typeface; import android.os.bundle; import android.speech.tts.texttospeech; import android.speech.tts.texttospeech.oninitlistener; import android.util.log; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.view.onclicklistener; import android.widget.adapterview; import android.widget.adapterview.onitemselectedlistener; import android.widget.arrayadapter; import android.widget.edittext; import android.widget.imagebutton; import android.widget.spinner; import android.widget.textview; import andr...

php - .htaccess rewrite works when two params, but cant read first one with slash after -

this question has answer here: htaccess mod rewrite optional slash 1 answer i know type of problem asked lot havent been able find resolution this. my .htaccess code rewrites first param page, 3 after param1, param2, , param3. works fine, example when url "localhost/portal/dashboard" . when url "localhost/portal/dashboard/" (the slash), doesnt work , gives 404 error. here .htaccess file: rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]+)$ index.php?page=$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]+)/([^/]+)$ index.php?page=$1&param1=$2 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]+)/([^/]+)/([^/]+)$ index.php?page=$1&param1=$2&param2=$3 [l] than...

ios - AVAssetExportSession with modified resolution settings -

avassetexportsession takes preset 1 of initialization parameters: avassetexportsession(asset: avasset, presetname: string) where presets settings avassetexportpreset640x480 or avassetexportpreset1920x1080 . if want encode using custom resolution (say 250x400), there way , if how? these export options defined , not able allow encode using custom resolution. alternatively, can try approach func exportvideo(asset:avasset, renderedwidth: cgfloat, renderedheight: cgfloat, exportcompletionhandler: (() -> void)?) { let videotrack: avassettrack = asset.trackswithmediatype(avmediatypevideo)[0] let videocomposition = avmutablevideocomposition() videocomposition.frameduration = cmtimemake(1, 30) videocomposition.rendersize = cgsizemake(renderedwidth, renderedheight) let instruction: avmutablevideocompositioninstruction = avmutablevideocompositioninstruction.init() instruction.timerange = cmtimerangemake(kcmtimezero, cmtimem...

php - Making post specific toggle buttons -

Image
i created widget in functions.php intended added services section. created , displayed 6 unique services using widget. in each service, there more button when clicked toggled remaining content. problem whenever click on more button of of services, other services toggled. how can modify toggle script when user click on button service a, content service toggled without affecting others? below codes , screenshot" //functions.php <div class="col-lg-4 col-sm-4 focus-box" data-scrollreveal="enter left after 0.15s on 1s"> <?php if( !empty($instance['image_uri']) && ($instance['image_uri'] != 'upload image') ) { ?> <div class="service-icon"> <?php if( !empty($instance['link']) ) { ?> <a href="<?php echo $instance['link']; ?>"><i class="pixeden" style="background:url(<?php echo e...