Posts

Showing posts from August, 2011

javascript - Change CSS with jQuery within a PHP While Loop -

i've been trying figure 1 out while now, , have gone through series of methods however, no cigar. q: how change color of singular div within php while loop, using jquery following ajax response? garr! this jquery function within response: $('.circle').each(function(){ $(this).css("background", "red"); }); in php file if status there echo div, when jquery triggered response affects $red variables, rather 1 i'm trying target. test2.php: $red = "<div id='basic' class='circle' style='display: block; border-radius: 100%; width: 60px; height: 60px;' value='1'></div>"; if($row2['status'] == 1 || 0){ echo $red; } it's frustrating because works fine if echo variables depending on data id different background colors , display: none , it'd nice working without refresh using jquery method. ajax , jquery synchronous. try setting funct

cassandra - CPU 100% due to thousands of Pending Compaction -

recently inserted millions of records , deleted millions of records table, table of size 10 gb truncated. we running 2 nodes sizetieredcompactionstrategy, cpu utilization 100% , pending compaction increasing , pending compaction 293144 any pointers reduce cpu utilization , compaction done quickly. reduce cpu utilization , compaction done quickly. these 2 things orthogonal. can either accelerate compaction (by using more resources) or limit resources compactions writes aren't affected have take longer. if have ingest running against cassandra cluster, try ensure not affected compactions. long # of pending compactions decreasing on time it's matter of time. if don't have reads or writes coming in (i.e. downtime or you're bootstrapping) it's okay let compactions use resources , finish fast. how? the levers are: 1) get/set compaction throughput (nodetool)-- kicks in next available compaction. how fast compaction occur. default 16 mb/s i

asp.net mvc - ActionLink for Logout is rendering wrong route -

i'm trying figure out why actionlink renders wrong. in _layout.cshtml have <div class="col-sm-7"> <ul> <li class="section-head section-head2 ">xyz technologies</li> <li>@viewbag.email</li> </ul> </div> <div class="col-sm-5"> @html.actionlink("logout", "logout", "submission", new {@class = "pull-right"}) </div> but when i'm in view on 'customforms' controller renders this: <div class="col-sm-7"> <ul> <li class="section-head section-head2 ">xyz technologies</li> <li>someone@noserver.com</li> </div> <div class="col-sm-5"> <a class="pull-right" href="/customforms/logout?length=10">logout</a> </div> i guess there's overwriting it, i'm not sure how track down what

adding two vales to one cell of a matrix in R -

i want each cell of matrix/table contain 2 values. e.g 2,1 2,2 2,3 can show me how in r to have 2 numeric values in single matrix element, can use list. (m <- as.matrix(list(c(2, 1), c(2, 2), c(2, 3)))) # [,1] # [1,] numeric,2 # [2,] numeric,2 # [3,] numeric,2 then can access values via m[, 1] # [[1]] # [1] 2 1 # # [[2]] # [1] 2 2 # # [[3]] # [1] 2 3 or m[1, ][[1]] # [1] 2 1 etc. option use character vector of pasted values matrix(paste(c(2, 2, 2), c(1, 2, 3), sep = ","), ncol = 1) # [,1] # [1,] "2,1" # [2,] "2,2" # [3,] "2,3"

cmd - Pass Environment Variable as command line argument -

i trying script install of application requires hostname in argument string. "c:\application.exe" /host=hostname but keeps taking whatever put argument value literal. suggestions? %hostname% how use environment variables in windows. c:\application.exe /host=%hostname%

java - Sort map by key string (where key is actually an integer) -

i trying sort map show in dropdown. not able sorting done. return new map. not map sorted key expect. private map<string, string> mapinstrumentids = new treemap<>(); map<object, object> val = mapinstrumentids .entryset() .stream() .sorted(map.entry.comparingbykey()) .collect(collectors.tomap(map.entry::getkey, map.entry::getvalue)); i of course didn't think key integer. means sorting string not give me expected result (as integer sort). changing key integer , converting value yield expected result. by default treemap guarantees elements sorted in ascending key order.

css3 - How to use CSS to create an image overlay effect? -

