Posts

Showing posts from January, 2013

benchmarking - Data-type mismatch Error “UC_OBJECTS_NOT_CONVERTIBLE” in SAP-ABAP -

Image
error in sap-abap absolutely new in sap-abap, running sap benchmark getting error while clients executes. error “uc_objects_not_convertible” the statement “move src dest” needs same data-type both src & des proper execution. in case abap code has line error in “ system-call solid pointer move ole2_obj_pointer ole_handle. ” wherein source , destination have different datatypes data type mismatch in source , destination objects ole2_obj_pointer type ole2_pcb data ole_handle type ole2_object.

ios - How to Upload Video on twitter using twitvid but it is not working -

i want upload video on twitter , use twitvid sample code and create app on account , generate tokens , ids required in demo , set in demo when execute code , select video library , send request going failed below error domain=nsurlerrordomain code=-1003 "a server specified hostname not found." userinfo=0x79e30350 { nserrorfailingurlstringkey=http://im.twitvid.com/api/uploadpic, _kcfstreamerrorcodekey=8, nserrorfailingurlkey=http://im.twitvid.com/api/uploadpic, nslocalizeddescription=a server specified hostname not found., _kcfstreamerrordomainkey=12, nsunderlyingerror=0x7b6be260 "a server specified hostname not found." } still i'm working on demo b'coz if demo not work y code in actual app. sample code not working after creating app in twitter developer site , client,tokens , app id , set in sample code still give above error y? don't know. if 1 done plese give me suggession. judging provided error, looks url using wrong.

Can't access property in PHP date object -

this question has answer here: why can't access datetime->date in php's datetime class? bug? 4 answers i'm creating datetime object with: $datetime = date_create_from_format('y-m-d\th:i:sp', $string); which gives object properties date , timezone_type , , timezone . can't access of these properties: return $datetime->date; this returns null . doing wrong? edit: var_dump($datetime) gives: object(datetime)#807 (3) { ["date"]=> string(19) "2015-04-14 13:28:06" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } there bug issue regarding in php. cant access directly. use format method. try - $datetime->format('y-m-d h:i:s')

for loop conversion from C to Python -

how can write for loop in python write in c: for(i=0;i<10;) { if(i%2==0) i=i+3; else i++; printf("%d\n",i); } can tell me this? searched lot couldn't find it. wrote in python: for in range(0,10): if (i%2==0): i+=3 else: i+=1 print output: 3 2 5 4 7 6 9 8 11 10 expected output: 3 4 7 8 11 can explain reason of output? to write same loop in python: i = 0 while < 10: if % 2 == 0: += 3 else: += 1 print which gives: 3 4 7 8 11 note that, per the tutorial : the for statement in python differs bit may used in c or pascal. rather iterating on arithmetic progression of numbers (like in pascal), or giving user ability define both iteration step , halting condition (as c), python’s for statement iterates on items of sequence (a list or string), in order appear in sequence. in python for loop, changes loop variable ( i , in case) occur durin

Loop through folder using array to find lastest version (count) with VBA? -

i have attached code, however, find files present in folder. want have incremental counter files. thing version start else 0 or 1, e.g. 3. amesto non suppliers test w20-3 an want next string 4. i using this, work if 1 first, etc. stuck. ' version check while len(dir(strpath2 & "amesto non suppliers test w" & week & "-" & version & "*.cif")) <> 0 version = version + 1 strpath = getdirectorypath & "amesto non suppliers test w" & week & "-" & version & " " & username & ".cif" loop sub loadversion() dim myfile string dim counter long 'create dynamic array variable, , declare initial size dim directorylistarray() string redim directorylistarray(1000) 'loop through files in directory using dir$ function myfile = dir$("c:\users\niclas.madsen\desktop\ap\wave3\cif\*.*") while myfile <> "" dire

jquery - Bootstrap customize carousel blurry thumbnail -

Image
i wanted make clear can see on picture thumbnail blurry wanted make clear image. , arrow on thumbnails close end picture. <div class="col-sm-12" style="padding:0px !important;"> <div id="mycarousel" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <div class="item active"> <img src="" class="crsl-img"> </div> <div class="item"> <img src="http://placehold.it/350x250/00ffff/000&amp;text=product+image+2" class="crsl-img"> </div> <div class="item"> <img src="http://placehold.it/350x250/ff00ff/fff&amp;text=product+image+3" class="crsl-img"> </div> <div class="item"> <img src="h

javascript access class method without initializing object -

i have class foo , can access public method bar out initializing fooobj var foo = function(){ this.bar = function(){ console.log("i bar"); } } i know can access bar var fooobj = new foo(); fooobj.bar(); in other object oriented language jave if declare bar static can access class name foo.bar there no static concept java can like var foo = function(){ // constructor specific code } foo.bar = function(){ console.log("i bar"); } this how singleton defined in javascript

javascript - Updating a label based on the selected option using Dojo -

i have specific requirement using dojo framework: based on selected option ( <option> ) need update label ( <label> ). i did not find dojo, found similar code using javascript/jquery. example: http://jsfiddle.net/godinall/pn8hz/ can tell me how achieve same thing using dojo? well, if plain javascript works you, can use plain javascript well. if add ids dom elements, use dojo/on , dojo/dom modules, example: require(["dojo/dom", "dojo/on", "dojo/domready!"], function(dom, on) { var myselect = dom.byid("myselect"); on(myselect, "change", function() { dom.byid("mylabel").innerhtml = myselect.value; }); }); otherwise, use jquery-a-like syntax using nodelists , dojo/query : require(["dojo/query", "dojo/nodelist-manipulate", "dojo/domready!"], function(query) { query("select").on("change", function() { query("

ruby on rails - Creating an object and assigning it an associated object to it from a different model -

i have tools , projects in database. projects belong tools & 1 tool has 1 project. have numerous tools in database. when creating project want able assign tool well. tricky thing tool referenced tool_id in database while users know tool's names. so when create project want able pass in tool_name , somehow figure out tool , create project proper tool assigned it. here code far, can see not work. take tool_name in new project form strong params expecting tool_id not tool_name how solve this? i have form <%= form_for [@project], :html => { :multipart => true } |f| %> <div class="form-group"> <%= f.label :name %><br> <%= f.text_field :name, class:'form-control' %> </div> <div class="form-group"> <%= f.label :tool_name %><br> <%= f.text_field :tool_name, class:'form-control' %> </div> in project controller have following create method , strong pa

javascript - html css positioning not working -

i creating multi-level mega menu amazon different in design , perspective. problem facing once hover on 1 sub-menu item positioning of relative menu items not displayed properly. , if hover on item positioning bit below previous one. also using external js resource. please check external resource in fiddle. i want 2nd-level sub menu items inside , correctly placed 1 above other. , goes 1 more level deeper. #menu li .align_right { position: relative; top: 1%; left: 350%; } #menu li:hover .align_right { top: 1%; left: 350%; position: relative; } now if use absolute relative positioning, li items doesn't align properly. can't use position: fixed; because float on web-page when scrolled little bit. js fiddle link http://jsfiddle.net/neerajsonar/hzoyddhs/ result full screen - http://jsfiddle.net/neerajsonar/hzoyddhs/embedded/result/ just having quick see css moves left 350% . change 350px , keep sub menu in main area want it.

ios - How to set background image for disabled segment in UISegmentedControl -

i've tried set color disabled segment in uisegmentedcontrol. not yet succeeded. want know if it's possible set background image disabled segment in uisegmentedcontrol. i've tried following code it's not working : nsdictionary *attrs = @{ uitextattributetextcolor : [uicolor lightgraycolor] }; [self.controlstatus settitletextattributes:attrs forstate:uicontrolstatedisabled]; [self.controlstatus setbackgroundimage:[[uiimage imagenamed:@"img.png"] retain] forstate:uicontrolstatedisabled barmetrics:nil]; 1st 2 lines working. i'm able set color not background image or background color when disabled. is there way ?? uisegmentcontrol has divider between 2 segments. using following code can change divider background. [segmentedctrl setdividerimage:[uiimage imagenamed:@"divider_selected.png"] forleftsegmentstate:uicontrolstateselected rightsegmentstate:uicontrolstatenormal barmetrics:uibarmetricsdefault]; [segmentedctrl setdividerim

ruby on rails - Manage module trees with ActiveSupport -

i have rails project myapp fragmented multiple gems. 1 of them manage users. considering want code reloading , auto-require activesupport, along namespaced folders require files. can organize code way: # myapp::users ./lib/my_app/users ./app/controllers/my_app/users/ ./rspec/unit/my_app/users/ the above way clean one, results on long nested routes repeated pattern my_app/users/ , can exhausting lazy programmers. since still need folder namespace differentiate code different gems, thought abusing root namespace: # users ./lib/users ./app/controllers/users/ ./rspec/unit/users/ that not clean , more fragment gems, higher chances have namespace collision. which organization pattern commonly used? rails way? for library first 1 seems best one, large application feels tiring having time long paths , maybe fear name collision doing more harm good.

android - Unable to get valid Session Token after ParseFacebookUtils.logInWithReadPermissionsInBackground signed up a new user -

hi i'm trying implement new app using parse login facebook feature. followed guide use facebook login feature , went ok. documentation states sessions represent instance of user logged device. sessions automatically created when users log in or sign up. the problem never valid session token when parsefacebookutils.loginwithreadpermissionsinbackground(...) returns (and signs up) user newly created on parse platform (thus user.isnew() true). inspecting data dashboard can see correctly new _user entry there's no entry _session class, whereas should find 1 createdwith="signup" _user . as side effect when trying logout newly created user com.parse.parseexception: parse::usercannotbealteredwithoutsessionerror because, obviously, newly created user doesn't session token. if instead perform same operation same user after creation (and therefore user logs in parse) valid session token , everything's ok (which means there's _session object creat

c++ - How can I use a vector wrapper class when enclosed in another vector? -

consider free function third part library expects std::vector argument: void foo( std::vector<sometype>& ); now, write wrapper around type can add member functions. able use foo() type, add access function. class wrapper { private: std::vector<sometype> _data; public: std::vector<sometype>& data() { return _data; } const std::vector<sometype>& data() const { return _data; } //... other stuff }; this way, can still use foo() : wrapper a; foo( a.data() ); but consider function, expects vector of vectors of sometype ( edit: , adds elements vector ) : void bar( std::vector<std::vector<sometype>>& ); but datatype have std::vector<wrapper> vec; is there way use wrapper type call bar() ? want this: std::vector<wrapper> vec; bar( ??? ); the point want avoid first call bar() required type, , having copy 1 one elements vector<wrapper> . at first, i'd "

android - NFC P2P tag intercept -

i building android app using eclipse , android sdk. implement nfc p2p function in app in sense when place 2 phones back, both send string , receive string automatically. of course happen in separate activity. have managed send custom tag (string) have been unable intercept , use afterwards in app code. how can this? this have far: public class mainactivity extends activity { public nfcadapter madapter; pendingintent mpendingintent; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); madapter = nfcadapter.getdefaultadapter(this); ndefrecord rec = ndefrecord.createuri("www.stackoverflow.com"); ndefmessage ndef = new ndefmessage(rec); madapter.setndefpushmessage(ndef, this); } i have spent lot of time trying find , understand solutions intercept tag. unsuccessfully. thank help. you can use foreground dispatch system receive ndef mess

machine learning - JAVA library for SVM-HMM or other sequential based classifiers -

could find implementation svm classifier based on hidden markov model in java ???? in other words, i'm looking java implementation of sequential based classifier words features in sentence. any ?? thanks mallet package sequence tagging. can use mallet-libsvm support vector machines well.

android - How to return a value from Asynctask to activity -

how return value asynctask (different class) activity called asynctask , here have followed intsruction given in following link how result of onpostexecute() main activity because asynctask separate class? @ helmib's i have done , returning result activity's method processfinish() , problem lost activity control or focus, not further actions using asynctask's result, because activity's members becomes null. how proceed ? protected void onpostexecute(void result) { super.onpostexecute(result); if (pdialog != null) { pdialog.cancel(); } if (stringutil.hasvalue(responsexmlstring)) { if (integer.parseint(apputil.getxpathvalue("result/errorno",apputil.builddocument(responsexmlstring))) == 0) { asyncresponse.processfinish(responsexmlstring); } } @override public void processfinish(object output) { log.d("response asynchronous task:", (string) output); displ

python - if a property sample work -

in book of "core python programming", there sample how use property. code this: class hidex(object): def __init__(self, x): self.__x = x @property def x(): def fget(self): return ~self.__x def fset(self, x): assert isinstance(val, int), 'val must int' self.__x = ~x return locals() the book says, class work following code: inst = hidex(20) print inst.x inst.x = 30 print inst.x but don't think class work. because when access inst.x, interpreter run hidex.__dict__['x'].__get__(x, hidex) , , because x = property(x), first arg 'fget' of property x, rather function 'fget' defined in x(). also, when run code, got result of: {'fget': <function fset @ 0x.....>, 'self': <__main__.xxxx>, 'fget': <function fget @ 0x....>} traceback: ...... # result telling t.x = 30 cannot run, skip details attributeerror: cannot set

How to change icon on core-collapse toggle in polymer ? -

is there way change polymer core-icon on core-collapse collapse without using jquery ? this code <template repeat="{{contacts}}"> <div style="margin-top:10px;" class="page-holder contact-dropdown dropdown-holder " horizontal layout center center-justified on-tap="{{toggle}}" ident="{{cardid}}"> <div><img src="http://lorempixel.com/80/80"></div> <div flex style="margin-left:15px;"> <p class="user-name">name</p> <p class="user-dropdown-info">city <span class="blue bold" style="margin-right:15px;">city</span> nr <span class="red bold">297493</span></p>

How to using jquery child() method to adding class in many elements? -

i have written function mark , control div elements red border. controlled select option element. options kotak1,kotak2,etc. when choose kotak1 associated div border become red. how restore div element black border again when change other option? html <div id="group-select"> <select id="select_kotak"> <option selected>pilih kotak</option> </select> </div> <br> <div id="group-kotak"> <div class="kotak-nonaktif">kotak 1</div> <div class="kotak-nonaktif">kotak 2</div> <div class="kotak-nonaktif">kotak 3</div> <div class="kotak-nonaktif">kotak 4</div> </div> .kotak-nonaktif { height: 100px; width: 100px; border: 1px solid black; float: left; margin-left: 1px; } .kotak-aktif { height: 100px; width: 100px; border: 3px solid red; float: left;

AngularJs Material design RTL layout -

how can change whole layout of angularjs material design component rtl ? you can bidirectional provider app.config(function($mdbidirectionalprovider) { $mdbidirectionalprovider.rtlmode(true); } look @ page

javascript - Getting the new height of backround image when using CSS background-size: cover? -

i'm using background-size: cover; in css , whilst works well, have noticed once "kicks in" may have issues whole height of background image not displaying. for example, have code this: #home .top { min-height: 768px; background: #fff url('../images/home-bg-lg.jpg') center top no-repeat; background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; } now, min-height: 768px; refers actual height of image, set make sure shows full height regardless of content; once background size starts increase height increases , hence 768px size no longer large enough , lot of background not shown. is there anyway fix css , if not, how javascript , preferably jquery ? if javascript/jquery solution may worth mentioning use breakpoints , utilise smaller background images @ smaller resolutions; nothing needs applied these. edit: clarify, wondering if possible when expands shows full heigh

How to open a file from a perl module -

i have module called conf.pm , opens file called conf.json. conf.json relative path conf.pm ".../conf/conf.json"; but when include conf.pm in scripts in other folders relative path changes , conf.pm not find conf.json. how can open conf.json conf.pm. the trick here use module findbin allows work 'relative location' in module. in .pm add: use findbin; $home_path = $findbin::realbin; $json_path = $home_path."/../conf/conf.json";

c - Unclear error in list implementation -

i wrote function input text files, "fileinput" function, , content of text file 1 2 4 5 2 4 5 6 the part of main function like: case 7 head=fileinput(head);break; reason, when choose case 7 use "fileinput",and check list_all(which show them all), got nothing except"empty list" here part of code: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct node { int id; char name[100]; char address[100]; char group[100]; struct node * next; } data; data * fileinput(data * head) { char name[100]; char group[100]; char address[100]; int id; file *fp; fp = fopen("input.txt", "r"); if (!fp) return head; while (fscanf(fp, "%99s %d %99s %99s", group, &id, name, address) == 4) { //head = push_sort(head, group, name, id, address); printf("%99s", name); } fclose(fp); return head; } voi

Mysql Dump using PHP -

i trying write function returns whole dump of sql using code: $command = "c:\\program files\\mysql\\mysql server 5.6\\bin\\mysqldump --add-drop-table --host=$hostname --user=$username "; if ($password) $command.= "--password=". $password ." "; $command.= $dbname; var_dump(terminal($command)); function terminal($cmd) { if (function_exists('system')) { ob_start(); system($cmd, $retval); $output = ob_get_contents(); ob_end_clean(); $function_used = "system"; } else if(function_exists('passthru')) { ob_start(); passthru($cmd, $retval); $output = ob_get_contents(); ob_end_clean(); $function_used = "passthru"; } else if(function_exists('exec')) { exec($cmd, $output, $retval); $output = implode("n", $output); $function_used = "exec"; } el

Visual Studio 2013 Community with Update 4 on Windows 10 Insider Preview Build 10074 -

i today upgraded windows 10 build 10074 downloaded here. now, wanted develop apps windows , windows phone universal app. i'm willing same android devices therefore, downloaded visual studio community 2013 update 4 here. now, after installed first gave warning system doesn't support windows phone 8 emulator (and understand because suppose processor, core 2 duo e7000 doesn't support visualization/slat technology). after opened visual studio first loaded, closed automatically (quite abruptly). opened sample solution afterward loaded, dialog came stating need enable developer mode in windows 10 under settings>update , security>for developers when went there , clicked developers, window closed (similar visual studio). how enable then? , don't know should re-install/uninstall it? or maybe should download visual studio 2015 rc? thanks, kvaibhav01. if want develop new universal app platform, need vs2015 rc, apps won't work on windows 8 devices, wind

vaadin - Getting java.io.IOException: Stream Closed from DownloadStream -

i'm developing vaadin application. function i'm working on creating 2 pdf's, merging them , downloading client temporary file. few times strange ioexception no reference code. idea on may cause it? the stack trace: java.io.ioexception: stream closed @ java.io.fileinputstream.readbytes(native method) @ java.io.fileinputstream.read(unknown source) @ com.vaadin.server.downloadstream.writeresponse(downloadstream.java:304) @ com.vaadin.server.abstractclientconnector.handleconnectorrequest(abstractclientconnector.java:646) @ com.vaadin.server.connectorresourcehandler.handlerequest(connectorresourcehandler.java:83) @ com.vaadin.server.vaadinservice.handlerequest(vaadinservice.java:1408) @ com.vaadin.server.vaadinservlet.service(vaadinservlet.java:350) @ javax.servlet.http.httpservlet.service(httpservlet.java:790) @ org.eclipse.jetty.servlet.servletholder.handle(servletholder.java:808) @ org.eclipse.jetty.servlet.servlethandler.dohand

axapta - How to keep "Show in content area" when form is open by menuitem from code? -

on few places in our application open listpage in content area. on address line there "company/module/folder". on listpages menuitems calls class create menuitem , open new listpage form like: args args = new args(); str param = 'something'; menufunction openprojects = new menufunction('listpagename',menuitemtype::display); args.parm(param); openprojects.run(args); when called address degenerate "company/" normally display of path depends on property "isdisplayedincontentarea=yes" on menu not know how set in code. how keep location (at least when same listpage reopen different parameters)? i using microsoft dynamics ax 2012r2. it happens when menuitem not in menu used. solution use menuitem exist somewhere in menu. i see behavior when callers args used instead of creating new args() like: public static void main (args _args) { menufunction openprojects = new menufunction('listpagename',menuitemtype::displ

objective c - Autolayouts Set Portrait and Landscape Views iOS -

Image
i have view has 6 image views displaying images according logic, view can viewed in landscape , portrait both. in portrait mode shows images like 1 2 3 4 5 6 and want show in landscape mode 1 2 3 4 5 6 how can use constraints on these imageviews can desired results. you talking different designs landscape , portrait modes. therefore, should use size classes. with size class can create set of constraints landscape mode, set portrait mode, , set both of them. example (from first link added): my recommendations learning size classes issue (and checked lot): http://www.mangrove.com/en/journal/2015-01-21-auto-layout-for-existing-ios-projects/ http://mathewsanders.com/designing-adaptive-layouts-for-iphone-6-plus/#aspect-ratio-constraint http://www.imore.com/adaptive-ui-ios-8-explained good luck !

angularjs - Angular tracked hashKey not printing -

i'm learning angular book i've reached example doesn't seem working. have this: <div ng-repeat="note in ctrl.notes track note.id"> {{note.$$hashkey}} <span class="label"> {{note.label}}</span> <span class="author" ng-bind="note.done"></span> </div> and in controller: this.notes = [ { id: 1, label: 'changed note', done: false, somerandom: 4242 }, { id: 2, label: 'second note', done: false }, { id: 3, label: 'finished third note', done: true } ]; the problem without track note.id prints 3, while adding track note.id, supposed print ids... doesn't print anything, blank , there no errors in console. normal b

Get all child nodes javascript -

hi trying add html space after in contenteditable div; problem that, above code return content of first div , ignore else. var tdiv = document.createelement('div'); tdiv.innerhtml = '<div>testing html</div>&nbsp;'; var replacment = tdiv.firstchild; // el.insertnode(replacment); // purpose, "el" html element with nbsp removed. if want children of tdiv added el try var el = document.getelementbyid('x') while (tdiv.firstchild) { el.appendchild(tdiv.firstchild); } demo: fiddle

Could not find or load main class - using javafx mobile plugin on Android -

i able build/compile project using javafxmobileplugin .the command used "gradlew androidinstall". able install apk in device, while launching blank screen appears. on terminal, see error "could not find or load main class" .please help. my build.gradle follow: // top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() } dependencies { // classpath 'com.android.tools.build:gradle:1.1.0' classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b7' } } apply plugin: 'org.javafxports.jfxmobile' apply plugin: 'application' mainclassname = 'ch.nest.application.main' repositories { jcenter() } jfxmobile { android { applicationpackage = 'ch.nest.application' } } sourcesets { main { // manifest.srcfile 'androidmanifest.xml' java.srcdirs = ['src/main/ja

postgresql - What is the MySQL equivalent of PSQLException -

i trying move database , web app postgresql mysql, application using play 2.3.0. i made app work mysql haven't yet made error management, i'll need there: the original code uses psqlexception this: import org.postgresql.util.psqlexception try { sql("delete lab id = {id}") .on("id" -> lab.id) .executeupdate() true } catch { case e: psqlexception if e.getmessage.contains("update or delete on table \"lab\" violates foreign key constraint \"conference_organizedby_fkey\" on table \"conference\"") | e.getmessage.contains("update or delete on table \"lab\" violates foreign key constraint \"appuser_lab_fkey\" on table \"appuser\"") => logger.warn(e.getservererrormessage.getmessage); false } i don't find mysql error handler best type of error. what think should use? just catch sqlexcepti

ios - if , then command on deb file -

i want create deb file ios. created 3 command files on debian folder presint, postint , postrm. why code cannot function when install deb file? #!/bin/bash if [ "/system/library/fonts/cache/applecoloremoji.ttf" ];then mv /system/library/fonts/cache/applecoloremoji.ttf /system/library/fonts/cache/applecoloremoji.backup elif [ "/system/library/fonts/cache/applecoloremoji@2x.ttf" ];then mv /system/library/fonts/cache/applecoloremoji@2x.ttf /system/library/fonts/cache/applecoloremoji@2x.backup elif [ "/system/library/fonts/cache/applecoloremoji@3x.ttf" ];then mv /system/library/fonts/cache/applecoloremoji@3x.ttf /system/library/fonts/cache/applecoloremoji@3x.backup else echo "cannot backup font" fi i want command able find file inside dir , remane file backup. you need -f flag in if-statement. -f flag tests file, see man test possibilities. i added var's make code easier read: #!/bin/bash orgdir="/system/libra

html - How to stop a div from inheriting parent css style -

i have 2 .scss stylesheets contributing 1 website. can have base, , home stylesheet. in base style sheet, div has float of left, in section there no float. cant seem fix issue. advice appreciated! here jsfiddle - https://jsfiddle.net/hbyeyv6y/ here base .scss - body, html, div, nav, section, ul, li, header { float: left; margin: 0px; padding: 0px; } here .scss - div.whatwedo { box-sizing: border-box; margin: 0 auto; background-color: #366e81; padding: 100px; text-align: center; width: 100%; } div.whatwedo .inner { float: none; } div.whatwedo h1 { color: #ffffff; font-family: 'franklin gothic', 'arial', 'sans serif'; font-weight: lighter; font-size: 45px; } div.whatwedo h2 { margin-top: -15; color: #8e8e8e; font-family: 'franklin gothic', 'arial', 'sans serif'; font-weight: lighter; font-size: 25px; } div.whatwedo h3 { margin-top: -15; color: #fff; font-family: 'franklin gothic', 'arial', 

regex issue with numbers (python) -

i have string thath goes that: <123, 321> the range of numbers can between 0 999 . i need insert coordinates fast possible 2 variables, thought regex. i've splitted string 2 parts , need isolate integer other characters. i've tried pattern: ^-?[0-9]+$ but output is: [] any help? :) if strings follow same format <123, 321> should little bit faster regex approach def str_translate(s): return s.translate(none, " <>").split(',') in [52]: str_translate("<123, 321>") out[52]: ['123', '321']

operating system - Python: Can't save file/Windows Error 32 -

i have written function called when program done job. def alldone(self, event): dlg = wx.messagebox("all done!", "ask alfred", wx.ok | wx.icon_information) os.unlink(self.fpath) os.rename(self.temp, self.fpath) self.pathbox.clear() however, not working expected. supposed delete original file, rename temp file original files path. instead, executing unlink, deleting file @ self.fpath. the exact error is: file "g:/asknorbert/finder.py", line 151, in alldone os.rename(self.temp, self.fpath) windowserror: [error 32] process cannot access file because being used process make sure have called flush() , close() on temporary file before attempting rename it, ensure not locking it. it worth calling time.sleep(0.2) , give os time finish doing, after close , before rename .

javascript - How can i get the calling function name in angular js strict mode -

i have function this var getdata = function(){ console.log('test'); } i call getdata() i want name of function inside that. i tried this arguments.callee.caller.tostring() but error error: 'caller', 'callee', , 'arguments' properties may not accessed on strict mode functions or arguments objects calls them how can fix that

r - Mutate with dplyr strange error -

i'm trying create new variables mutate in dplyr , can't understand error, i've tried , have not stumbled upon issue in past. i have large data set, on million observations. provide 20 first observations. this how data looks like: data1 <- read.table(header=true, text="idnr visit time year end event survival 7 1 04/09/06 2006 31/12/06 0 118 7 2 04/09/06 2007 31/12/07 0 483 7 3 04/09/06 2008 31/12/08 0 849 7 4 04/09/06 2009 31/12/09 0 1214 7 5 04/09/06 2010 31/12/10 0 1579 7 6 04/09/06 2011 31/12/11 0 1944 20 1 24/10/03 2003 31/12/03 0 68 20 2 24/10/03 2004 31/12/04 0 434 20 3 24/10/03 2005 31/12/05 0 799 20 4 24/10/03 2006 31/12/06 0 1164 20 5 24/10/03 2007 31/12/07 0 1529 20 6 24/10/03 2008 31/12/08 0 1895 20 7 24/10/03

javascript - ionic cross domain issue -

hi guys using node server data fetch , and client side ionic framework android application(phonegap). so in computer browser hit localhost:8080/sessions (or 10.129.86.47:8080/sessions ) return json server side,but when run ionic application in android device apk not hit server because of cross domain. my server , client application both in same network. i fond 2 3 solution not work me solution tried as: 1) first tried ionic proxy , set proxy ionic hit proxy url wont work. example : in ionic.project file entered proxy { "name": "proxy-example", "app_id": "", "proxies": [ { "path": "/sessions", "proxyurl": "http://10.129.86.47:8080/sessions" } ] } 2) second tried whitelist example : <access origin="http://google.com" /> <access origin="https://google.com" /> <access origin="*" /> <!-- don&#

javascript - OnUnload not working in chrome and opera -

i know there many links regarding onbeforeunload,beforeunload , onunload events of javascript have cross browser problems. after going through, possibly, questions, want ask again is there way onunload can work chrome , opera? i don't want use onbeforeunload pops before closing window.in application user clicks "save , exit" button after alert box popped showing "your details saved" ok button. clicking on ok button redirects user new popup asking window close yes , no buttons. onbeforeunload event returns string, hence doesn't allow me show "alertbox" asks leave page , stay on page. not in alliance application requirement want alert box. (working fine in ie, not working in opera , chrome). using unload , onbeforeunload events code behind c#

asp.net mvc - Show Div in another view -

i have navigation cshtml view , index view. nav view on left hand side, , when click item on view want display partial view inside div in index view. here trying when user selects item in nav view $.get('home/itemresult/', { id: item.value}, function (data) { $('#partialplaceholder').html(data); }); } in index have (i commented out html.action (i using that, need pass parameter nav view)) <table class="tg"> <tr> <th class="tg-031e"> <div id="partialplaceholder" style="display:none;"> </div> @*@html.action("itemresult", "home")*@ </th> </tr> </table> my layout refernces nav view. <!-- w

java - JdbcTemplate update query giving AssertionError ? -

i writing test cases dao class , using jdbc template , power mock .in dao method calling 2 times jdbctemplate method getting error. please find below code jdbctemplate jt = createstrictmock(jdbctemplate.class); string sql = "select sqn_alerts_cch_job_id.nextval dual"; string sqlinsert = "insert c_alerts_cch_job (msg_id, message, action, action_tm, err_desc, seq_no)" + " values (?,?,?,?,?,?)"; easymock.expect(jt.queryforlong(sql)).andreturn(529340l).times(1); easymock.expect(jt.update(sqlinsert, parameters)).andreturn(1).times(1); powermock.replay(jt); powermock.replayall(); object[] parameters = new object[6]; parameters[0] = jt.queryforlong(sql); jt.update(sql, parameters); then getting below error java.lang.assertionerror: unexpected method call jdbctemplate.update("insert c_alerts_cch_job (msg_id, message, action, action_tm, err_desc, seq_no) values (?,?,?,?,?,?)", [null, null, null, 2015-05-11 19:49:29.5

twitter bootstrap - How to hide the scrollbar in IE10? -

the problem scrollbar shows when move mouse inside body after link bootstrap style. at beginning, scrollbar hidden. working fine. when hover mouse in body area , toggle mouse wheel, scrollbar shows up. have set overflow hidden. issue still here. the code snippet below: <!doctype html> <html> <head> <link href="~/content/bootstrap.min.css" rel="stylesheet" /> <style> html, body { overflow: hidden; } </style> </head> <body> </body> </html> you can use vendor specific -ms-overflow-style -property control scrolling/scrollbar behavior on ie html, body { -ms-overflow-style: none; } note applies on elements overflow property set , works on windows 8 , up. -ms-overflow-style property on msdn

html - Setting span alignment inside button -

i have 2 spans inside button . im trying set 1 span ( has text) left of button , other span ( has caret) right of button. both spans appears @ center. can help .caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px solid #000000; border-right: 4px solid transparent; border-bottom: 0 dotted; border-left: 4px solid transparent; content: ""; } <button type="button" style="width:300px;"><span style="text-align:left">selected all</span><span style="text-align:right;" class="caret"></span></button> demo http://jsfiddle.net/887r8rav/ text-align won't work in case because there no text span have class caret . you've use float:right property, since we'll use float property we've clear float well; child elements won't affected./ to make align caret text you&#

c++ - OpenGL Index Buffering To Make A Square -

i'm new opengl , have been following youtube tutorial jeffrey chastine. personal exercise, wanted make simple square using index buffers. sadly attempt, see 1 triangle drawn (when expect two). i'm not sure i'm missing. here code, tried explaining logic/reasoning in comments. feel free correct me wherever i'm wrong: #include <gl/glew.h> #include <gl/freeglut.h> #include <iostream> #define buffer_offset(i) ((char *)null + (i)) gluint shaderprogramid; gluint vao = 0; gluint vbo; gluint positionid, colorid; gluint indexbufferid; #pragma region shader_functions static char* readfile(const char* filename) { //open file file* fp = fopen(filename, "r"); //move file pointer end of file , determining length fseek(fp, 0, seek_end); long file_length = ftell(fp); fseek(fp, 0, seek_set); char* contents = new char[file_length + 1]; //zero out memory for(int = 0; < file_length+1; i++) { contents[

java - how to pass argument to main method in eclipse? -

i trying pass parameter java class main method want pass parameter using eclipse went run -> run configuration -> program arguments and wrote arguments exp grammar but whenever run gives me error, exception in thread "main" java.lang.arrayindexoutofboundsexception: 1 @ ll.main(ll.java:146) which means not see second argument "grammar" , know why , how solve ? edit , here main method public static void main(string[] args) throws ioexception { string exp = args[0] + '$'; ll input = new ll(exp, grammar.fromfile(args[1])); try { input.llparse(); } catch (exception e) { system.out.println(e); system.exit(1); } } in run -> run configuration -> java application -> arguments enter inputs separating space

Python, RuntimeError: dictionary changed size during iteration -

i'm trying create sort of residual network given network, i'm first creating reverse edges doesn't exist in graph, keep getting message runtimeerror: dictionary changed size during iteration first iterating on object being modified during loop: def gf(graph): #residual graph u in graph: v in graph[u]: if u in graph[v]: pass else: graph[v][u]=0 #create edge capacity 0 return graph where graph graph object of form (i'm new python don't know if best way it) defaultdict(lambda: defaultdict(lambda:0)) with values graph[u][v] set capacity of edge u,v. so created copy of graph , tried iterate on object def gf(graph): #residual graph graph_copy=graph.copy() u in graph_copy: v in graph_copy[u]: if u in graph_copy[v]: pass else: graph[v][u]=0 return graph but didn't work. tried other ways (create deepcopy; create empty object graph_copy, iterate

php - Using equal values within 2 arrays to display values from third array -

i have 2 arrays want compare, , collect similar values use in order display values third array. array 1: $global_days = array("monday", "thursday", "friday", "sunday"); array 2: $global_day = array("monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"); array 3: $global_dates = array("11-05-2015", "12-05-2015", "13-05-2015", "14-05-2015", "15-05-2015", "16-05-2015", "17-05-2015"); so want display date equal days shown in first array, example show: 11-05-2015 14-05-2015 15-05-2015 17-05-2015 from have seen, array_intersect() looking for, examples have seen of confusing. data shown here bit different intend use, functionality need, giving alternatives getting date won't help things note. when intersecting need pay attention first array, 1 compared ag

android - How to make all child view at vertical center of a horizontal LinearLayout which gravity is center_vertical after add views to it -

Image
here horizontal linearlayout , set it's gravity center_vertical , add 2 views linearlayout , height of first view bigger other, result second view align top of first view, not @ vertical center of linearlayout . how make child view @ vertical center, ideas? here code: context context = getactivity(); mpicturecontainer = new linearlayout(context); mpicturecontainer.setbackgroundcolor(0xffffffff); mpicturecontainer.setgravity(gravity.center_vertical); mpicturecontainer.setorientation(linearlayout.horizontal); int leftrightmargin = getresources().getdimensionpixelsize(r.dimen.leftrightmargin); mpicturecontainer.setpadding(leftrightmargin, 0, leftrightmargin, 0); //... maddpicbtn = new imageview(context); maddpicbtn.setlayoutparams(new linearlayout.layoutparams(utils.dip2px(77f), utils.dip2px(77f))); maddpicbtn.setscaletype(scaletype.center_crop); maddpicbtn.setimagedrawable(statelistfactory.createstatelistdrawable(r.drawable.add_prs, -1, r.drawable.add)); //... mpicturecontai