Posts

Showing posts from July, 2012

Docker: save internal hd contents -

is there way save contents of container's "internal" hd. have tried use docker commit when shut down container , turn on again, contents have downloaded or generated inside container (logs, etc) gone. when start container use docker start or docker run ? docker run -i -t docker/image /bin/bash start new container information original imagefile. docker start {dockercontainerid} restart running container. can list of previous dockers docker ps -a if have save docker docker commit {runningdocker} docker/image2 use new image name. ie `docker run -ti docker/image2 /bin/bash

how to filter the list written in bracket in blackberry? -

i using link place holder text on autocompletefield in blackberry i want filter list when user wite on text field .current filter first text of string array .example if write "f" filter "friday" want should filter whatever text written in bracket example if have select "m" .if show "wednesday-(man)", string[] days = {"monday(tas)","tuesday-(paq)","wednesday-(man)", "thursday","friday","saturday","sunday(i_)"}; customautocompletefield.java package mypackage; import net.rim.device.api.collection.util.basicfilteredlist; import net.rim.device.api.collection.util.basicfilteredlistresult; import net.rim.device.api.system.application; import net.rim.device.api.ui.color; import net.rim.device.api.ui.graphics; import net.rim.device.api.ui.component.autocompletefield; import net.rim.device.api.ui.component.listfield; class customautocompletefield

data binding - View updates everywhere but in current controller - angularJS -

edit: asked, i'll explain bit more efficiently ! i've been sitting in front of annoying problem recently, whenever update value inside directive, controllers i'm not "in" ones updated properly. scenario example: profile page made of 2 controllers. navbar_controller displaying user name : <div ng-if="auth.isauthenticated">hello, {{auth.getcurrentuser().name}}</div> the second controller , profile_controller here update user values. simple function in angular first controller, updates currentuser: $scope.updateuser = function (type, form) { if (!$scope.modif) return ; $http.put('/api/users/' + auth.getcurrentuser()._id + '/update', {type:type, modif:$scope.modif}) .success(function (data, status) { $scope.user = auth.setnewuser(data); }) .error(function () { console.log("error"); }); }; when update, exampl

css - I need to decrease the size of the header background color -