Image
i've designed hyperlinks css add background image (to make button) using following code: <a class="btnimg" id="btnimgconfig" href="#"></a> .btnimg { width:100px; height:100px; display:inline-block; border:1px solid #e4e4e4; } .btnimg:hover { opacity: .2; background-color: #878787; } #btnimgconfig { background: url("http://www.icecub.nl/images/config.png") no-repeat scroll 0 0 transparent; } as can see, i'm trying create darker effect on image on hover. desired effect: however, effect this: know replacing image on hover darker version of it. somehow feel shouldn't way in case. besides mentioned above, i've tried rgba{..} on hover. had no effect @ all. here's jsfiddle of code above. you alternatively use pseudo-element overlays. give effect require. .btnimg { width: 100px; height: 100px; display: inline-block; border: 1px solid #e4e4e4; posit

sql - convert row to column using Pivot without any clause -

Image
i have table below. i need data below. i have created 2 temp tables , achieved result this. please me same pivot. at least wouldn't use pivot that, mind simpler group , row_number: select userid, max(starttime) starttime, max(endtime) endtime ( select userid, case when startorend = 's' time end starttime, case when startorend = 'e' time end endtime, row_number() on (partition userid order time asc) + case when startorend = 's' 1 else 0 end grp table1 ) x group userid, grp order starttime the derived table splits time start / end time columns (to handle cases 1 exists) , uses trick row number group s / e items together. outer select groups rows same row. example in sql fiddle

ASP.NET MVC5 add authentication into an empty project -

i've created empty asp.net mvc5 project, used ef code first approach. how can add owin authentication , store users , roles in created database? how can customize owin authentication purpose? look microsoft's identity framework. can nuget package identity entityframework project.

Jenkins - how to conditionally choice parameter -

i want add dependence parameter: boolean , choice. is possible after checking boolean parameter to see choice dropdown posibility choose parameter? try uno choice plugin . select 2 levels of choice.

php - Display Datatime-local Datatype in HTL5 Table Without Trailing Text or Zeros -

Image
i want display data sql table , datatype datetime(6) data size 6 bytes. when display data in html table input tag andtype text datetime format trailing zeros. want display datetime format without trailing zeroes.i present codes below. codes on input form data collected. <li> <label for="date-time">access date , time</label> <input name="date-time" type="datetime-local" id="date-time"/> </li> this code displaying data. <?php include('/templates/header.php'); $host = "localhost"; // host name $username = "root"; // mysql username $password = ""; // mysql password $db_name = "datacentre"; // database name $tbl_name = "data_centre_users"; // table name $server_name = "localhost"; // create connection $con = new mysqli($server_name, $username, $password, $db_name, 3306); if($con->connect_error){

Is it possible to store array of values in cookies during for loop in JSP? -

is possible store array of values in cookies during loop.if yes how , if no how can sort problem store array elements in cookie?? following code trying: <% string check[] = request.getparametervalues("chk"); string a[] = " "; if (check != null) { %> <h4 style="color:white"> <% (int = 0; < check.length; i++) { out.println(check[i]); a[i] = check[i]; } cookie c1 = new cookie(chks, check[i]); response.addcookie(c1); } %> </h4> <a href="basket.jsp" style="text-decoration: none;color:white">proceed</a>

php - Reverse routing in Lumen. Call Router by it's name -

