Posts

Showing posts from March, 2010

Wait for keypress Assembly NASM, Linux -

i'm working on hello world in assembly x86-64. i have managed create 1 finishes when enter key pressed, have finish when key pressed. this code waiting enter key: mov rax, 0 mov rdi, 0 mov rdx, 1 syscall i can't use int xh or that. syscalls. thanks! i've answered a similar question before , , gave c code work directly system calls wanted. here's translation of code nasm, slight changes reflect you're checking key pressed, not specific key: fwait: ; fetch current terminal settings mov rax, 16 ; __nr_ioctl mov rdi, 0 ; fd: stdin mov rsi, 21505 ; cmd: tcgets mov rdx, orig ; arg: buffer, orig syscall ; again, time 'new' buffer mov rax, 16 mov rdi, 0 mov rsi, 21505 mov rdx, new syscall ; change settings , dword [new+0], -1516 ; ~(ignbrk | brkint | parmrk | istrip | inlcr | igncr | icrnl | ixon) , dword [new+4], -2 ; ~opost , dword [new+12], -32844 ; ~(ec...

python - Test for multiple substrings inside a single string? -

purpose of code: ask user type in filename. if filename contains substrings, filename invalid. program "rejects" , asks new filename. if filename not contain substrings, filename valid , program "accepts" it. attempt 1 : while true: filename = raw_input("please enter name of file:") if "fy" in filename or "fe" in filename or "ex1" in filename or "ex2" in filename: print "sorry, filename not valid." else: print "this filename valid" break (i'm leaving out case-checking on input keep examples clean). my issue comes comparing multiple substrings against input filename. wanted keep of substrings in tuple instead of having huge if or line. figured way easier whoever takes on code find , add tuple if need be, instead of having extend conditional statement. attempt 2 (with tuple): bad_substrings = ("fy", "fe", "e...

linux - How are the number various ulimit values for a process set? -

description: ubuntu 13.10 how various ulimit values process set ? interested in number of open file descriptors. how set given process ? if based on user started process how set user ? how can set these limits particular user ? it's set when code explicitly chooses set it. otherwise, processes inherit settings of parent process. login shells typically set resource limits based on configuration settings. on linux, typically controlled pam_limits library , files /etc/security/limits.conf .

ruby on rails 4 - dependent destroy not working with mongoid -

the plans won't deleted after user deleted. am missing ? it supposed remove plans belongs deleted user. class user include mongoid::enum include mongoid::document has_many :plans, dependent: :destroy class plan include mongoid::document belongs_to :user

ruby on rails - Spree frontend helpers not available, leading to"undefined local variable or method `body_class'" -

i'm trying install spree on existing application. installs successfully, when navigating spree page, "undefined local variable or method 'body_class'" error in spree_frontend-3.0.4/app/views/spree/layouts/spree_application.html.erb , line 10. body_class method in spree_frontend-3.0.4/app/helpers/spree/frontend_helper.rb , seems helper methods file aren't available. why not? i tried setting brand new rails app , installing spree on that, , worked. there's odd existing app that's interfering spree, can't think of might be. here's gemfile, in case helps: source 'https://rubygems.org' ruby '2.2.0' gem 'rails', '4.2.3' gem 'sass-rails', "~> 4.0.2" gem 'celluloid', '~> 0.16.0' gem 'unicorn' gem 'bootstrap-sass', '~> 3.3.5' gem 'bcrypt-ruby', '3.1.2' #gem 'faker', '1.1.2' ...

r - Manipulating all split data sets -

i'm drawing blank-- have 51 sets of split data data frame had, , want take mean of height of each set. print(dataset) $`1` id species plant height 1 1 42.7 2 1 32.5 $`2` id species plant height 3 2 43.5 4 2 54.3 5 2 45.7 ... ... ... $`51` id species plant height 134 51 52.5 135 51 61.2 i know how run each individually, 51 split sections, take me ages. i thought that mean(dataset[,4]) might work, says have wrong number of dimensions. why incorrect, no closer figuring out how average of heights. the dataset list . use lapply/sapply/vapply etc loop through list elements , mean of 'height' column. using vapply , can specify class , length of output ( numeric(1)) . useful debugging. vapply(dataset, function(x) mean(x[,4], na.rm=true), numeric(1)) # 1 2 51 #37.60000 47.83333 56.85000 or ...

grails - Implicit dependency to json-lib-2.4-jdk15.jar causes build to fail, even though it's been excluded in build.gradle -

i'm converting existing maven based project containing grails 2.4.2 application gradle 2.6 , grails 3.0.4. it's mixed environment java, groovy, , grails used in several sub-projects. i've converted pom.xml files build.gradle files, starting off ./gradlew init, , hand editing needed. before converting grails project's grails-app/conf/buildconfig.groovy build.gradle equivalent, built fine gradle 2.6. after converted grails project's buildconfig.groovy file build.gradle, i'm getting following error when trying run ./gradlew build: failure: build failed exception. * went wrong: not resolve dependencies configuration ':foo:runtime'. > not find json-lib-jdk15.jar (net.sf.json-lib:json-lib:2.4). searched in following locations: file:/users/xyz/.m2/repository/net/sf/json-lib/json-lib/2.4/json-lib-2.4-jdk15.jar * try: run --stacktrace option stack trace. run --info or --debug option more log output. build failed the json-lib-2.4.jar file exist in ...

asp.net mvc 4 - how can I change content in span after ajax success in MVC 4 -

<div> <span class="label">1</span> <a href="#" class="click">up</a> </div> javascript $('.click').click(function(){ //$(this).parent().find('.label').html(2); $.ajax({ .... success: function(result){ $(this).parent().find('.label').html(2); } }); }); if don't use ajax.post, value in change.. , when use, doesn't change. i don't know happen? , how can fix it. give me advices please. $(this) not referring link (its inside $.ajax() function). assign label element javascript variable before make ajax call can accessed inside ajax function. $('.click').click(function(){ var label = $(this).parent().find('.label'); // or $(this).prev('.label'); $.ajax({ .... success: function(result){ label.html(2); } });

garbage collection - How to determine the cause of young gc of a Java application -

recently found had frequent young gc in java app. since had 1600m young generation, , did young gc every 10 seconds, think there many unnecessary objects cause these gcs. i know can use jmap heapdump find out cause full gc. how can find out what's in young gen (cause heapdump should clean young gen , young gen varying time) and question : jstat -gcutil increase gc frequency? option 1 - sjk's hh command using jmap underhood. if run --dead-young following. perform full gc wait 10 seconds (fresh garbage produced) take heap histogram without gc immediately take perform gc , take histogram (like jmap --live) compare 2 histogram , return difference - objects created in last 10 second , being collected. option 2 - java mission control part of java 8 jdk. can sample object allocation on tlab allocation failures. while not accurate detecting garbage spots in practice. jstat -gc not perform gc, using information via memory mapped file. jvm dump metric fi...

c# - Transmit data to Raspberry Pi Tx running windows 10 -

need output text tx of raspberry pi using windows universal app/ cpp/ c# please me understand how transmit data tx (or write text tx) of raspberry pi running windows 10 core it not possible use on-board serial device on raspberry pi 2 universal apps - reserved lower-level debugging, device drivers. see this , this . however, can confirm cp2102-based usb-serial adapters, one, work properly. ftdi-based adapters, far more common in experience, can made work, require special installation , specific changes program's software. jark has great instructions , sample program available on this github repo .

authentication - Microsoft Sign-In for ASP.NET MVC 5 web role -

i have created azure cloud service , in cloud service have web role serving mvc web application. followed this tutorial use microsoft account external authentication. when try localhost works perfectly. however, after deploy cloud service, changed redirect url site url http://109e199cf5864b50ab25ac839f8c151d.cloudapp.net/ . doesn't work. can reach authorization part, after login microsoft account got error message: error occurred while processing request. should make work? update: tried remove [authorize] tag in controller don't need login see view. after deployed again, got error message directly!! didn't login @ all! checked code error message error view template in shared folder. there no change of code return me error view! missing deployment here? in comments of blog post referenced, author (ben day) said there update redirect uri. with latest version of asp.net identity code, redirect uri different value. on account.live.com, redirect url value ap...

openfiledialog - getOpenFileName in Python 3DS MAX? -

i'm having hard time find function getopenfilename, lets seach file (openfiledialog basically). i wonder if it's in maxplus library , know if else knows if it's somewhere there or if there way call it. here's example in maxscript: f = getopenfilename caption:"file:" \types:"text file (*.txt)|*.txt|" thanks in advance. well, maybe: maxplus.core.evalmaxscript('getopenfilename caption:"file:" \types:"text file (*.txt)|*.txt|"') :) seriously: try domaxfilesaveasdlg() filemanager in maxplus reference

sqlite - Explain Cordova project + angularJS, phonegap project, ngcordova -

i'm confused these technologies. want build mobile application sqlite database offline should support webapi services or something. should support both sqlite , server targets ios, android , windows. i did r&d , gather knowledge cordova , angular. i use angular on mobile application can manage client side data , app flow , wisely. now i'm confused whether use cordova or phonegap or ngcordova (which came know exists). as mentioned, want mobile app sqlite , support webapi services , should support multiple platforms. so where/how start , best 1 me. i'm developing app production mean real time app. please start with. this email id jprasanth74@gmail.com if have guide please share it.. cordova use create build in different platforms you have start write code in angular.js just use sample link https://blog.nraboy.com/2014/09/implement-barcode-scanner-using-ionic-framework/ to create first app , send me email send startup guide line create e...

c# - To convert For loop into foreach loop -

how can convert below mentioned loop foreach loop? can assist me fix this? @for (int rcount = 0; rcount < @model.itemfilters.categories.count; rcount++) { //some code } probably, need this? @foreach (var category in @model.itemfilters.categories) { //some code }

c# - Referencing another project using a dll -

i working on massive erp on student lifecycle management. my platform asp.net web forms. originally, created project using n-tier format, had separate tiers data access, business logic, , view. i had create different types of view based on different stakeholders, , project had different folders hold views of particular stakeholder. i had folders hold data access , business logic well. overall, project structure this: project --businesslogic --class files --dataaccess --class files --student --html pages --principal --html pages --accountsdept --html pages --teacher --html pages --loginsystem --html pages now, want breakdown structure, because want host student , teacher portals on different servers. student , teacher portal use same data access layer , same business logic layer, want make code changes these layers 1 single page. i thinking of structure project 1 --businesslogic --dll files --dataaccess --dll files student port...

annotations - What type of exception is raised if "service.Retrieve" method doesn't find the specified entity Id in CRM? -

i retrieving annotation crm service.retrieve("annotation", annotationid, col); what type of exception raised if above "service.retrieve" method doesn't find specified "annotationid" in crm? its going organizationservicefault , see handle exceptions in code further advice.

visual studio - What does an executable compiled using C# have? -

as far understanding is, any code written using c# or f# or vb.net, compiled respective compilers in visual studio il code. so, .net framework runtime (clr) installed in client's machine use il code convert machine code , run program. the question is, exe contain ? il , headers ? in .net world, basic units of deployment called assemblies , .exe extension in case of application, or .dll extension in case of library. in short, assembly contains 4 types of things: an assembly manifest provides information .net runtime, such assembly’s name, version, requested permissions, , other assemblies references. an application manifest provides information operating system, such how assembly should deployed , whether administrative elevation required. compiled types : compiled il code , metadata of types defined within assembly. and resources : other data embedded within assembly, such images , localizable text. of above four, assembly manifest mandatory. ...

android - How to remove data stored on the device remotely through code (programatically) -

i want remove data stored on device remotely through code. did through android device manager. https://www.google.co.in/android/devicemanager want same approach programatically through application. 1) how can active devices through gmail. 2) how can lock mobile 3) how can ring mobile remotely. i didn't see code programatically. how can programatically these? tried below code. public class controller extends activity { public class adminactivity extends deviceadminreceiver { devicepolicymanager mdpm; componentname mdeviceadminsample; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mdpm = (devicepolicymanager)getsystemservice(context.device_policy_service); mdeviceadminsample = new componentname(controller.this, adminactivity.class); } }

angularjs directive not upating with scope.$watch -

i trying focus input based on controller variable. initializes correctly printing value= false in console , variable being udpated in view controller not in directive. im using jade/coffeescript or id create example pretty it: controller $scope.autofocus = false $scope.somefunction = -> $scope.autofocus = true directive. 'use strict' angular.module('myapp') .directive 'gsautofocus', ($timeout, $parse) -> { link: (scope, element, attrs) -> model = $parse(attrs.gsautofocus) scope.$watch model, (value) -> console.log 'value=', value if value == true $timeout -> element[0].focus() return return } view input(type="text", gsautofocus="{{autofocus}}") you should use $observe on attribute you want evaluate interpolated contain on each digest, $watch not work on interpolated val...

sql server - How to join SELECT queries -

i have 3 queries given below: select sum(prod) production ,sum(rej) rejection machinename='a' data select sum(prod) production ,sum(rej) rejection machinename='b' data select sum(prod) production ,sum(rej) rejection machinename='c' data and want join these queries single row output. first of have incorrect syntax. should be select .... .... .... if have 3 different source tables can use union single output in following: select sum(prod) production ,sum(rej) rejection data1 machinename='a' union -- or can use union keep duplicates select sum(prod) production ,sum(rej) rejection data2 machinename='b' union -- or can use union keep duplicates select sum(prod) production ,sum(rej) rejection data3 machinename='c' if have same source table in example use in select sum(prod) production ,sum(rej) rejection data3 machinename in ('a','b','c')

recursion - In a Java recursive way, return the diff between 2 numbers digits -

i got quiestion , can't figure out how it, write recursive function gets 2 positive numbers , return difference between these number digit for example n1=24646468 , n2=248 returns 5 public static int diff(int n1, int n2){ int sum1=0; int sum2=0; if(n1==0 && n2==0){ return sum1-sum2; } if(n1>n2){ if(n2==0){ sum1++; return diff(n1/10, n2); } sum2++; return diff(n1,n2/10); } if(n1<n2){ if(n1==0){ sum2++; return diff(n1, n2/10); } sum1++; return diff(n1/10,n2); } return 0; } it returns 0 if knows whats wrong code thank :) the return not recursive call diff returns sum1-sum2 , 2 variables assigned 0 or return 0 @ last line. you want keep track of state recurse.

hadoop - Connecting Cassandra with Hive -

currently using cassandra 2.1.5, hive 1.2.1 , hadoop 2.7.1. try connect cassandra hive using tutorial : http://frommyworkshop.blogspot.com/2013/09/real-time-data-processing-with.html but seems got stuck in create external table: create external table test.pokes(foo int, bar string) stored 'org.apache.hadoop.hive.cassandra.cassandrastoragehandler' serdeproperties ("cassandra.host" = "127.0.0.1" , "cassandra.port" = "9160", "cql.primarykey" = "foo", "comment"="check", "read_repair_chance" = "0.2", "dclocal_read_repair_chance" = "0.14", "gc_grace_seconds" = "989898", "bloom_filter_fp_chance" = "0.2", "compaction" = "{'class' : 'leveledcompactionstrategy'}", "replicate_on_write" = "false", "caching" = "all"); with error this: fai...

server - Executing remote command using PXSSH in Python -

i trying make python script remotely start upgrade procesure of program located on server. upgrade procedure starts, not finish. acctually exits after start. here code: import pxssh w=pxssh.pxssh() w.login('15.24.22.10','root','pass') w.sendline('cd /home/incoming/') w.prompt() w.sendline('./upgrade') w.prompt() w.wait() any appreciated.

java - What is SAML metadata? -

i have been trying implement shibboleth idp , java webapp sp having troubles understanding how metadata works. know it's way sp knows idp , vice-versa. know has keys , can not connect dots. please provide short explanation how metadata configured , it's core elements are? saml metadata organized around extensible collection of roles representing common combinations of saml protocols saml profiles require agreements between system entities regarding identifiers, binding support , endpoints, certificates , keys, , forth. metadata specification useful describing information in standardized way. specification defines extensible metadata format saml system entities, organized roles reflect saml profiles. such roles include of sso identity provider, sso service provider, affiliation, attribute authority, attribute requester, , policy decision point. you can refer pdf link saml-metadata-2.0 gives more , descriptive information saml metadata.

angularjs - Create dynamic marker icons on angular google maps -

Image
i using angular-google-maps show markers on map. in web app show around 200 markers numbered 1-200. should this: now seems me wrong way create 200 pictures different numbers in them, thinking having 1 picture white space , have <div/> gets me number in there. however, utterly stuck , cannot find solution on web. my html code display markers looks this: <ui-gmap-markers models="selectedcar.checkpoints" coords="'location'" idkey="'id'" icon="'icon'"> </ui-gmap-markers> you set label in marker options: options: { icon:'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m1.png', labelcontent: "number here", labelclass: "clusterlabel", labelanchor: "30 34" } then you'll this http://angular-ui.github.io/angular-google-maps/#!/api/marker see api-...

android - Inflating multiple layouts in list view ? -

have fragment listview should inflated follows : 1 different layout (custom row),position 2 (slider) , position 3 (item_layout) have gone through quite lot of resources on web , stack overflow didn't solve purpose looking sample or tutorial of kind. it better use header instead of different types of items, because not recycle first 2 rows. note: when first introduced, method called before setting adapter setadapter(listadapter). example: listview listview = view.findviewbyid(r.id.list); view header = layoutinflater.from(getactivity()).inflate(r.layout.your_first_two_rows, listview, false); listview.addheaderview(header); listview.setadapter(new yourcustomadapter(...));

bash - What does -h option mean in java command line? -

during reading bash script file, see this: java -cp ${cp} ${class} -h redis > /dev/null 2>&1 & does have idea "-h" , "redis"? running "java -h" seems print info, why need print info when running java program background process? and "redis", know it's database in memory, don't know mean add java command line. mean java first check if process named "redis" exists? thank you! any arguments come after class name arguments class' main static method; not argument java. i.e., ${class} called yourclass.main(new string[]{"-h", "redis"}) .

Visual Studio Apache Cordova Error - No Android Version Supplied -

Image
i setting vs community 2015 using apache cordova first time , have run issue when try run program. 1>------ build started: project: cordovademo, configuration: debug android ------ 1> environment has been set using node.js 0.12.7 (ia32) , npm. 1> ------ ensuring correct global installation of package source package directory: c:\program files (x86)\microsoft visual studio 14.0\common7\ide\extensions\apachecordovatools\packages\vs-tac 1> ------ name source package.json: vs-tac 1> ------ version source package.json: 1.0.4 1> ------ package not installed globally. 1> ------ installing globally source package. take few minutes... 1> npm warn engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.12.7","npm":"2.11.3"}) 1> npm warn engine cordova-js@3.6.2: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.7",...

android - Issue while repacking Lollipop system.img -

i want make changes in system.img , flash nexus 5. to modify .img first need unpack filesystem, make changes anf repack new system.img. i'm following this guide unpack/repack. steps i'm taking: i. clone asop scripts: git clone https://android.googlesource.com/platform/system/extras git clone https://android.googlesource.com/platform/external/libselinux/ git clone https://android.googlesource.com/platform/system/core/ ii. checkout specific version: cd extras git checkout android-5.1.1_r9 iii. compiling c files create make_ext4fs (which used repack filesystem img) cd .. gcc -o make_ext4fs -icore/libsparse/include -ilibselinux/include -icore/include -lz extras/ext4_utils/canned_fs_config.c extras/ext4_utils/make_ext4fs_main.c extras/ext4_utils/make_ext4fs.c extras/ext4_utils/ext4fixup.c extras/ext4_utils/ext4_utils.c extras/ext4_utils/allocate.c extras/ext4_utils/contents.c extras/ext4_utils/extent.c extras/ext4_utils/indirect.c extras/ext4_utils/u...

java - Accessing shared preferences in two Android Applications -

i have 2 projects same signature , same share user id set. can access shared preferences across 2 applications if explicitly specify 2 applications run on same process, if not specify process in manifest of 2 applications, not able access data across applications. how can access shared preferences across 2 applications if run on separate processes? i think wise 2 applications store data shared preferences sqlite database. use contentprovider share data across 2 apps. forexample apps facebook, whatsup use contacts stored in phone using content provider of contacts app. read more content providers http://developer.android.com/guide/topics/providers/content-providers.html

xml deserialization not working with soap xml .net -

i have following soap xml <?xml version="1.0"?> <soap:envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingstyle="http://www.w3.org/2001/12/soap-encoding" xmlns:xsd="http://www.w3.org/1999/xmlschema" xmlns:xsi="http://www.w3.org/1999/xmlschema-instance" xmlns:m="http://xxx.xxx/soap-encoding/tester/"> <soap:body> <m:eventinst xmlns="http://xxx.xxx/soap-encoding/tester/eventinst" soap:id="123"> <m:occurances soap:href="3553||3" /> <m:subject xsi:type="xsd:string">subject value</m:subject> <m:stateref xsi:type="xsd:string">1234</m:stateref> <m:type xsi:type="xsd:string">abc</m:type> <m:message xsi:type="xsd:string"> message</m:message> </m:eventinst> </soap:body> </soap:envelope> i using xml content , getting respective xml classes in vs...

android - RecyclerView item width layout_width=“match_parent” does not match parent -

Image
i'm using recyclerview , i'm trying make width item of recyclerview match_parent since i'm using linearlayoutmanager.horizontal <android.support.v7.widget.recyclerview android:id="@+id/listoffershits" android:layout_width="match_parent" android:layout_height="match_parent" /> custom_layout.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.cardview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card_view" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:layout_weight="1" android:layout_margin="2dp" card_view:cardcornerradius="2dp"> <imageview android:i...

Display the data on same page and not in popup in JSF? -

i have been given task display data on same page displaying in popup. have 2 buttons 1 search , searchbooks. search books displays result on same page , on click of search popup opens. have display results getting displayed on click of searchbooks. please find below code search button. code search button , searchbooks button same dont understand why fetching different results. can hidden code written.. idea? <h:panelgrid columns="1" style="width:214px"> <a4j:outputpanel style="float:right;" layout="block"> <a4j:commandbutton value="search" id="searchbutton" execute="@form" action="#{searchcontroller.search()}" styleclass="myclass" onclick="return myvalue" render="checkpanel" /> ...

sql - Replacing a String between two anchor points -

i trying find way replace string in between 2 "anchor points" in varchar2 column. these "anchors" <? , ?> , want remove (replace '' ) between 2 symbols. i've tried playing around replace() function, e.g. stuff select replace(my_varchar2_column,'<? % ?>') my_table; , using % operator wildcard, didn't work. no error thrown, result wasn't expected, in the replace function interpreting % literally , not wildcard. does have idea how achieve replacement this? example current content of column: text want keep <? cryptic stuff in betweeen ?> text want keep well by replacing in between <? , ?> want remove whole passage columns text. expected result this: text want keep text want keep well you can use regexp_replace functionality of oracle. first argument = column needs replaced. second argument = substring search replacement. third argument = text replaced ( note : if omit argument, ma...

wordpress how to change original image quality during upload (jpeg) -

i using plugins , trying find in source code wordpress, can change quality thumbnails. need 30-40% quality jpeg images instead 90% (default) go media upload. can change size of image upload.

c++ - Obj-C NSLog a buffer -

i have got following function trying print datain out nslog, some_function (const void *datain, size_t datainlength) { nsmutablestring *in1 = [nsmutablestring string]; (int i=0; i<datainlength; i++) [in1 appendformat:@"%02x", datain[i]]; } this current code, upon compilation "error: subscript of pointer incomplete type 'const void'" anyone know how can fix this? you'll need couple of casts: void some_function (const void *datain, size_t datainlength) { const char *cdata = (const char *)datain; nsmutablestring *in1 = [nsmutablestring string]; (int i=0; i<datainlength; i++) [in1 appendformat:@"%02x", (unsigned)cdata[i]]; } the first [i] knows how many bytes offset buffer ( sizeof(char) known) , secondly casting unsigned that's printf-formatting expects size of %x specifier values (you don't need one, i'm fussy).

VBA - Matching time in 2 different excel -

i match workbook1 (a2) time workbook2 (c4:c27) , return value of row. workbook1 2:00 am workbook2 12:00 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00 9:00 10:00 11:00 12:00 pm 1:00 pm 2:00 pm 3:00 pm 4:00 pm 5:00 pm 6:00 pm 7:00 pm 8:00 pm 9:00 pm 10:00 pm 11:00 pm below code sub findmatchingvalue() dim integer dim intvaluetofind string dim mypath string dim wbksource workbook dim tm range dim ctm string set tm = thisworkbook.worksheets(1).range("a2") mypath = "c:\users\hlfoong\desktop\testing\" fn = dir(mypath & "pre*.xls") set wbksource = workbooks.open(mypath & fn) ctm = format(tm, "h:mm am/pm") intvaluetofind = ctm 'msgbox ("time " & ctm) = 4 27 if cells(i, 3).value = intvaluetofind msgbox ("found value on row " & i) exit sub end if next ' msgbox show if loop completes no success msgbox ("value not found in range!") en...

java - Can not find file -

i run program test this java -cp c:\users\andrew\project\selenium4j\lib\*;. org.junit.runner.junitcore c:\users\andrew\appdata\local\temp\test01 and says me: can not find file: c:\users\andrew\appdata\local\temp\test01 can me?

Can one restrict the maximum size of a user database in mysql? -

i cannot find in mysql documentation how restrict users filling disks entirely. we small group of people , share mysql server. provide every user private db, rights create tables in private dbs, should prevented (accidentally) filling disk of machine entirely. you can assign each user own tablespace , store tables of user database in it, , when create tablespace can give maximum size it. see mysql manual: https://dev.mysql.com/doc/refman/5.1/en/create-tablespace.html

java - Spring-Boot create bean with out name will cause "NoSuchBeanDefinitionException, No qualifying bean of type[]found for dependency " -

i create bean configuration out name @configuration @configurationproperties(prefix = "mysql") public class dbconfiguration extends basedbconfiguration { @bean//(name = "fix") @override public dbclient createclient() { return super.createclient(); } } usage: @autowired private dbclient dbclient; when running application can't start up and throw nosuchbeandefinitionexception: no qualifying bean of type [dbclient] found dependency: expected @ least 1 bean qualifies autowire candidate dependency. dependency annotations: {@org.springframework.beans.factory.annotation.autowired(required=true)} but fix add name, why?? @bean(name = "fix") i add test such this: public class testcreate { @notnull private int test; public test createtest() { return new test(this.test); } } it configuration this: @configuration @configurationproperties(prefix = "test") public class testconfiguration ...

php - How to use plugin add_meta_box similar using in wp-admin -

i creating form in front same using in wp-admin. there meta boxes using . i want konw how can use meta box in front page. right using do_action( 'do_meta_boxes', $post_type, 'normal', $post ); but it's not working $wp_meta_boxes; null in front end. how call boxes in front end. thanks in advance. i think meta boxes meant administrative interface , corresponding actions fired in dashboard. instead suggest use normal form, in example below (use code in page template). note must sanitize data comming form before saving database! <?php // submit form if(isset($_post['submit_form'])){ // important: sanitize , validate post values here // update post meta update_post_meta(get_the_id(), 'firstname', $_post['firstname']); update_post_meta(get_the_id(), 'lastname', $_post['lastname']); } ?> <?php // post meta $firstname = get_post_meta(get_the_id(), 'firstname', true); $lastname = ge...

css - How to I add an element style to text in a viewbag in asp.net MVC? -

i want add element-style text , value in viewbag . how go this? this is code viewbag.title = "order no:" + " " + model.orderid; and want make bold on view screen. should come out example: order no: 5 . i add styles tags bold text, in case i'm clueless on do. try put viewbag.title in span or label tag , apply styles on it. <span style="font-weight:bold;">viewbag.title</span> or can directly put in <b> tag <b>viewbag.title</b> in c# code : viewbag.error = "hi, <b>bold</b>" instead of <b> can put span or label style want. in view : @html.raw(viewbag.error)

php - How to update session array via ajax? -

i'm passing user input, quantity , product code in case php script store session array via ajax. expect, each time user clicks submit , ajax call made, quantity , product code added session array. happen is, each time updates existing data in session. 1 pair of data exist. this ajax script: <script> <!--display form submission result--> var param; var param2; var i; function sendtocart(param, param2){ $("document").ready(function(){ $("#popup-order").submit(function(){ var data = { "action": "test" }; data = $(this).serialize() + "&" + $.param(data); $.ajax({ type: "post", datatype: "json", url: "addtocart.php?id="+param, //relative or absolute path response.php file data: data, su...

How do I find "mergefields" using javascript and regex? -

Image
my "mergefields" [@something]. having string this.. [@name] [@age] years old , favorite color [@color]. since user enters mergefields, don't know mergefields. how can in javascript + regex find [@...] fields? thanks you can use following regex extract [@...] pattern string. /(\[@\w+])/g explanation () : matching group \[ : matches [ literal, need escape preceding \ @ : matches @ literal \w+ : matches alphanumeric characters , underscore _ 1 or more times ] : matches ] literal g : global flag. matches visualization demo var str = '[@name] [@age] years old , favorite color [@color].'; var matches = str.match(/(\[@\w+])/g); document.write(matches); console.log(matches);

javascript - ngSwitch slows down the APP -

i have popup directive, , popups contains different content. use ng-switch when show popups content, slows down interface, more time open popup, slower gets. now if use ng-show instead of ng-switch, interface doesn't slow down, problem is, number of watchers doubles. i using angularjs 1.4.4, suggest? directives have: scope: { attrs: '=?' } and class data. number of watchers: ngswitch - 771 ngshow - 1481

javascript - D3.js how to embed selection into a new element -

i wondering if there native function in d3.js create new element around (embedding) selection. instance have structure : <path ...></path> <path ...></path> <path ...></path> <path ...></path> <path ...></path> and want : <path ...></path> <path ...></path> <g> <path ...></path> </g> <path ...></path> <path ...></path> so create new element around selection. i think can : selection, detach it, create element , insert selection new element. sorry if question has been posted already, struggle explain in english. any suggestion appreciate although in d3 there no such thing jquery's .wrap() , easy dom manipulation. need use 3 of d3's methods: selection.insert(name[, before]) insert wrapping element @ desired position in dom tree. return newly inserted element. selection.remove() remove element wrapped dom. function ...

c# - wpf customized windows unable to set neat maximize window -

i have created custom window in wpf using rectangles this link refrence issue maximize button click, have done alot of r&d maximizing neatness below code maximize: this.rectmain.width = systemparameters.workarea.width; //this.rectmain.height = system.windows.systemparameters.virtualscreenheight - 35; this.rectmain.height = systemparameters.workarea.height; this.recttitlebar.width = systemparameters.workarea.width; this.windowstartuplocation = windowstartuplocation.centerowner; //this.recttitlebar.height = systemparameters.workarea.height; this.dockmenu.width = systemparameters.workarea.width; this.frmcontent1.width = systemparameters.workarea.width; this.windowstate = windowstate.maximized; when maximize window used little inside above screen please suggest solution set form maximized normal window form gets maximized. below main fromcode: <window x:class="wpfnavig...

matlab - Fourier transformation -

i'm writing program in matlab related on image hashing. loading image , performing simple down-sampling not problem.here code clear all; close all; clc; %%load image = im2single(imread('cameraman.tif')); %%perform filtering , downsampling gausspyramid = vision.pyramid('pyramidlevel', 2); j = step(gausspyramid, i); %%preprocessed image %%get 2d fourier transform of input image y = fft2(i); %%fft of input image the algorithm next assumes 2d fourier transform ( y in case ) must in form y(f_x,f_y) f_x,f_y normalized spatial frequencies in range [0, 1].i'm not able transform output of fft2 function matlab required algorithm. i looked paper in question (multimedia forensic analysis via intrinsic , extrinsic fingerprints ashwin swaminathan) , found we take fourier transform on preprocessed image obtain i(fx, fy). fourier transform output converted polar co-ordinates arrive @ i′(ρ, θ) by this, seem mean i(fx, fy) fourier ...

listview - Slide up animation in Android is not smooth -

slide animation in android not smooth in devices android version 4.4.2 , 4.4.4 while runs in others <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="4000" android:fromydelta="0" android:toydelta="-100%p" /> </set>

php - 301 htaccess redirect specific pages with extensions to no extension -

i 301 redirect specific file extension no extension , rule htaccess file looks this: redirect 301 /myoldfile.php /my-new-file but, when upload htaccess file, website redirects me link , generates error: www.domain.com/my-new-file?myoldfile.php so, appreciated, thanks have way: rewriteengine on rewritebase / rewriterule ^myoldfile\.php$ /my-new-file [l,nc,r=302] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?$1 make sure test after clearing browser cache.

android - how to create dynamic sidebar ( menu ) for unity app -

i want create sidebar (like nav drawer in android) ar unity app, when touch left border of screen , drag right, sidebar should appear list of buttons such (settings, us..). just quick whipped up. should started. using unityengine; using system.collections; using unityengine.ui; public class slidepanel : monobehaviour { //process touch panel display on if touch less threshold. private float leftedge = screen.width * 0.25f; //minimum swipe distance showing/hiding panel. float swipedistance = 10f; float startxpos; bool processtouch = false; bool isexpanded = false; public animation panelanimation; void update(){ if(input.touches.length>0) panel(input.gettouch(0)); } void panel (touch touch) { switch (touch.phase) { case touchphase.began: //get start position of touch. startxpos = touch.position.x; debug.log(startxpos); //check i...

xml - Exit from parent loop is not working in XSLT -

i 1 output when condition met. here sample xml. <school> <student_details> <student> <id>1</id> <name>manju</name> <subject> <subject_name>english</subject_name> </subject> <subject> <subject_name>maths</subject_name> </subject> </student> <student> <id>2</id> <name>raghu</name> <subject> <subject_name>social</subject_name> </subject> <subject> <subject_name>maths</subject_name> </subject> </student> <student> <id>3</id> <name>vijay</name> <subject> <subject_name>maths</subject_name> </subject> </student> <student> <id>4</id> <name>sunil</name> <subject> <subject_name>social</subject_name> </subject> </student> <student> <id>5</id> <name>anil</name> <su...