how can decrease size of header in logo class? logo contains name " pied piepr". background image quite big in header. tried decreasing height attribute didnt work. style sheet: body{ margin: 100%; margin: 0; } .container{ position: relative; height: 50px; width: 1100px; } .masthead{ background: #4fc3f7; width: 100%; top: 0; position: fixed; color: white; } .logo{ position: relative; float: left; left: 90px; font-family: josefin slab; font-size: 21px; } a:link {color: white; text-decoration: none; } a:visited {color: white; text-decoration: none; } a:hover {color: white; text-decoration: none; } a:active {color: white; text-decoration: none; } li{ position: relative; left: 155px; list-style: none; font-family: raleway; float: left; margi

cpu - Shortest Remaining Time Scheduling -

can results of shortest remaining time schedule same preemptive , non preemptive? like, can still same times @ end of both or impossible? it not impossible.it depends on arrival time , burst time of processes. for example:if have processes following arrival time , burst times. p1 1,2 p2 2,4 p3 3,5 it gives same result,be preemptive or non preemptive.

SQL server and PHP - specify datetime format -

i have table datetime columns. in sql server management studio, can see date in yyyy-mm-dd hh:mm:ss.mmmm format, when select data php mssql extension , - srp 1 2014 12:00:00:000 (instead of 2014-08-01 12:00:00.000 ). is there way change datetime format? (i don't want parse localized datetime in php.) so found solution... ini_set("mssql.datetimeconvert", "off"); it turns off localized datetime formatting in mssql extension , datetime yyyy-mm-dd hh:mm:ss , suitable me.

fft - Why the model "FourierAnalysis" does not run on OpenModelica? error: lvalue required as unary '&' operand -

the test model "testsine" package "sensors.tests.fourieranalysis" xogeny library: https://github.com/xogeny/sensors not run on openmodelica. the error message is: "error: lvalue required unary '&' operand". in c-file generated openmodelica, message error lines: infostreamprint(log_events, 0, "reinit $panalysis$pai$lb1$rb = %f", 0.0); copy_real_array_data_mem(&0.0, &$panalysis$pai$lb1$rb); i don't understand message , want use block "fourieranalysis" openmodelica. it implementation bug in openmodelica; has been fixed in r22261 . note: bug reports should ideally reported https://trac.openmodelica.org/openmodelica/newticket

PHP: exceptions vs errors? -

maybe i'm missing somewhere in php manual, difference between error , exception? difference can see errors , exceptions handled differently. causes exception , causes error? exceptions thrown - intended caught. errors unrecoverable. lets instance - have block of code insert row database. possible call fails (duplicate id) - want have "error" in case "exception". when inserting these rows, can this try { $row->insert(); $inserted = true; } catch (exception $e) { echo "there error inserting row - ".$e->getmessage(); $inserted = false; } echo "some more stuff"; program execution continue - because 'caught' exception. exception treated error unless caught. allow continue program execution after fails well.

Python module Numpy install -

i using python 2.5, download numpy 1.9.0 https://pypi.python.org/pypi/numpy . not sure should put module, hope can me. extract numpy , go extracted folder, there should setup.py file there. execute python setup.py install install numpy package. while way, rather suggest use pip install package. should not worry dependency.

javascript - nested tables columns equal width -

i have nested table , here's working demo, http://jsfiddle.net/zwda3/ <table class="table"> <tr class="accordion-toggle" data-toggle="collapse" data-target="#test"> <td>some text</td> <td>1337</td> <td>some text</td> <td>some text</td> </tr> <tr> <div class="accordian-body collapse" id="test"> <table class="table"><tr><td>some text</td> <td>1337</td> <td>some text 354325252352352</td> <td>some text</td></tr> </table> </div> </tr> it works fine need have child table columns have same width parent table. is possible? in case want use tables case, should set table layout fixed , set column width both parent , child tables. .table { table-layout: fixed; width: 600px; } .table >

c# - This property cannot be set to a null value error .NET 4.0 -

i'm developing website on .net 4.0 mvc4 mysql database , , getting "property cannot set null value" error. description: i have several tables in mysql database, , of them contain nullable properties (most of them strings). then, in .net project, have .edmx file, created using wizard, file made automatically, database had. but while testing, got error mentioned. did little reaserch , found out problem this: _propertyname = structuralobject.setvalidvalue(value, false); that line, verifies value of property not null, though 'nullable' checkbox checked on database client (heidisql in case). temporary solution found if change 'false' 'true' in line, works. looks this: _propertyname = structuralobject.setvalidvalue(value, true); the problem have lots of nullable properties in different tables, need find way make entityframework understand want properties allow null value, without having search every field in designer , change manually.

vba - Excel - Copy Conditional Formatting, Remove Rules, Keep Format -

i know show you've tried in question, more of "do have routine this?" question , i'm hoping you'll willing let slide... i'm working on macro copies cells conditionally formatted in source worksheet , pastes them output sheet. basically, i'm looking keep formatting, shading, etc, remove conditions (make current formatting static) in output sheet. i've seen solutions online - ranging copying first word document , pasting back, looping through output cells , copying format-element format-element - , looking good, efficient way this. does have 1 / link they'd willing share?? (excel 2010) thanks!!!! yes possible :) need change formatting of cells plan copy mimicking displayformat , deleting conditional formatting sub keep_format() dim ws worksheet dim mysel range, acell range '~~> change relevant sheet set ws = thisworkbook.sheets("sheet1") '~~> change relevant range set mysel =

php - how to create a variable using an array? -

this code $get_favory = mysql_query("select * favory user1='$username'"); $values = ""; while($fav = mysql_fetch_assoc($get_favory)) { $user2 = $fav['user2']; $values = " or added_by='".$user2."'"; } echo $values; the values variable must : or added_by='zac' or added_by='john' or added_by='emily' result : or added_by='zac' what have do? why code not working you're overwriting variable every time instead of appending new value. solution replace $values = " or added_by='".$user2."'"; with $values .= " or added_by='".$user2."'"; don't use mysql_ extension mysql_ extension deprecated. should use mysqli_ instead. code should be: $connect = mysqli_connect(host,username,password,db_name); $get_favory = mysqli_query($connect,"select * f

jquery - datepicker reads month as date in dd/mm/yy format -

i using jquery datepicker in jqgrid datepicker reads month date in dd/mm/yy format. mean is, when user selects date, date shown correclt in dd/mm/yy format date passed structs action date setter method in date object based on mm/dd/yy format. see below code: <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1" %> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" media="screen" href="${pagecontext.request.contextpath}/css/jquery-ui.min.css"/> <link rel="stylesheet" type="text/css" media="screen" href="${pagecontext.request.contextpath}/css/ui.jqgrid.css&

ruby on rails - Factory girl association with more than one trait -

i have association : association :address, :factory => [:address, :closer_address] where factory this: factory :address address1 "12 street" latitude 22.4583397 longitude -11.06776 state 'pending_verification' trait :closer_address latitude 33.4783397 longitude -11.06776 end trait :verified state 'verified' end end so can somehow create association more 1 trait? or there way around it? idea want have closer_address verified, , in case might want closer_address not verified, that's why keeping them separate. any ideas? you have 2 different trait options: factory :address address1 "12 street" latitude 22.4583397 longitude -11.06776 state 'pending_verification' trait :closer_address latitude 33.4783397 longitude -11.06776 end trait :verified_closer_address latitude 33.4783397 longitude -11.06776 state 'verified'

angularjs - Angular translate decimal numbers -

i using angular-gettext project. wondering if somehow translate decimal numbers. fx in languages write 2.5 , other 2,5. have idea if doable via angular-gettext? what other workaround there be? angular-gettext doesn't you, if combine built-in $locale service angular.js, should work. you're looking number filter.

Fill javascript array using jstl array -

i have jstl array with, <sql:query var="list_str" datasource="${myds}"> select * str; </sql:query> now want fill single column content of table str in javascript array. trying this. <c:foreach items="${list_str.rows}" var="user" varstatus="status"> var val = ${user.name}; fruits.push(val); </c:foreach> but, fruits array value empty, can please guide how accomplish this. you don't need var val , need quotes around become hard-coded string literal in resulting javascript code. <c:foreach items="${list_str.rows}" var="user" varstatus="status"> fruits.push('${user.name}'); </c:foreach>

websphere portal - Shared element value for use in content items -

Image
i have 2 content items inside custom wcm library. ( ibm portal ) both of have element, inherited authoring template use. element called url , has default value in authoring template , of google.com . if change value within test , or within authoring template after 2 content items created not update value used in both content items. how setup such variable/value? used in both content items , use latest updated value. 1) select created content items 2) press more button - > apply authoring template 3) select authoring template 4) set update existing values checkbox/ add new field, added (or similar) 5) press ok