i have routes defined below: $app->get('/user/posts', [ "as" => 'user.posts', "uses" => 'usercontroller@getposts' ]); $app->get('/user/ads', [ "as" => 'user.ads', "uses" => 'usercontroller@getads' ]); it possible call these 2 routes name inside third route (below)? reverse routing? $app->get('/user/all', function() use ($app){ /** not work $request = request::create('myroutename', 'get'); // can't use route class in lumen $response = route::dispatch($request); **/ return [ "posts" => request::response_from('user.posts'), "ads" => request::response_from('user.ads') ]; }); i method request::response_from($routenameoruri) can data route (by calling controller'

php - can use httpClient in Android Studio? -

i use httpclient send data php file this php <?php echo $_post['my_data']; ?> and add <uses-permission android:name="android.permission.internet" /> androidmanifest.xml connect internet. this main activity sendactivity.java public class sendactivity extends actionbaractivity { string myjson; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_send); senddata(); } public void senddata(){ class getdatajson extends asynctask<string, void, string>{ private progressdialog pdialog; private inputstream = null; private string url = "http://----/send.php"; private string page_output = ""; @override protected string doinbackground(string... args) { try { // building parame

typo3 - Sort by joined table attribute -

i have 2 entities in extbase extension. adress , category.every address have 1 category (category 1:n adress): every category have title , description. want implement function im addressrepository adresses sort category title. how can join both table , sort joined table title in extbase? can give me hint? update : now solved issue plain sql statements

python - Selenium file upload url "path is not absolute" -

i'm trying upload file facebook group selenium chromedriver. driver.find_element_by_xpath("//input[@type='file']").send_keys("http://www.peta.org/wp-content/uploads/2013/10/goat_2d00_list_2d00_1.jpg") but throws exception this: selenium.common.exceptions.webdriverexception: message: unknown error: path not absolute: i'm on windows 10, chrome 44.0.2403.130, chromedriver 2.16.333243, selenium 2.47.1 so how can upload images urls ? (without having explicitly download it) nope, way can upload files from local machine : driver.find_element_by_xpath("//input[@type='file']").send_keys("/path/to/the/file") download image first, upload. instance: with urllib import os import urllib base_dir = "/path/to/dir/" path_to_image = os.path.join(base_dir, "upload.jpg") urllib.urlretrieve("http://www.peta.org/wp-content/uploads/2013/10/goat_2d00_list_2d00_1.jpg", path_to_i

Java: Assigning Non Static Variable to Static Variable -

i'm using class called globalvar store global variables required entire application. class looks this: public class globalvar { myprops props = new myprops(); public globalvar() throws exception { } public static string ppfirstname = "kim"; public static string pplastname = "smith"; string zip = props.props.getipzip("ipzip"); public static string ipzip = zip; } however, in last 2 lines i'm getting error: cannot assign non static variable static variable. i understand source of problem (as zip non static , ipzip static) question is: there way around this? i.e, way assign value set in "props" "ipzip" static var? note: purpose of using method able use syntax globalvar.ipzip anywhere in application.. you creating instance of myprops , calling non-static getipzip method. cannot assign result of non-static method static variable. instead, need convert getipzip me

jboss - Random "comp not bound" error (JBoss4/EJB3) -

i have odd error. ear deployed fine. error appears during jobs (like background tasks) , complains not being able instantiate components used fine seconds earlier same code. nothing expired (session or transaction) far can tell, time when appears random , can't reproduce error each time. jboss4.2.3, jdk7, seam 2.2.0ga, ejb3. javax.ejb.ejbexception: org.jboss.seam.instantiationexception: not instantiate seam component: translationservice @ org.jboss.ejb3.tx.ejb3txpolicy.handleexceptioninourtx(ejb3txpolicy.java:63) @ org.jboss.aspects.tx.txpolicy.invokeinourtx(txpolicy.java:83) @ org.jboss.aspects.tx.txinterceptor$requiresnew.invoke(txinterceptor.java:253) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:101) @ org.jboss.aspects.tx.txpropagationinterceptor.invoke(txpropagationinterceptor.java:95) @ org.jboss.aop.joinpoint.methodinvocation.invokenext(methodinvocation.java:101) @ org.jboss.ejb3.stateless.statelessinstanceinterceptor.invoke(statelessin

java - Android: stop scrolling when imageview is touched? -

i try make possible rotate imageview, scrolling gets in way. how can stop scrolling while imageview touched? don't think code necessary, here goes: fragment_main.xml <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview01" android:layout_width="fill_parent" android:layout_height="fill_parent" > <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivityfragment" android:background="@drawable/texture"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Πάγωσε η κόλαση..." a

Laravel Auth Register, Prevent automatic login -

i developing app manage users. need access auth/register logged in users. default auth redirecting home page. it seems after registration, auth automatically doing ::attempt. how can prevent it? assuming use registersusers (or authenticatesandregistersusers ) trait in controller can override postregister method , not log user in. can see original method here without logging be: public function postregister(request $request) { $validator = $this->validator($request->all()); if ($validator->fails()) { $this->throwvalidationexception( $request, $validator ); } return redirect($this->redirectpath()); }

mingw - How to build MSYS-dependent program with gcc4? -

mingw comes gcc configured making windows programs. instance, not compile , link little program: #include <unistd.h> int main(void) { uid_t u = getuid(); // no such function in microsoft library return 0; } this program will compile , link msys compiler, since msys library has function. how, instance, gnu coreutils program id can obtain , print user id, , how ls -l in mingw prints user , group ids , on. the problem is, msys compiler old: gcc 3.4.4. is there nice, "canonical" way point mingw's gcc 4.5.2 right headers , libraries compiling msys-based programs? or route not recommended @ all; better build msys gcc4 scratch, bootstrapped msys gcc3? i'm afraid answer "you don't want this" (hence information scant). purpose of msys environment provide utilities building mingw programs. if given program isn't needed purpose, doesn't need build msys. in other words, mingw provides cross-compiling toolchain, target

c# - Implement a function to return top rated movies in the network of movie -

given class below: public class movie { private readonly char movieid; private readonly float rating; private list<movie> similarmovies; // similarity bidirectional public movie(char movieid, float rating) { this.movieid = movieid; this.rating = rating; similarmovies = new list<movie>(); } public char getid() { return movieid; } public float getrating() { return rating; } public void addsimilarmovie(movie movie) { similarmovies.add(movie); movie.similarmovies.add(this); } public list<movie> getsimilarmovies() { return similarmovies; } public static ilist<movie> getmovierecommendations(movie movie, int numtopratedsimilarmovies) { //implement method return null; } } reachable current movie eg: a(rating 1.2) / \

javascript - FabricJS: using object controls on canvas to resize, but not scale -

the problem update actual object.width, object.height , keep object.scalex = 1 , object.scaley = 1 when using visual controls on canvas. the origin of problem when manipulating object using controls, fabric.js changes scale of object, scaling stroke of paths, of same width always. so make more adobe illustrator-like, , not scale width of stroke along width of rectalngular, example. i have found solution question formulated in different manner here: rect stroke, stroke line mis-transformed when scaled the idea calculate new would-be width , height using new scale factors, set new dimensions , reset scale factors 1. here's code example answer: el.on({ 'scaling': function(e) { var obj = this, w = obj.width * obj.scalex, h = obj.height * obj.scaley, s = obj.strokewidth; obj.set({ 'height' : h, 'width' : w, 'scalex' : 1, 'scaley' : 1 }

javascript - is it possible to integrate <md-select> with <md-icon>? -

Image
right using google material design angularjs . i want have icons ilustrating each of options , in selection worked fine after select option instead of having icon images/svg+xml instead. (the picture explains situation better words) the html have directive this: <div layout="column"> <div layout="row" layout-sm="column" layout-align="space-around center"> <md-content md-theme="docs-dark" class="md-padding" flex> <div layout="column" flex> <div layout layout-sm="column" flex> <md-input-container flex> <label>name</label> <input required type="text" name="name" ng-model="geo.geodef.name"> <div ng-messages="geodefform.name.$error"> <div ng-message="required">required.</div>

ruby - Running migrations on my Rails DB, adding a column quietly and randomly drops a table without a console error -

i able discouver problem walking through running migrations. last 2 days i've been trying somthing simple. remove 1 column verdict:text simulations table , add column: opinions:hash . doing caused variety of errors, such no method 'my_sym' , saying simulation table didn't exist. i thought had resolved doing: rake db:drop rake db:schema:dump rake db:migrate version="<migration1>" rake db:migrate version="<migration2>" rake db:setup env="test" migration 1: class devisecreateusers < activerecord::migration def change create_table(:users) |t| ## database authenticatable t.string :email, :null => false, :default => "", limit: 96 t.string :encrypted_password, :null => false, :default => "", limit: 60 t.timestamps t.index :email, unique: true end end end migration 2: class createsimulations < activerecord::migration def

Google Chrome is not rendering properly my CSS layout after Version 44.0.2403.107 m -

in mozilla firefox works , in chrome until new version. .company_color{ color:#f04848; } <select> <option value="">company</option> <option class="company_color" value="test">test</option> .. <option value="test500">test500</option> </select> it should color text red when option class "company_color". when there many companies (more 300 in pure test. less in production test) chrome ignores colouring function. started happen in new version. does have solution or chrome restriction? ok, google chrome disabling style of options inside selects have more 300 options. there's not do.

java - Print random numbers in array size 20 and print number in lndex number -

question: write program create array of size 20 store integers. then, program should generate , insert random numbers between 1 , 7, inclusive array. next, program should print array output. simple subset part of array consists of set of 4 elements next each other. program generate random number between 0 , 19, represents location in array (i.e. index number). then, program should print 4 elements location. program should take consideration boundaries of array. there no user input program. program must include, @ least, following methods: - insertnumbers, take input 1 integer array , store random numbers in it. - computelocation, generate location random number , return it. a sample run of program shown below: sample output #1: array: 2 7 4 3 1 5 7 2 3 6 2 7 1 3 2 4 5 3 2 6 random position: 2 subset: 4 3 1 5 sample output #2: array: 2 7 4 3 1 5 7 2 3 6 2 7 1 3 2 4 5 3 2 6 random position: 18 subset: 2 6 2 7 wh

Excel 2013 VBA, not calling a sub, intermittently -

i calling sub sub, intermittently fails using same test data, line calls routine : call setmargin(marginlines(), product_margin(), ectot, sctot, tttot, dstot, _ tstot, drtot, nstot, sqtot, shapetot, temp_row) this definition : private sub setmargin(marginlines() integer, product_margin() single, _ ectot integer, sctot integer, tttot integer, _ dstot integer, tstot integer, drtot integer, _ nstot integer, sqtot integer, shapetot integer, _ temp_row integer) i have stepped through macro code (f8) , runs routine , not, same data. think runs if msgbox called before might coincidence. routine runs if there spread sheet open. product_margin defined : dim product_margin(10, 4) single which filled values range between 0 , 99 marginlines : dim marginlines() integer which hold value product_margin determined code in setmargin. there no on error resume next statement in module these subs reside.

php - Single-page module for Yii2 -

what best way create single page module yii2? for example using ember, have index.html , assets folder publish. i see 2 ways, 1 put application under web accessible folder, work fine. if want check access application using existing rbac? another way create module , in default controller have like return $this->renderfile('@path/to/index.html'); and load assets asset bundle. the problem approach not know folder assets loaded (it can solved aftercopy callback or something, doesn't nice @ all). please advise. certainly personal choice technique, since control rbac manageable level action , not pose problem. once controller easy applicarre organization's access control using suitable configuration of access control filter . alternatively, fact of creating module appropriately these purposes makes better organized and, precisely, modular, beyond greater complexity in creation of various parts in play (module, asset, cofig / main.php) yii2 han

regex - Why does my htaccess not rewrite properly -

i having problem htaccess file, , can't figure out if it's configuration, or server cache messing urls. my file following rewriteengine on rewritebase / rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1/$1 [r=301,l] rewritecond %{http_host} ^website.com$ rewritecond %{https} off rewriterule (.*) https://website.com/$1 [r=301,l] rewriterule ^([a-z]+)\/?$ $1.php [nc] the first rule move www non-www, works. the second rule move http https, works. the third rule make url /anyfile call anyfile.php , keep lovely url. the problem calls anyfile.html , not php, , if remove said html file 404. yes works typing anyfile.php in url, not have .php in url. if not obvious enough, supposed work file name, not single one. any , appreciated. replace .htaccess rules code: options -multiviews rewriteengine on rewritebase / # single rule http->https , www removal rewritecond %{https} off [or] rewritecond %{http_host} ^www\. [nc] rewriterule

ios - App crashes and restarts phone -

Image
i'm beta testing app, , on devices works fine. found @ least 1 device (iphone 6s, have other of working fine), it's not app crashes, whole telephone restarts. nothing find in logs , no clue in app caused. how possible? start looking? i encountered similar problem, app crash totally reboot iphone. discovered workaround: connect device mac open xcode --> window --> devices select on left device clean on bottom log redo same steps crash app see happens on log for more clarity, should have window: you see lot of lines little patience should see it's problem, or see area problem @ least. i hope helps!

wordpress - Link opens 2 new windows -

for odd reason, ad @ top (sign & win) opens 2 new windows upon clicking. works fine on chrome on ff , safari, issue persists. website: view here any great. plugin advanced ad you need remove or modify attribute "target='_blank'" anchor tag around ad. having target assigned _blank tells browser start new window session. depending on action desire may try removing attribute or using '_self' or '_parent' instead. more information can found here: http://www.w3schools.com/tags/att_a_target.asp

android - Closing SQLite with C# in Unity -

i'm making app android unity now. but have very basic questions sqlite because i've never used database yet. dbcmd.commandtext = "some select command here"; idatareader reader = dbcmd.executereader(); // jobs reader.. dbcmd.commandtext = "another select command here"; reader = dbcmd.executereader(); // jobs reader.. reader.close(); dbcmd.dispose(); dbconn.close(); reader = null; dbcmd = null; dbconn = null; i need call executereader() method several times that. here questions. do have close reader before call executereader() method again ? do have assign null variables after closing reader , database above? thanks in advance! read using statement - construct designed specially such use cases. yes, second call executereader() returns brand new reader object, must closed/disposed too, when don't need anymore. it's question variables , object references store. it practice in many cases (especially if reader , dbc

c - What is the significance of the "volatile" key word with respect to Embedded Systems? -

i have been working on learning embedded systems programming on own. have observed high usage of keyword volatile qualifier when declaring variables? what significance of volatile when declaring variable in embedded system programming? basically when should key word used. did read compiler optimization , use of keyword. related memory mapping registers. for example, read stackoverflow post didn't understand how applied in embedded environment. more specifically, don't understand when key word should used. did read compiler optimization , use of keyword. related memory mapping registers, don't understand when use it. in embedded systems world, 1 of key aspects of volatile key-word denotes variable may change @ time (eg external/hardware data input - eg adc) , therefore compiler must not optimise use. but specifically, when used control register, indicates read access may in fact change data! as general rule of thumb, recommend use of volatile q

c# - Handle exception when using Task.Run() in UI constructor -

i have constructor call task.run() this: public mypage() { task.run(() => { myheavycpumethod(); }); } here, mypage() constructor of ui component, , don't want myheavycpumethod() run on ui thread, offload task.run() in fire-and-forget fashion since don't care when myheavycpumethod() finishes. however, way if myheavycpumethod() throws, can't handle exception in returned task. how can error handling in case? one option use async/await... doesn't work constructor, can work in static method: public static async task<mypage> createinstance() { await task.run(...); // else asynchronous want use return new mypage(); } and assuming you're using async method, can use: mypage page = await mypage.createinstance(); that way, if cpu-bound task fails, won't constructor call. constructor call expected fast here, will on ui thread (as want be). an alternative this, potentially store task returned task.r

tokenizing and parsing with python -

i don't have code show because have no idea on how start. current target @ least able create tokens file contains data eg: file.txt name : sid data : lazy developer %description packaging file %install enter location install package. and python code should able create tokens file , when required print data based on input. if getdata() function getdata('name') should output "sid" getdata('description') should give text below it. to retrieve data file.txt : data = {} open('file.txt', 'r') f: # opens file line in f: # reads line line key, value = line.split(' : ') # retrieves key , value data[key.lower()] = value.rstrip() # key lower case , removes end-of-line '\n' then, data['name'] returns 'sid' . edit: question has been updated new solution: data = {} open('file.txt', 'r') f: header, *descriptions = f.read().split('\n\n&#

ios - Swift UIWebView initial zoom scale -

hey asked similar question days ago no on me , no i'm think im closer problem. have webview on rootviewcontroller , saved values zoom scale , position of local pdf, want set webview values when appears tried following. override func viewdidappear(animated: bool) { dolayoutthings() } func dolayoutthings(){ if(defaults.objectforkey("positiony") != nil){ webview.scrollview.setzoomscale(defaults.objectforkey("zoomlevel") as! cgfloat, animated: false) let offest = cgpoint(x: defaults.objectforkey("positionx") as! cgfloat, y: defaults.objectforkey("positiony") as! cgfloat) webview.scrollview.setcontentoffset(offest, animated:false) println(defaults.objectforkey("zoomlevel") as! cgfloat) } i know there correct values saved userdefaults webview looks if didn't make scrolling or zooming. i'm happy solution ideas. setting zoom scale in viewdidappear fine c

ios - Determine if system volume is muted in Unity 5 -

i deploying ios, plan deploy android , other platforms down road. i need know whether system volume turned off can show relevant icon on screen. within unity, there way determine whether system volume muted? i not aware of unity functionality allow (because audiosource tied object, not "application" itself) - maybe there magical utility allows that. problem checking in pure ios not easy checking 1 property, since system not indicate it, or @ least not work later version (ios7, 8 - , possibly 9) anyway, think have resort system specific implementation both android , ios (and whatever want support). ios, there great posts go great detail, suggest check them: https://hoishing.wordpress.com/2014/05/08/mute-checking-in-ios7/ detecting silent switch in ios 7 issue hope helps little, though guess did not bring news :)

c# - custom json.net serializer/deserializer for special key of ExpandoObject -

i want serialize , deserialize expandoobject non-trivial values. values of expandoobject contain objects properties leading circular references. i wrote custom serializer/deserializer these objects. these objects occur on many places within expandoobject (also nested, not on root-level). have same key! want deserializer take custom deserializer every property of expandoobject of key. for example: { "a": 12.5, "b": "hello world", "special": { /* ... */ }, "c": -4, "d": { "x": "test", "special": { /* ... */ }, "y": 152 }, "e": 9053 } i want every property special deserialized custom deserializer class. else should handled default deserializer. am on right track handle kind of problem? if yes, how can achieve using json.net?

html - How to make a div float over another div as this image -

i've been trying success @ achieve this using desktop http://i.imgur.com/mymnxza.png and 1 mobile view http://i.imgur.com/xszute5.png how make this? if it's possible use twitter bootstrap awesome me.... cheers , in advance =d you can develop on code; http://codepen.io/ogzhncrt/pen/xgbgpl <div class="gn"> <div class="tx"> 2 </div> <div class="in"> <div class="tx"> 1 </div> </div> </div> <style> body { margin-left: 0px; padding-left: 0px; } .gn { width: 800px; height: 280px; background-color: rgb(34,34,34); text-align: -webkit-center; padding: 40px; } .in { background-color: #f79779; width: 800px; height: 300px; } .tx { font-size: 172px; color: #fff; text-align: right; padding-right:120px; } @media (max-width:700px){ .gn { padding:0px; width:400px; } .tx { padding-right:60px; } .in {

Two .factory error ( angularjs + ionic ) -

i have 2 .factory array each, throws me error second .factory , not have 2 .factory any please thank .factory('rawdata', function() { // might use resource here returns json array // fake testing data var rawdata = [{ "id": "1", "tipo": "evento", "titulo": "esta es una noticia de dos líneas principal", "bg": "fondo-not.png", "bgdetail": "noti-detalle.png", "fec": "abril, 14, 2:56 am", "com": "backpack très bien. made in collaboration haerfest. nylon body top zip closure. leather bottom. outer compartment zip closure , leather trims. adjustable shoulder straps in leather. metal hardware. lined cotton. inner compartments. outer logo branding." }]; return { all: function() { return rawdata; }, get: function(id) {

java - Access to protected field in field of same parent? -

why have access , visibility of protective fields inside classes share same parent? figured protected accessed through parent or child not outside in way. class parent { protected int age; } class sister extends parent { } class brother extends parent { public void mymethod(sister sister) { //i can access field of sister, // when protected. sister.age = 18; // every protected , public field of sister visible // want reduce visibility, since protected fields // have public getters , setters creates // visibility. } } so guess it's protected outside of family. why , how can have hidden family members other direct parent , child? me seems we're lacking access member modifier. family should protected , protected should hidden child , parent. i'm not asking rewrite java, noticing. that because classes parent , brother , sister in same package. members within same package visible, except

html - Changing color of cell based on another cells value -

let's have number of id's in column a, number of dates connected id's in column b, , of dates connected id's in column c. dates updated on different occasions. if want make formula conditional formatting color of cells value of "0" in column c changed, when same id has date on column b. id date1 date2 vvv 15-07-26 0 i want cell 0 have color.

node.js - nodejs process.exit() prevents function from executing properly -

i writing first nodejs script. below code have set test database connection. when include process.exit() @ end of script, nothing logged console - however, when remove line of code, function logs query results appropriately (output included also). i wondering why process.exit() @ end of code prevents function functioning , if using exit method wrong. code: /* * runs every minute on uptime agent * checks list of sites see if they're */ // strict mode (see http://stackoverflow.com/questions/8651415/what-is-strict-mode-and-how-is-it-used information) 'use strict'; // cuz im lazy string.prototype.lc = function() { return this.tolowercase(); } string.prototype.uc = function() { return this.touppercase(); } /** exceptions **/ var dbconnecterror = function(m) { this.name = 'dbconnecterror'; this.message = m; } var dbconfigerror = function(m) { this.name = 'dbconfigerror'; this.message = m; } /** databse **/ /* * chan

ios - Swift with Parse: Error when adding push notification support to appDelegate -

i'm trying add parse appdelegate swift. error saying cannot invoke 'registerforremotenotifications' argument list of type '(uiusernotificationtype)' here's code. what's wrong? if application.respondstoselector("registerusernotificationsettings:") { let usernotificationtypes = uiusernotificationtype.alert | uiusernotificationtype.badge | uiusernotificationtype.sound let settings = uiusernotificationsettings(fortypes: usernotificationtypes, categories: nil) application.registerusernotificationsettings(settings) application.registerforremotenotifications() } else { let types = uiusernotificationtype.badge | uiusernotificationtype.alert | uiusernotificationtype.sound application.registerforremotenotifications(types) } return true after you've followed parse tutorial setting push notifications , certificates apple developer console, make sure appdelegate.swift lo

java - Android: Change canvas clipBounds -

i trying to draw custom slider has tooltip fades in , out on touch events. having trouble canvas clip bounds. tooltip placed above slider, giving negative canvas coordinates, should fine since replace clip bounds on every ondraw. when running on lenovo tablet works expected, on google nexus 7 odd happens. clip bound acknowledged first ondraw (i have tried filling canvas solid color see size) , after that, though debugging says clipbounds correct, outside original clipbounds clipped. does know causing behaviour?

wix - How to prevent unauthorized MSI installation? -

i have 2 versions of same msi package: 'genuine' , 'developer'. former intended shipping, whereas latter built on developers' computers sake of testing, etc. want prevent accidental leaking of 'developer' version, end user couldn't have installed. possible approaches? the msi built wix, in case. i've seen securing msi prevent unauthorized use , answers there focused on preventing launch not installation. don't need obfuscate, encrypt or protect package contents. need protect unqualified users accindentally screwing things on machines, due erroneous packages being installed. honestly, because msi open book ( edit orca ), it's best type of enforcement (drm) in application @ runtime. suggest sorts of techniques in msi removed knowing doing. what "leaking" concern? not trust developers? not trust cm / release practices? have strong nda in place? proper security?

regex - R Split string data delimited by spaces into columns -

i have large data frame 1 column, containing different numeric values separated spaces, need extract , organize in columns <call begin=6.0982886400000051 end=6.1078732800000051 maxfreq=40893.5546875 minfreq=35400.390625 peakfreq=39672.8515625 peakfreqs=39672.8515625 39672.8515625 39672.8515625 39672.8515625 39672.8515625 39672.8515625 39672.8515625 39672.8515625 39672.8515625 39672.8515625 39672.8515625 39672.8515625 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 39062.5 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 38452.1484375 37841.796875 37841.796875 37841.796875 37841.796875 37841.7968