Posts

Showing posts from January, 2015

fortran77 - fortran 77 conflicting types in external -

i'm working f77 code, , encountering problem in compilation. think i've narrowed down problem don't know straight forward way of fixing it. the code extremely long i'll try clear possible little snippets use. the error following: /tmp/fort77-4812-1.c:2728:12: error: conflicting types ‘func_’ doublereal func_(doublereal *e) /tmp/fort77-4812-1.c:272:43: note: previous declaration of ‘func1_’ here extern /* subroutine */ int func1_(), func2_(); ^ where func(n) function. happens both func1 , func2 , both have same format, differ in arithmetic. the code starts this: implicit double precision(a-h,o-z) ... //initialization of arrays & parameters ... external func1,func2 ... ... ... function func1(n) implicit double precision(a-h,o-z) ... ... end i think external trying keep function int defined realdouble because of implicit double. any thoughts? this looks error caused choice of compiler, assum

javascript - Destroying the HTML video player? -

i want play video on embedded game of mine , when video ends, want disappear seamlessly go intro game (can't insert video game in engine i'm working in). how can this? currently, have this: <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div class = "container"><span> <iframe src='...' /> <video autoplay> <source src="intro.mp4" type="video/mp4"> </video> </span></div> <script> var video = document.getelementsbytagname('video')[0]; video.onended = function(e) { # don't know put in here }; </script> </body></html> one way can giving exact same size game's element , video. then hide game inline css display: none; when page starts, , once video ends can hide video , display game. var game = document.getelementbyid(&quo

Python time.sleep on line 2 happens before line 1 -

self.output.clear() self.output.append("text should see 2 sec") time.sleep(2) self.output.clear() you supposed see text in window 2 seconds should clear , continue sleep happens before text shows , continues clear, not showing text @ all. know fix this? self.mytimer = qtimer() self.mytimer.singleshot(2000, lambda: self.output.clear())

telerik appbuilder - Substantial Differences Between Cordova 3.8 and 4.0? -

i having trouble upgrading 3.8 4.0, if there substantial differences far performance or reliability i'll know it's worth it. can inform me how different 2 versions are? in terms of telerik appbuilder, "cordova 4.0" means: cordova-android 4.0.2 cordova-ios 3.8.0 cordova-wp8 3.8.0 so important piece changes in android , biggest of ability use alternative webview called crosswalk. i'll let this blog post rest of explanation :).

python - What is the difference between on_data and on_status in the tweepy library? -

i started using tweepy library connect streaming api of twitter. encountered both on_status() , on_data() methods of streamlistener class. difference? total noob here! on_data() handles: replies statuses deletes events direct messages friends limits, disconnects , warnings whereas, on_status() handles statuses. source: https://github.com/tweepy/tweepy/blob/78d2883a922fa5232e8cdfab0c272c24b8ce37c4/tweepy/streaming.py

excel - Delete All Cells if not A-Z -

i working through 6 columns of data (a-f) rows 2-4379 , large number of cells appear "blanks" in filter column not true blanks seem contain spaces in them. hoping find vba examples finding cells within range contained ascii values between 65-90 , 97-122 , if values not contained within cell, clear completely. is possible? have tried sub checked "istext" kept getting "sub or function not defined" error message relating istext line. this have tried far: dim c range dim rng range set rng = range("a2:f4379") each c in rng if not istext(c.value) c.clearcontents end if next c this should remove spaces active sheet: option explicit public sub trimwhitespaces() activesheet.usedrange .replace what:=" ", replacement:=vbnullstring, lookat:=xlwhole .replace what:=" ", replacement:=vbnullstring, lookat:=xlwhole .replace what:=" ", replacement:=vbnullstring, lookat:=xl

php - Magento custom search form -

i trying create custom search functionality in magento 1.9. instead of writing scratch, want piggy default search functionality , add in custom filters. first copied form.min template , replaced drop downs want use. form.custom.phtml: <?php $catalogsearchhelper = $this->helper('catalogsearch'); $_helper = mage::helper('catalog/category'); $_categories = $_helper->getstorecategories(); ?> <form id="search_custom_form" action="<?php echo $catalogsearchhelper->getresulturl() ?>" method="get"> <div class="select-box item"> <label for="finder">gift finder</label> <select id="customs" name="finder"> <option value="">please select</option> <?php foreach ($_categories $key => $value) { echo("<option value='" . $value["name&quo

awk - manipulate text using shell script? -

how can manipulate text file using shell script? input chr2:98602862-98725768 chr11:3100287-3228869 chr10:3588083-3693494 chr2:44976980-45108665 expected output 2 98602862 98725768 11 3100287 3228869 10 3588083 3693494 2 44976980 45108665 using sed can write $ sed 's/chr//; s/[:-]/ /g' file 2 98602862 98725768 11 3100287 3228869 10 3588083 3693494 2 44976980 45108665 or maybe use awk awk -f "chr|[-:]" '{print $2,$3, $4}' file 2 98602862 98725768 11 3100287 3228869 10 3588083 3693494 2 44976980 45108665 what does -f "chr|[-:]" sets field separators chr or : or - . print different fields or columns. you can use field separator -f [^0-9]+ makes other digits separators.

c# - text of node's inner text and first child nodes text -

i have multiple links in page of structure this: <a ....> <b>text need</b> text need </a> and want extract string example code above "text needalso text need" extract second part, i'm not sure how select text inside b tags well, i'm using this: var link_list = doc.documentnode.selectnodes(@"/a/text()"); foreach (var link in link_list) { console.writeline(link.innertext); } should perhaps instead not text html of , remove tags regex , extract text then, or there other ways? accessing innertext property of <a> should give text nodes @ once : var html = @"<a ....> <b>text need</b> text need </a>"; var doc = new htmldocument(); doc.loadhtml(html); var link_list = doc.documentnode.selectnodes("/a"); foreach (var link in link_list) { console.writeline(link.innertext); } or if need direct child text nodes , grand child text nodes, try way :

javascript - Bootstrap validator doesn't work in bootstrap modal ( the modal is inside a table) -

i using bootstrap3. trying use bootstrap validator forms in bootstrap modal window. modal inside table. have added attributes required validator still not working. please advice.(hover description check out image) my javascript code : $(".category_form").bootstrapvalidator({ feedbackicons: { valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, fields: { category_valid: { validators: { notempty: { message: "this field required", } } }, category_name: { validators: { notempty: { message: "this field required", } } }, } }); html here php : here html php

CSS is not loading when using segment URI in codeigniter -

Image
why css not loading when using segment uri in codeigniter working when remove segment ? this how link css file <title>title</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <!-- bootstrap --> <link href="public/css/bootstrap.css" rel='stylesheet' type='text/css' media="all" /> <!-- //bootstrap --> <!-- custom theme files --> <link href="public/css/style.css" rel='stylesheet' type='text/css' media="all" /> <script src="public/js/jquery-1.8.3.min.js"></script> controller <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class profiles extends ci_controller { public function index() { $user_id = $this->uri->segment(

Service is undefined, angularJs unit Testing error -

i have error shown, tried many solution @ net, example in http://www.benlesh.com/2013/06/angular-js-unit-testing-services.html , seems nothing works. *****app.js var app = angular.module('myapp', ['ui.router','ui.bootstrap','dialogs','ngresource']); app.config(['$stateprovider', '$urlrouterprovider','$resourceprovider', function($stateprovider, $urlrouterprovider,$resourceprovider) { $urlrouterprovider.otherwise('/'); $stateprovider .state('home', { url:'/', views: { ......}}) }]); *****test.js describe('basicservice tests', function (){ beforeeach(module('myapp')); var basic; // excuted before each "it" run. beforeeach(inject(function(basicservice) { basic = basicservice; })); it('should make text exci

Rails engine concerns autoload paths -

i have rails engine 'core', , have: # core/app/models/core/concerns/user_helper.rb module core module userhelper extend activesupport::concern included # methods end end end # core/app/models/core/user.rb module core class user < activerecord::base include core::userhelper end end however says uninitialized constant core::userhelper . seems engine doesn't load concerns default, added in autoload paths module core class engine < ::rails::engine config.autoload_paths += %w(#{core::engine.root}/app/models/core/concerns) isolate_namespace core end end and end error: unable autoload constant userhelper, expected myapp/core/app/models/core/concerns/user_helper.rb define it so wrong here? when checked guide http://edgeguides.rubyonrails.org/engines.html , didn't have concerns in concerns directory, rather under lib/concerns , had reference concern using core::concerns::myconcern, put concerns in engine? thanks edit yury com

cloudfoundry - how to save cloud foundry username and password? -

i can login cloud-foundy/bluemix using: cf login -u my_cf_username -p my_cf_password i can set environment variables store these values (e.g. setting them in .bashrc or .profile ): export cf_user=my_cf_username export cf_pass=my_cf_password cf login -u $cf_user -p $cf_pass however, ideally cloud foundry username , password retrieved properties file, e.g. $home/.cf - possible? this isn't possible current cf cli client. should possible write custom cf cli plugin handle behaviour.

python - How to make a chain of function decorators? -

how can make 2 decorators in python following? @makebold @makeitalic def say(): return "hello" ...which should return: "<b><i>hello</i></b>" i'm not trying make html way in real application - trying understand how decorators , decorator chaining works. check out the documentation see how decorators work. here asked for: def makebold(fn): def wrapped(): return "<b>" + fn() + "</b>" return wrapped def makeitalic(fn): def wrapped(): return "<i>" + fn() + "</i>" return wrapped @makebold @makeitalic def hello(): return "hello world" print hello() ## returns "<b><i>hello world</i></b>"

How to list available plugins in Gradle -

is there way list available plugins in gradle? gradle tasks --all plugins? if not, how plugins gradle project model? there's no such task lists plugins applied project. this method may helpful. project.plugins.each { println }

sql - Wrong GROUP BY field in Django annotate query -

the original problem caused quite awkward cycling models reference: # -> b -> class a: b = models.foreignkey('b', null=true, blank=true) class b: = models.foreignkey('a') now, when i'm trying annotate query, uses group a's id left outer join ( t3.id in example below) instead of a.id . example: a.objects.select_related('b', 'b__a').annotate(reviews=count('reviews')) generated sql: select `a`.`id`, `b`.`id`, t3.`id`, `a` left outer join `b` on (`a`.`b_id` = `b`.`id`) left outer join `a` t3 on (`b`.`a_id` = t3.`id`) `a`.`id` in (1, 2, 3, 4, 5) group t3.`id` order null; i know can next things: change model not cycling reference (unfortunately can't right now) can use .extra() instead of annotations (i'd try avoid it) remove .select_related() call (can't due performance issues) upd: using group t3.id exclude results, a.b == none the best solu

jvm - Monitoring the metrics of the API of Java application -

i using com.sparkjava library writing api.i want monitor metrics of these api average ,min , max time taken give response, throughput api's , count of request sent api etc., i looking suitable library provides these data.i want these metrics data registered in jvm using jmx technology.i know of codahale.metrics library registering ,apart there other better libraries?i don't want write mbean objects , register in mbeanregisrty unless there no other alternative.i looking library gives above metrics data once run application. have tried newrelic ? it's easy set , gives lot of data out of box :)

vba - Access Queries in Sub Database -

i know how open secondary database master database, how can switch "focus" secondary database , scan through table names see if table exists in database, if delete it? this how open database seems check database running code in, not secondary database opened. set qd = currentdb.querydefs("exec_dead") set ws = dbengine(0) set db = ws.opendatabase("c:\test\testing.mdb") on error resumse next docmd.deleteobject actable = acdefault, "late payments today" you need create access.application variable can interact instance of access. dim db dao.database dim tbl dao.tabledef dim accdb access.application set accdb = new access.application accdb.opencurrentdatabase "c:\test\testing.mdb", false each tbl in accdb.currentdb.tabledefs if tbl.name = "the name of table want delete" accdb.docmd.deleteobject actable, tbl.name end if next accdb.closecurrentdatabase set accdb = nothing

php - How to add custom parameter to Prestashop Product Database Table -

i in requirement add custom parameters in product mysql table of prestashop. not know add lines. have altered mysql ps_product table, unable find write parameter , value in php file. i looking @ prestashop code, , stuck @ line $this->object->add() not know go further. can please guide me function or other method pass parameters values.

artificial intelligence - Using Neural Networks Without Training Them -

my task university assignment create ai "moba" style strategy game. have looked using neural networks this. cannot see need train network beforehand. in other words, still considered neural network if hard code in weights , apply minor weight changes @ runtime? neural network 1 thing (a structure of neurons, synapses, etc.) , learning algorithm different thing. so if ask whether nn without learning algorithm can still called nn think answer yes, can.

In coq, how to do "induction n eqn: Hn" in a way that doesn't mess up the inductive hypothesis? -

when using induction, i'd have hypotheses n = 0 , n = s n' separate cases. section x. variable p : nat -> prop. axiom p0: p 0. axiom psn : forall n, p n -> p (s n). theorem pn: forall n:nat, p n. proof. intros n. induction n. - (* = 0 *) apply p0. - (* = s n *) apply psn. assumption. qed. in theory induction n eqn: hn , seems mess inductive hypothesis: theorem pn2: forall n:nat, p n. proof. intros n. induction n eqn: hn. - (* hn : n = 0 *) apply p0. - (* hn : n = s n0 *) (*** 1 subgoals p : nat -> prop n : nat n0 : nat hn : n = s n0 ihn0 : n = n0 -> p n0 ______________________________________(1/1) p (s n0) ****) abort. end x. is there easy way want here? ooo, think figured out! applying inductive hypothesis changes goal (p n) (p (constructor n')), think in general can match against goal create equation n = construct n'. here's

PHP PDO error undefined index serial -

i'm pull hair out. can't undefined index go away. says echo htmlspecialchars($r['serial']) want list item out of database table. <?php try{ $conn = new pdo("mysql:host=$sql_server;dbname=$sql_db", $sql_user, $sql_pass); $sql = "select serial, model, devicecondition, sealcondition, location, deploydate, weight, notes $sql_table order serial"; $q = $conn->prepare($sql); $q->setfetchmode(pdo::fetch_obj); while ($r = $q->fetch()); } catch (pdoeexception $pe) { die("could not connect database" . $pe->getmessage()); } ?> </div> <?php $r = $q->fetchall(); echo htmlspecialchars($r['serial']) ?> see below code, fetchall results in associative array, can data $row['serial'] , use later. added execute() on pdo statement obj. <?php try{ $conn = new pdo("mysql:host=$sql_server;dbname=$sql_db&

Publishing ASP.net to Azure VM -

there lots of information on publishing asp azure cloud web service , forth cannot find lot on publishing azure vm. also problem find assumes have started project azure enabled start. haven't done, have somehow convert it, again have seen many ways of doing on web based on different requirements. so how publish asp.net project (that has no reference azure) azure vm. thanks install web deploy vm , publish directly through visual studio http://www.iis.net/downloads/microsoft/web-deploy

python - Adding lines to a function -

suppose had 2 functions within function so: def foobar(istheworldround = true): def foo(): print("hi, i'm foo.") def bar(): print("hi, i'm bar.") thefunction = none if (istheworldround): return bar else: return [bar, foo] so, can this: myfunction = foobar(false) myfunction() >>> hi, i'm bar >>> hi, i'm foo concerning example have 2 questions: what proper way perform commented line? is there way can without explicitly defining foo ? putting 2 functions list gives that; list of functions. does not make new function calls both of previous functions. that, need define new wrapper function, e.g.: def call_all(*funcs): """create new wrapper call each function in turn.""" def wrapper(*args, **kwargs): """call functions , return list of outputs.""" return [func(*args, **kwarg

How do I auto create student id number in mysql? -

i'm new mysql. created table student . create table student( studentid int(10) not null, firstname varchar(100) not null, lastname varchar(100) not null, birthday varchar(12) not null, gender varchar(7), course_name varchar(150) not null, primary key(studentid ) ); i thought nice studentid auto create system. , don't know how this. may simple question guys. please me this. thanks. the auto_increment attribute can used generate unique identity new rows: ex - create table animals ( id int not null auto_increment, name char(30) not null, primary key (id) ); when inserting data table don't have input data id . insert animals (name) values ('dog'),('cat'),('penguin'), ('lax'),('whale'),('ostrich'); which returns - +----+---------+ | id | name | +----+---------+ | 1 | dog | | 2 | cat | | 3 | penguin | | 4 | lax | | 5 | w

php - Lumen AND OR conditions in Where clause -

i trying run following query in lumen framework: select * user (username = $username or email = $username) , password = $password , flag = 1; my lumen code: $login = user::where('pass', '=', md5($pass)) ->where('flag', '=', $flag) ->where('username', '=', $username) ->orwhere('email', '=', $username)->first(); somehow code return true , bypass login. wrong in query? when remove orwhere query works perfect username. if want group 2 conditions (username , email) single condition (surrounded parenthesis), have this: user::where('pass', '=', md5($pass)) ->where('flag', '=', $flag) ->where(function ($query) use ($username) { $query->where('username', '=', $username) ->orwhere('email', '=', $username); })->first(); here documentatio

Reading Python Module from different PATH -

i have directory layout this: pytest\ __init__.py connect.py sql.py test.py what want pytest directory in python environment path can import modules i.e. connect.py, sql.py or test.py anywhere outside directory or interactive shell. this have in __init__.py : from .connect import * .sql import * .test import * for think parent directory should in python path. question how should go it? for setting python path inside python script, can use sys.path.append() method, method takes directory string need add python path. example - import sys sys.path.append(dir) where dir directory want add path , after files within dir file can imported without issues. to set python take python files different directory directly through terminal or other means, need set pythonpath variable, , not path variable ( path variable used system find executables, not used python find modules/python files) . pythonpath - variable tells python interpreter locate module f

Why is browser opening a new window? (HTML, PHP) -

i'm trying present "message sent successfully" message on page using php output javascript gets paragraph element id , inserts text in it. but reason instead of happening expected browser opening new window (and presumeably outputting code @ point). can tell me why it's opening new browser , how can stop it? haven't been able figure out in looking. also, i'm using bootstrap 3 framework - why? thanks help. <?php /* set e-mail recipient */ $myemail = "hello@madeupemail.com"; /* check form inputs using check_input function */ $name = check_input($_post['inputname'], "name"); $email = check_input($_post['inputemail'], "email"); $phone = check_input($_post['inputphone'], "phone"); $message = check_input($_post['inputmessage'], "enter message here"); /* if e-mail not valid show error message */ if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email)) {

windows - Slow console input when interactively plotting matplotlib -

i want input stuff in console , every , update graph. therefore use pylab interactive mode. however, when typing input windows console responds short time delay if memory used interactive plotting. is there way avoid slowing effect? import pylab plt plt.ion() #░interactive mode on plt.plot([1,2,3]) plt.draw() while true: test=str(raw_input('type fast , observe delay\n: '))

database - Data Logical organization -

i have 2 tables: counterparties , customers. , both have address field. don't know, better if create third table "addresses"? the first way: counterparty id name city streetname room customer id firstname lastname city streetname room second way: counterparty id name addressid customer id firstname lastname addressid address id city streetname room what better way? the first solution better, unless either: you have customers counterparties (but should change whole schema design), or several customers and/or counterparties have same address (for instance in same building). there no other reasons choose second solution.

ios8 - How to make view to fix the screen IOS 8? -

Image
i designed app, first app :) i'm having issue fixing view screen. can see below in picture, has empty spaces right , bottom. tried add constrainst , disable auto layout. tried enable auto layout, , tried enabling both auto layout , size classes. looked internet, yet still couldn't find such example solves situation. it shouldn't hard since i'm trying 3 hour. i'd appreciated if can me figure out! here picture briefly explains situation: thanks! i think need add constraints, autolayout, tried solve issue , solved using autolayout. see screenshot.

file upload - Call to a member function saveAs() on a non-object in yii2 -

i trying run application in yii2 tried upload user profile picture , works problem starts when try update name file. shows me error call member function saveas() on non-object . tried update without changes.. time show me same error... error goes if change pic. controller public function actionupdate($id) { $model = $this->findmodel($id); if ($model->load(yii::$app->request->post()) && $model->save()) { // instance of uploaded file $imagename = $model->user_username; $model->file = uploadedfile::getinstance($model,'user_avatar'); $model->file->saveas( '/uploads/'.$imagename.'.'.$model->file->extension ); //save path in db.. $model->user_avatar = 'uploads/'.$imagename.'.'.$model->file->extension; $model->save(); return $this->redirect(['view', 'id' => $model->user_id]); } else {

windows phone - Install new AET token via Company Hub -

we in process of making company hub app. understand users have install aet token able install company hub app - in no problem. but have read aet token has refreshed each year. wondering is; is possible refresh/install aet token company hub app? i want spare users pain of having install aet token. regular users don't understand why have in first place prevents them wanting install app. if able refresh aet token automatically lot? edit don't mind using method app cannot allowed in market. from here frequently asked questions windows phone company hub apps : what happens company hub apps when aet token expires? once aet token expires, company hub apps, signed using same cert, fails run on device. aet token valid year. need update aet token on device before expires. can push new aet device using mdm or unmanaged scenarios has installed manually via email or ie. i started search there, , imho, allow auto install aet tokens automat

php - Tree listing for categorys -

i have array this array ( [0] => stdclass object ( [cat_id] => 3 [cat_name] => sample 3 [cat_description] => [cat_folder] => sample_3 [cat_path] => sample_3 [cat_parent] => 0 [cat_num_files] => 0 [cat_num_files_total] => 0 [cat_user_roles] => [cat_owner] => 1 [cat_icon] => [cat_exclude_browser] => 0 [cat_order] => 0 ) [1] => stdclass object ( [cat_id] => 2 [cat_name] => sample 2 [cat_description] => [cat_folder] => sample_2 [cat_path] => sample_3/sample_2 [cat_parent] => 3 [cat_num_files] => 0 [cat_num_files_total] => 0 [cat_user_roles] => [cat_owner] => 1 [cat_icon] => [cat_exclude_browser] => 0 [cat_order] => 0 ) ) i need list these like -sample 3 --sample 2 ---sa

zip4j - Extract zip and re-zip with password in java -

i trying extract list of zip files folder , re-zipping them password. problem while re-zipping, iteration/loop not stopping. also, re-zipped files should separate zip file each rather merging contents 1 zip. here's have tried: import java.io.file; import java.util.arraylist; import java.util.list; import net.lingala.zip4j.core.zipfile; import net.lingala.zip4j.exception.zipexception; import net.lingala.zip4j.model.zipparameters; import net.lingala.zip4j.util.zip4jconstants; public class addfileswithaesencryption2 { public addfileswithaesencryption2() { try { //extract zip files folders try { string zipsourcepath = "e:/eziptest/"; string extractto = "d:/dziptest/"; string files1; file folder1 = new file(zipsourcepath); file[] listoffiles1 = folder1.listfiles(); (int = 0; < listoffiles1.length; i++) {

mysql - multiple select on stored procedure -

i'm trying multiple selects 1 table shown last select statement. create procedure `usp_getstockcard` (in matecode varchar(10)) begin (select tran_date tran_date tm_matbalance mate_code=matecode); (select mate_code mate_code tm_matbalance mate_code=matecode); (select tran_qtyx qty_in tm_matbalance tran_type='in' , mate_code=matecode); (select tran_qtyx qty_out tm_matbalance tran_type='out' , mate_code=matecode); end i've tried change semicolon comma after each select statement said syntax error: missing 'semicolon'. please help. i @ problem , think solve it. basically there 2 problems here first 1 pivot table tran_qtyx column become qty_in , qty_out based on value in tran_type column (in or out)... part of problem solve query select tran_date, mate_code, sum(case when tran_type = 'in' tran_qtyx else 0 end)

javascript - WEBVIEW - Android cannot implement css like in chrome browser -

i have problem showing html file css , webdatabase when launch in chrome (in mobile phone) it's working correctly when implement in webview code missing. here html: <!doctype html> <!--[if lt ie 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> <!--[if ie 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> <!--[if ie 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> <!--[if gt ie 8]> <!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> <title>iwearzule tts</title> <meta name="viewport" content="width=device-width,initial-scale=1"> <script src="js/db.js"></script> <

json - C# JsonArray to string (not string array. string only) -

i've been searching 1 quite while can't find anything. appologies title, there lot on converting content string arrays, not need. i need way convert contents of jsonarray string is. (similar jtoken's .tostring()). scenario of such nature need string of array is, irrigardless of type/s contained within. there ways of handling weakly typed json valueconverters, spesifically not want use them, need pass content of field string javascript function in webview. i have following json (note markers indicating string desired) : "highlights2":[ { "_id":"highlight2-2850cb68121f9d4093e67950665c45fab02cec81", "_rev":"9-c4345794001495104f8cbf5dd6999f3a", "content":{ <---- need string "#roepman.17.0":[ [ 233, 249, "itsi-hl-gr" ], [ 298, 317, "itsi-hl-bl" ] ],

Process a perl script within a python script -

i'm trying execute perl script within python script. code below: command = "/path/to/perl/script/" + "script.pl" input = "< " + "/path/to/file1/" + sys.argv[1] + " >" output = "/path/to/file2/" + sys.argv[1] subprocess.popen(["perl", command, "/path/to/file1/", input, output]) when execute python script, returned: no info key. all path leading perl script files correct. my perl script executed command: perl script.pl /path/to/file1/ < input > output any advice on appreciate. the analog of shell command: #!/usr/bin/env python subprocess import check_call check_call("perl script.pl /path/to/file1/ < input > output", shell=true) is: #!/usr/bin/env python subprocess import check_call open('input', 'rb', 0) input_file, \ open('output', 'wb', 0) output_file: check_call(["perl", "script.pl&qu

python - How can it be that len(sys.argv) <= 0? -

in code, following error triggered, , not understand how case can come up: if(len(sys.argv) > 0): dosomething() else: raise attributeerror("could not parse script name") the above code in python class, import , use in script. use same class same call in other scripts, , works fine everywhere else. fyi, os ubuntu. how possible len(sys.argv) <= 0? ok, found answer; @nneonneo gave right hint, @ point argv modified: args = sys.argv del args[0] i guess author of code wanted different, because deletes sys.argv[0]. looking change in following way: args = sys.argv[1:] thank you!

html - How to change the <hr> size and center it of a div? -

Image
hr { width:100%; height:2px; background-color:#888; } <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" rel="stylesheet"/> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/> <div class="content"> <div class="container"> <div class="row"> <div class="col-xs-12"> <div class="row"> <div class="col-sm-6 col-sm-offset-1"> <h3> news</h3> <h4>the new concept</h4> <p>while files form internet can useful , file type can prote....</p> <div class="read-more"> <a href="#">read more news</a> </div> </div>

c# - How do i loop and add the items to comboBox so it will start from 1 to 8? -

for (int xx = 0; xx < picount; xx++) { combobox1.items.add(xx); } picount int. , value of 8. if i'm starting 0 see in combobox 01234567 want see 12345678 just change loop: for (int xx = 1; xx <= picount; xx++) { combobox1.items.add(xx); } notice how upper limit comparison changed form < <= . you can keep loop , add 1 in body: for (int xx = 0; xx < picount; xx++) { combobox1.items.add(xx + 1); }

cq5 - How to create a custom multifield for touch UI in CQ(AEM6)? -

i have custom multifield in component works in classic ui(sidekick ) . when switch touch ui mode, custom multifield doesn't work. dialog doesnt show anything, no "+" button add fields had designed in custom multifield. also, dialog converter unable convert custom multifield corresponding version touch ui. any ideas on how create custom multifield in touch ui? the syntax of multifield in coral ui looks follows: <mymultifield jcr:primarytype="nt:unstructured" sling:resourcetype="granite/ui/components/foundation/form/multifield" fieldlabel="my multifield"> <field jcr:primarytype="nt:unstructured" sling:resourcetype="granite/ui/components/foundation/form/textfield" name="./mymultifield" /> </mymultifield>

android - FFMPEG command to crop and transpose video comes out zoomed in bad quality -

Image
i'm trying convert mp4 video dimensions 960x720 sqaure 480:480 video comes out looking squished usually, command is "-y -i %s -vf crop=480:480,transpose=%d -threads 5 -metadata:s:v rotate=0 -c:v libx264 -crf 27 -preset ultrafast -c:a copy -bsf:a aac_adtstoasc %s"; am missing something, need down scale first or something? **edit adding full console output. ffmpeg command updated, goal still remains same, take arbitrary video , square crop it 07-14 22:30:32.813: d/ffmpeg(30354): -y -i /data/data/com.myapp.app/cache:temp/i7h4ajm0nim1mbcnrqotvrhhsc.mp4 -vf scale=iw*sar:ih,transpose=1 -threads 5 -metadata:s:v rotate=0 -c:v libx264 -crf 27 -preset ultrafast -c:a copy -bsf:a aac_adtstoasc -aspect 1:1 /data/data/com.myapp.app/cache:temp/p1t3bhs0oa3lpqa67g5i9ninm9.ts 07-14 22:30:32.903: d/ffmpeg(30354): new time reamining 9283 07-14 22:30:32.913: d/ffmpeg(30354): running publishing updates method 07-14 22:30:35.963: d/ffmpeg(30354): warning: linker: /data/data/com.myap

visual c++ - Access Denied in CreateFile2 (Windows 10) -

i trying write file via c++ code. getting "error_access_denied". 1 please me identify missing in below code. have write file using c++ project requirement. handle hfile; hfile = createfile2(text("e:\\mytextfile.txt"), generic_write , file_share_read | file_share_write | file_share_delete, create_new, null); if (invalid_handle_value == hfile) { string^ msg = "uncached error"; switch (getlasterror()) { case error_file_not_found: msg = "file not found "; break; case error_access_denied: msg = "access denied "; break; default: break; } messagedialog(msg, "error").showasync(); } else { platform::string^ data = txtreadwrite->text->tostring(); writefile(hfile,&data, (dword)sizeof(data), (dword)0, null); closehandle(hfile); } windows store apps run in low-privilege sandbox calle

css - Justified blocks in a Susy grid -

susy great tool, feel have come across weakness it. let's have 3 floated block elements in "blocks" container: the "block" element given "span(4 of 12)" <div class="blocks"> <div class="block"> //img , text </div> <div class="block"> //img , text </div> <div class="block"> //img , text </div> </div> as expand window, content inside blocks gets large liking, add max-width "blocks" element. when max-width reached, i, unfortunately, find blocks close together... add max-width "block" elements... screws floated layout third block floated right (last) , first 2 floated left (causing increased space between 2nd , 3rd elements resize). i finding best way setting "text-align: justify" on "blocks" container, , "display: inline-block" on "block" elements. me

Windbg for memory analysis using mimikatz ERROR [CRYPTO] acquire keys -

i'm using windbg version 6.12 , using mimilib.dll debugging memory. works fine until following output on ui 0:000> !mimikatz dpapi backup keys ================= current prefered key: compatibility prefered key: sekurlsa ======== [error] [crypto] acquire keys note: memory dmp of lsass is symbol or respective dll /system32? kindly suggest. i using windbg x86 x64 required.

c# - In the View of .net MVC , the "ModelObject Attributes" value is shown as null after a PostBack -

in asp.net mvc ,i want return modelobject view after postback from[httppost]actionmethod, condtion modelobject should same/sametype of modelobject-argument used in same [httppost]actionmethod. issue :after post null modelobjectattributes shown in same view. otherfindings:while removing modelobject argument of [httppost]actionmethod , after postbacking ,the values shown in view code attached. public actionresult index() { //testmodelclass objmodel = new testmodelclass(); objmodel.name = "i get"; objmodel.message = "get message delivered"; return view(objmodel); } issue : action method not working.ie; "no values shown @ view" otherfindings :values shown in view, while not using "testmodelclass objmodel" argument. [httppost] [actionname("index")] public actionresult indexpost(testmodelclass objmodel) { enter code heretestmodelclass objmodel1 = new testmodelclass(); objmodel1.name = "i pos