c++ - Convert EMF to BMP (Metafile to Bitmap) using Windows Imaging Component -

i have .emf file want convert bitmap in legacy vc++ 6.0 code. i've been looking through wic documentation , i'm surprised haven't seen way this. am missing something? if wic ends not supporting this, there method programattically load .emf file cbitmap object? there's no need wic. it's built core of windows in form of playenhmetafile . so, picture bmp, select bmp dc, playenhmetafile on dc, , result go bmp. note isn't converting metafile bmp--it's rendering metafile bmp. say, metafile (usually) resolution independent. example, may specify line logical coordinate (0,0) (100, 100). when render bmp, line rasterized @ specific resolution. if later wanted same picture @ higher resolution, metafile provide it, rendering in bmp couldn't/can't.

java - Not supported In Simulator for jar file (CodeName One) -

i created application uses mediarecorder, creates file in application directory , records it, worked fine. later decided make desktop version of without sending build server following instructions found here app working fine, don't think recording, infacts throws null pointer exception , file path shows when try show dialog file://homeaudiosample1410359700375. makes me know seems behaving running in simulator. decided run jar command prompt , got error: not supported in simulator. solution want app run on non-mobile platform, or there no other way around except sending build server. media recorder isn't supported in javase port of codename one. you can use native interface implementation javase support. media problematic desktop java...

How to test that Availability set is working in Azure? -

i have 2 virtual machines in same availability set under azure. let´s call them , b. have created first, cloned vhd , created b that. can connect both using rdp , both same. both under same domain xxxxx.cloudbox.net cloud service says. i have domain testab.com pointing the common ip of both, let 10.0.0.1 example. can connect testab.com without problem. as far understand, if turn off a, should able connect b in transparent way. not working , when try testab.com, b doesn´t it. ideas? an availabilty set not same thing load balancer. when talk connecting in transparent way think mean through load balancer. in case need set azure calls load balanced endpoints on each vm, port 80. should able connect via http both vms "transparently". keep in mind failover not instantaneous.

rest - HTTP response code for stale pagination -

i have web service runs sql query, sorted 1 of several columns, , returns single requested page (as in skip m limit n). ui in front of follows 'load more' pattern, accumulating loaded pages of results in 1 view. the problem new , deleted records, can happen @ time, causing result of 'load more' wrongly aligned, , depending on sort being used, obscuring new records should shown. in addition automatic refresh on timer in frontend, i'm going add timestamp field restful request , response format allow webapp detect view should reloaded on 'load more' call. my question is, http status code best fit signal? in reviewing codes don't see exact fit. thought of using 302 found link 'page 1', wonder if might cause unwanted caching of redirect. thought of 400 bad request , there's nothing wrong request, it's data needs reloaded. pages served post /path call requested page provided in json body. i'm not complete purist, make wo

Powershell Kill all processes except system -

in powershell, kill processes users, except explorer , processes used system this including errors given: $cred = get-credential; invoke-command -computername localhost -credential $cred -scriptblock { get-process $env:allusersprofile | where-object -filterscript {$_.name -ne "system, network service, local service"} | where-object -filterscript {$_.name -ne "explorer"} | stop-process -whatif } cannot find process name "c:\programdata". verify process name , call cmdlet again. + categoryinfo : objectnotfound: (c:\programdata:string) [get-process], processcommandexception + fullyqualifiederrorid : noprocessfoundforgivenname,microsoft.powershell.commands.getprocesscommand + pscomputername : localhost here, should work you. function stop-userprocesses{ param([string]$computer = "localhost") $cred = get-credential invoke-command -computername $computer -credential $cred -scriptblock { ge

Javascript scrollTo for HTML Frames or alternative -

to start, know people hate frames, least energy best result pages have no control over. just example: <html> <head> <title>test page</title> <script type="text/javascript"> function scrollframe() { document.frames["home"].scrollto(0,90); document.frames["video"].scrollto(0,90); document.frames["apps"].scrollto(0,90); } </script> </head> <frameset rows="30%,30%,*"> <frame name="home" src="www.cwtv.com" scrolling="auto" frameborder=0 /> <frame name="video" src="www.cwtv.com/cw-video" scrolling="auto" frameborder=0 /> <frame name="apps" src="www.cwtv.com/apps" scrolling="auto" frameborder=0 /> </frameset> <body onload="scrollframe();"> </body> </html> i have no idea how incorporate scrollf

c# - Inheriting from JqGridHelper in Lib.Web.Mvc plugin to override a property keeps throwing errors -

i using lb.web.mvc plugin tpeczek , has been working great, have noticed in of grids seem overriding default value wanted permanently change these settings save self having type them out. according tpeczek way deliver own jqgridoptions , use proper jqgridhelper so first thing did @ stock jqgridhelper class , copy/past new class myjqgridhelper failed error must declare body because not marked abstract, extern, or partial here code using gave error: public class jqgridhelper<tmodel> : ijqgridhelper { public jqgridhelper(jqgridoptions<tmodel> options, object subgridhelper = null); public jqgridhelper(string id = "grid", string afterinsertrow = null, string aftereditcell = null, string afterrestorecell = null, string aftersavecell = null, string aftersubmitcell = null, string altclass = "ui-priority-secondary", bool altrows = false, bool autoencode = false, bool autowidth = true, string beforerequest = null, string beforeselect

asp.net mvc - mvc file upload and database insert -

i'm getting head wrapped around mvc in .net using vs 2013. i need little direction in regards uploading file (which easy) inserting data image database. want allow end user enter description, title etc. file being uploaded. on back-end want add meta data 'date created', 'path file', 'category', , file name , couple other pieces of data presenting files in views. don't want insert files in db use path in generated html point physical file end user can view or download it. multiple file types being used, audio, video, documents, images. i can file upload work writing controller accept file, , end user input, add other fields need database user never sees i'm stuck. blending file upload user fields , beack end data confusing me on how pieces work together. so in short getting file upload + user input + non-user input values in same view, controller, , model need direction on. you have upload image plus data in multi-part form. in v

c - buffer associated with input file stream -

this question has answer here: is there anyway peek @ stdin buffer? 3 answers how can see contents of buffer assocaited input file stream(stdin) . suppose if giving input using scanf, getchar or input function how getting stored in buffer. when press "enter" key . example: case:1) $ input 2 integers: 10 20 (enter) $ input 2 integers: 10(enter) 20(enter) case 2: $enter 2 characters b(enter) $enter 2 characters a(enter) b(enter) why in case 1 ignoring spacebar(asci-32) in case2 taking spacebar next input. propert of scanf function or terminal . in first case here ignoring space bar because, according ascii character set " space " character ascii value in decimal 32. when "%d" encounters value 32 ignores because cannot integer since integer literals have range between 48(0) , 57(9). whereas in second case

Sass mixins are not replacing variables -

i'm trying use sass mixin automatically use vendor-prefixes on animations. mixin: @mixin keyframes($name) { @-o-keyframes $name { @content }; @-moz-keyframes $name { @content }; @-webkit-keyframes $name { @content }; @keyframes $name { @content }; } now if include this: @include keyframes(test) { { opacity: 0; } { opacity: 1; } } the resulting css looks this: @-o-keyframes $name { ... } @-moz-keyframes $name { ... } @-webkit-keyframes $name { ... } @keyframes $name { ... } sass not replacing $name test . known bug or there workarounds? couldn't find related problem. i'm using sass version 3.4.1 way. change $name #{$name} in mixin @mixin keyframes($name) { @-o-keyframes #{$name} { @content }; @-moz-keyframes #{$name} { @content }; @-webkit-keyframes #{$name} { @content }; @keyframes #{$name} { @content }; } demo

javascript - How to send Push Notifications with Parse.com Cloudcode -

i want send push notification cloudcode on parse.com. the push notification should sent android devices subscribed specific channel , trigger service. all need installation query, along accompanying push. example: var pushquery = new parse.query(parse.installation); pushquery.containedin("user", userlist); parse.push.send({ where: pushquery, data: { alert: "your push message here!" } }, { success: function() { response.success("pushed"); }, error: function(error) { reponse.error("didn't push"); } }); that installation query can query based on channel, , there other specifications can make push query, given in documentation: parse docs

Unsigned char * data as return type of a function in c++ or c -

this question has answer here: can turn unsigned char char , vice versa? 6 answers i using visual studio 2010 clr(common language run time). want return unsigned char * compress function main function both unsigned char * , char * giving erro "error 7 error c2440: '=' : cannot convert 'char *' 'unsigned char *' f:\4-2\thesis\project\database compression main\database compression 2\db_comp_main.cpp 21 " unsigned char* compressor(char *data) { unsigned char *compressed_string; //with process had compressed string of data variable unsigned char* in variable compressed_string , printed here. want return here. return compressed_string; } int main() { unsigned char *main_data; main_data=compressor("muhammad ashikuzzaman.student khulna university of engineering , technology bangladesh");// when click e

html - zoom content of iframe in webapp -

the content want display not optimized mobile device. need zoom content out. it webapp, can not use javascript. this is, use: <div style="-webkit-overflow-scrolling: touch;overflow-x:hidden;overflow-y: auto;height:400px; margin: -1.2em;"> <iframe src="http://..." style="width:100%;height:390px;border: none;"></iframe></div> for zoom found: -webkit-transform: scale(0.8); so tried: <div style="-webkit-overflow-scrolling: touch;overflow-x:hidden;overflow-y: auto;height:400px; margin: -1.2em;-webkit-transform: scale(0.8);"> <iframe src="http://..." style="width:100%;height:390px;border: none;"></iframe></div> but result was, iframe zoomed too. see: http://imgur.com/yuet0mb can me? thank , br ok solved it i used <div style="-webkit-overflow-scrolling: touch;overflow-x:hidden;overflow-y: auto;height:800px; width:850px; margin: -1.2em;

javascript - hide a specific ng-option if it's id already exists in array -

i have drop down adds items on page binded $scope. want make sure don't add doubles array idea ng-hide option if exists in array. don't know if it's possible because ng-options inside select dont know if can append ng-hide them in first place. regardless, if possible, hide option if it's id exists in scope. i thinking loop through each , check, here attempt $scope.checkifexist = function () { var ifexist = false; angular.foreach($scope.promptsplease, function (data) { if (data.id == $scope.promptsplease.id){ ifexist = true; } }); return ifexist; }; and select in controller looks like <select ng-model="fadingselected" ng-options="type.name type in fadingtypes track type.id" ng-hide="checkifexist()"> </select> i don't know if possible, , think might approaching wrong. idea cannot add same 1 twice array that's binded scope. doesn't have ng

How to get information panel of a storyboard in XCode 6 -

i new xcode. using xcode ios development. after following tutorial, http://jamesonquave.com/blog/developing-ios-apps-using-swift-tutorial-part-2/ i can't see information panel main storyboard (the rightest panel) in above screenshot. and storyboard poped out, how can unpop out? thank you. you need go in menu "view -> utilities -> show utilities"

scala - Creating instances of a covariant type class from instances of a non-covariant one -

suppose i've got simple type class instances give me value of type: trait givemejusta[x] { def apply(): x } and i've got instances: case class foo(s: string) case class bar(i: int) implicit object givemejustafoo extends givemejusta[foo] { def apply() = foo("foo") } implicit object givemejustabar extends givemejusta[bar] { def apply() = bar(13) } now have similar (but unrelated) type class same thing covariant in type parameter: trait givemea[+x] { def apply(): x } in companion object tell compiler how create instances instances of our non-covariant type class: object givemea { implicit def fromgivemejusta[x](implicit giveme: givemejusta[x]): givemea[x] = new givemea[x] { def apply() = giveme() } } now i'd expect implicitly[givemea[foo]] compile fine, since there's 1 way givemea[foo] given pieces have here. doesn't (at least not on either 2.10.4 or 2.11.2): scala> implicitly[givemea[foo]] <console>:16: this.givem

javascript - Flatmap concurrency limit (like bacon.js)? -

i'm looking @ rxjs docs bacon's flatmapwithconcurrencylimit , don't see anything. idea if it's available in rx or not? in rx.net there's merge operator accepts maximum concurrency parameter. essentially, semantics same selectmany (a.k.a., flatmap ) concurrency limit. it seems rx.js defines overload well: merge .

connection - Python's urllib2 won't connect... to anything -

i can ping , can see google.com in browser same machine, when try use urllib2.urlopen(url) fails. why? tmac:~ torobinson$ ping google.com ping google.com (4.35.2.172): 56 data bytes 64 bytes 4.35.2.172: icmp_seq=0 ttl=57 time=2.536 ms 64 bytes 4.35.2.172: icmp_seq=1 ttl=57 time=1.447 ms 64 bytes 4.35.2.172: icmp_seq=2 ttl=57 time=1.415 ms ^c --- google.com ping statistics --- 3 packets transmitted, 3 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 1.415/1.799/2.536/0.521 ms tmac:~ torobinson$ python python 2.7.3 (v2.7.3:70274d53c1dd, apr 9 2012, 20:52:43) [gcc 4.2.1 (apple inc. build 5666) (dot 3)] on darwin type "help", "copyright", "credits" or "license" more information. >>> import urllib2 >>> urllib2.urlopen('http://google.com') traceback (most recent call last): file "<stdin>", line 1, in <module> file "/library/frameworks/python.framework/versions/2.7/lib/p

c# - Linq ForEach() not populating fields -

i'm having trouble trying calculate 3 fields on model using foreach() , linq. query returns "activities" specific issue. 1 of fields "timespent", long . it's time spent on item in milliseconds. i'm trying show days, hours, , minutes based on "timespent" field, each activity. here's model: public class activitygridmodel { public datetime activitydate { get; set; } public string activitytype { get; set; } public string notes { get; set; } public string enteredby { get; set; } public long timespent { get; set; } public int days { get; set; } public int hours { get; set; } public int minutes { get; set; } } this query built: var activities = in session.context.activities join @ in session.context.activitytypes on a.activitytypeid equals at.activitytypeid join u in session.context.users on a.createdbyuserid equals u.userid

ios - iOS7 how to programmatically show black screen for iPhone multitasking screen? -

Image
this question has answer here: controlling screenshot in ios 7 multitasking switcher 8 answers i'm working on medical app , prevent information user being saved onto multitasking screen. some apps, bank of america show black screen app when user toggles multitasking mode (double tap home). is there away me app show black on multitasking screen, regardless of how app terminated? maybe there xcode plist option exclude app's screenshot being saved multitasking menu? will monitoring app delegate's lifestyle events , replacing topmost screen black enough guarantee no info being saved multitasking screen? bank of america show black screen in middle below: according apples documentation can prevent snapshots being taken using ignoresnapshotonnextapplicationlaunch : if feel snapshot cannot correctly reflect app’s user interface when app re

c# - MDI MdiWindowListItem OnClick -

i have basic mdi form, "window" menu option generated default. can open child windows , under window shows expected. problem is, child windows different heights , widths. when open child windows originally, can resize mdiparent width , height of child. my problem exists when clicks on child menu under "window" menu. i'm trying figure out how capture that, can resize mdiparent size of child windows, since isn't controled me. i've looked around mdiwindowlistitem , onclick no luck. i'm assuming can override, not sure override. ever done this?

java - Search Student in File -

i search in input file student s. here overview of work far. class student , setters, getters , display method (print) class studentfile import java.io.*; import java.util.arraylist; public class studentfile { public void trouver(int id) { try { file file = new file("c:/users/akram/documents/akram.txt"); bufferedreader read = new bufferedreader(new filereader(file)); string str; while((str=read.readline())!=null) { student s; if(s.getid()==id) system.out.println(s.print()); } read.close(); } catch(ioexception e) { system.out.println(e); } } } this method display nothing, , i'm not sure why. have insight? you reading lines file , assigning content str , never value. also, student seems empty. supposing file includes id of student: bufferedreader read = new bufferedreader(new filereader(file)); str

php - security issue with app loaded within iframe -

i'm working on application loaded inside iframe within other web page. when user launches application got request app one: www.mypage.com/?user=1234 then app redirects user to https://login.host.com/oauth2?response=code&client_id=my_app_id&scope= & redirect_url=www.mypage.com/?index/loadapp given user id used check if there token in db, if not - received code used receive new access token. question following: how prevent calls aren't going i-frame on www.host.com? request "www.mypage.com/?user=1234" can seen in firebug console, so, if manually enters url in browser, can launch app random user. whats more, if there found such token in db, person see random user data! i use request signing requests. dont know first request (www.mypage.com/?user=1234). whats best practice in such cases? thanks! your problem is, in essence, site isn't using authentication first request! need come scheme other web page sign request, , verify si

javascript - Is there a definitive approach to a flicker-less scrolling parallax? -

anyone that's ever worked on scrolling parallax has run sort of flickering on 1 or more of major browsers. , if issues solved using workaround, browser updates might still bring flickering back. what want know whether has found definitive solution or @ least recommended way of achieving parallax effect without suffering this. i aware fixed backgrounds , elements don't aren't affected, in many occasions they're not option. i did extreme experiment once. replaced scrollbar custom 1 , then, instead of listening scroll event , updating elements styles, first update elements , set scrolltop, when scroll rendered object have new style values. not stop flickering on chrome. i start project featuring scrolling parallax effects , i'd avoid having deal bug reports regarding flickering or having tell client can't use native scrollbar. any suggestions?

exception - play activator - runtimeException: smtp.host needs to be set in application.conf in order to use this plugin (or set smtp.mock to true) -

i trying run play activator template named "playstartapp". but, giving me following runtime exception: runtimeexception: smtp.host needs set in application.conf in order use plugin (or set smtp.mock true)\ java.lang.runtimeexception: smtp.host needs set in application.conf in order use plugin (or set smtp.mock true) com.typesafe.plugin.commonsmailerplugin$$anonfun$4.apply(mailerplugin.scala:329) com.typesafe.plugin.commonsmailerplugin$$anonfun$4.apply(mailerplugin.scala:329) scala.option.getorelse(option.scala:120) com.typesafe.plugin.commonsmailerplugin.mailerinstance$lzycompute(mailerplugin.scala:329) com.typesafe.plugin.commonsmailerplugin.mailerinstance(mailerplugin.scala:326) com.typesafe.plugin.commonsmailerplugin.onstart(mailerplugin.scala:343) play.api.play$$anonfun$start$1$$anonfun$apply$mcv$sp$1.apply(play.scala:91)` tried both: - set mail.smtp=mock - mail.smtp.host=smtp.gmail.com mail.

javascript - how to make iframe open in new window -

i have problem iframe flickr. i have website in embed iframe flickr in order display gallery without having worry creating slider , resizing pictures , extracting thumbnails. also since website friend of mine wants able change pictures on own without having ask me time change website. so solution use iframe flickr created galleries , embeded galleries website. this code: <div class="six columns"> <iframe src="https://www.flickr.com/photos/127583121@n07/15148138666/in/set-72157647343739461/player/" width="500" height="281" frameborder="0" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe> </div> my problem when viewer clicks on image redirected flickr website therefore gone site. is possible make when user clicks on iframe open flickr website in new browser window user not lost site? thank in advance try this: <div c

oracle11g - Oracle client server connectivity issue -

i have installed multiple oracle (homes) clients on server including 10g , 11g . when using sql plus 11g client getting error "tns:protocol adapter error." checked tnsnames.ora resolve issue. found tnsnames.ora in network/admin directory 11g home having values identical different tnsnames.ora on different server able connect server. know default tnsnames.ora entire system not sure can find it. tried tnsping orcl got error "tnsping not recognized internal or external command". new oracle, please help

The HTML content inside JEditorPane has blue background in Java -

have desktop email client program i'm working on in java , want show incoming mail content inside jeditorpane. i've created htmleditorkit , set editor kit jeditorpane control this: editorpane.seteditorkit(htmleditorkit); , messages, works fine others, shows background blue-colored one. tried add stylesheet rule kit, didn't work. have been problem? comments welcome. edit: jeditorpane txtcontent = new jeditorpane(); txtcontent.seteditable(false); txtcontent.setbackground(color.white); txtcontent.setbounds(316, 110, 598, 545); kit = new htmleditorkit(); txtcontent.seteditorkit(kit); htmldocument doc = (htmldocument)kit.createdefaultdocument(); txtcontent.setdocument(doc); txtcontent.settext("html content here....."); when put "html content here....." part inside html file notepad, shows right thing. but when put exact same content inside jeditorpane above, shows different styling(blue background).

root - Trying to reboot programmatically rooted Android device -

i'm trying reboot programmatically galaxy s3. things i've tried: try { process proc = runtime.getruntime().exec(new string[] { "su", "-c", "reboot" }); proc.waitfor(); } catch (exception ex) { log.i("rebootactivity", "could not reboot", ex); } try { runtime.getruntime().exec(new string[]{"su","-c","reboot now"}); } catch (ioexception e) { e.printstacktrace(); } try { process process = runtime.getruntime().exec("su"); dataoutputstream os = new dataoutputstream(process.getoutputstream()); os.writebytes("reboot now\n"); } catch (throwable t) { t.printstacktrace(); } do guys have idea how accomplish this? thanks. try 1 normal string looking 《su \n reboot; \n》 instead of array. try answer shell, helps lot debugging. what permissi