Posts

Showing posts from September, 2014

authentication - Yii2 Login from DB (Setting unknown property: app\models\User::password_hash) -

i want user authentication in yii based on user table in database. user model: <?php namespace app\models; use yii; use yii\base\notsupportedexception; use yii\db\activerecord; use yii\helpers\security; use yii\web\identityinterface; /** * model class table "user". * * @property integer $id * @property string $username * @property string $password * @property string $title */ class user extends \yii\db\activerecord implements identityinterface { public static function tablename() { return 'user'; } /** * @inheritdoc */ public function rules() { return [ [['username', 'password'], 'required'], [['username', 'password'], 'string', 'max' => 100] ]; } /** * @inheritdoc */ public function attributelabels() { return [ 'id' => 'userid'

testing - Selenium, JAVA - how to find such element? -

do know how find , click @ element this: <div class="offer ctrlopenofferinfo"> <a class="linkoffer" href="offer_view.html?id=1007"/> <p class="photo"> <p class="name">new offer</p> <p class="price">123</p> <div class="rate ctrlviewrateoffer" data-value="0.0000"> <p class="date"/> <div class="hide info"> <div class="bginfo"/> using selenium webdriver , using name of element there few similiar elements on page? here's i've tired far: webdriverwait wait = new webdriverwait(driver, 30); wait.until(expectedconditions.invisibilityofelementlocated(by.xpath("//*[text()='new offer']"))); wait.until(expectedconditions.elementtobeclickable(by.xpath(".//*[@id='formdevelopmentelementadd'][text()='new offer']"))); driver.findelement(by.xpath(".//*[@id='fo

ios - view controller segue connections for multiple view controller interconnection -

working on application contains 3 view controllers a,b , c. can navigate view controller 1 view controller. a->b, a->c, b->a, b->a, c->a, c->b using storyboard segue type show each transition. while analysis came know view controller old instance not release , new instance created each navigation. while using button event dismissing current view controller [self dismissviewcontrolleranimated:yes completion:nil]; navigation instance released. cant used case, need switch view controller , release current view controller. suggest segue connection used such release of view controller should done? or other methods achieve should not affect performance. struggling different analysis since retain count increase new transition view controllers, analysed allocation tool. right present view controllers , dismissviewocontroller completion?

Share Maven run configurations with other developers using Intellij IDEA -

we have following project setup: maven, eclipse, subversion. eclipse launch configurations in separate docs folder next pom.xml . launch configurations run mvn clean install -pdev or mvn tomee:run -pl something-ear the thing shared run configuration picked ide , shown in external tools run commands. way, every developer checks out project has access run build. we have similar using intellij idea, haven't found equivalent. have considered far: share run scripts my first idea replace launch configurations run scripts. not figure out how have run scripts run inside intellij idea way maven goal executed. share idea project configuration the idea project configuration (specifically .idea/runconfigurations ) inside checked out directory not solution. have (speaking 1 idea project different idea modules depending on task @ hand: developer might need multiple idea modules (and sub-modules) in same idea project an idea project consisting of following modules not unusal

android - Viewpager is Not Scrolling when kept with Recylerview -

Image
i using viewpager , recyclerview in framelayout. <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".homeactivity"> <android.support.v4.view.viewpager android:id="@+id/top_container" android:layout_width="match_parent" android:layout_height="300dp" /> <android.support.v7.widget.recyclerview android:id="@+id/regular_view" android:cliptopadding="false" android:paddingtop="300dp" android:layout_width="match_parent" android:layout_height="match_parent" /> i want hide viewpager on scroll of recyclerview vertically. working. scroll of viewpager not working. why happening ? here example drawer layout used implement left navigation drawer

Composing arbitrary JSON objects in embedded structs in Go -

i'm trying generate json objects in form of {{"s":"v1", "t":"v2"}, {"s":"v3", "t":"v4"}, etc} via embedded structs in go. it works out fine when problem items in type problems []problem known ahead of time, can seen in func one() below , in playground demo here. however, if k:v pairs contain empty values i'd avoid getting {{a},{},{c}} instead of desired {{a},{c}} , in func two() below , in demo. or alternatively, how can compose probs := problems{prob0, prob1, prob2, etc} below arbitrarily without knowing ahead of time whether prob item added or omitted? package main import ( "encoding/json" "fmt" ) type problem struct { s string `json:"s,omitempty"` t string `json:"t,omitempty"` } type problems []problem func main() { one() two() } func one() { prob0 := problem{s: "s0", t: "t0"}

java - Spring XD: Is it possible to have multiple jobs in a single module -

i'm using spring xd execute batch task, divided 2 separate jobs living in same (job:)module. i'm quite new spring xd/batch have rather basic understanding of framework. i'd know if there's way address each of jobs separately? know can deploy job giving modules name, haven't found way specify job want deploy. should there 1 job per module? , if not, how can talk to/deploy each of jobs separately? please let me know if description of problem unclear. thanks spring xd requires 1 "main" job executed within module. being said, spring xd support spring batch's concept of nested jobs 1 job used orchestrate launching of multiple jobs sounds fit bill. "main" job required have id "job". after that, job can call number of other jobs packaged in same module via job steps.

objective c - Constant crop aspect ratio using PEPhotoCropEditor library in iOS -

i'm using pephotocropeditor library in 1 of ios project. able having constant aspect ratio (1:1) following code. - (void)openeditor { pecropviewcontroller *controller = [[pecropviewcontroller alloc] init]; controller.delegate = self; controller.image = self.imageview.image; uiimage *image = self.imageview.image; cgfloat width = image.size.width; cgfloat height = image.size.height; cgfloat length = min(width, height); cgrectmake(cgfloat x, cgfloat y, cgfloat width, cgfloat height) controller.imagecroprect = cgrectmake((width - length) / 2, (height - length) / 2, length, length); // restricted square aspect ratio controller.keepingcropaspectratio = yes; controller.cropaspectratio = 1.0; uinavigationcontroller *navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:co

string - How do I convert a deliminated file in base - R into separate columns without creating a list? -

i using following code: write(unlist(fieldlist),"c:/temp/test.txt") temp1<-cbind(fieldlist,read.delim("c:/temp/test.txt",sep=" ",header=false)) but slow because obliges app write data temp file on disk. i have tried strsplit function , "qdap" library both create lists. need able manipulate columns separately newcolumn <- substr(temp1[,5],1,1)

time complexity - Homework: Prove or disprove: (5n)!=O(n!^5) -

Image
i have question in h.w: prove or disprove: (5n)!=o(n!^5). i don't know how approach (of course know o notation definition don't have clue how solve it).. please? i think have use stirling's approximation here, gives following approximations: since known that: we have: if need more detailed proof, can indeed use big o formal definition , still stirling's approximation, obtain result.

mysql - Native query executeUpdate seems to commit data in Spring transaction -

my usecase following: when creating application user (entitymanager.persist) have create db user , grant him privileges (that's why need hibernate nativequery). i have spring @transactional method calls dao both calls: @transactional public integer createcompany(company company) throws exception { companydao.createreportuser(reportuser user); ... } my dao method looks this: getem().persist(companyreportsuser); getem().createnativequery("create user user1@localhost identified :password").setparameter("password", password).executeupdate(); getem().createnativequery("grant select on appdb.v_company user1@localhost").executeupdate(); //several grants now, first line executeupdate() executed can see persisted companyreportsuser in database along db user (user1@localhost). all nativequeries executed , commited 1 one. since commited, cannot rolled back. there no auto-commit parameter set anywhere in configuration assume 'false

.net - XML parsing using C# for sibling element with namespace -

i've complex xml , parse in c# using linq: <?xml version="1.0"?> <?mso-application progid="word.document"?> <w:worddocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxhint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:c2f41010-65b3-11d1-a29f-00aa00c14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xml:space="preserve" w:embeddedobjpresent="no"> <w:docpr xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"> <w:displaybackgroundshape/> <w:view w:val="print"/> <w:zoom w:percent=""/> <w:defau

playframework - How can I run play application to be visible across the network? -

i cloned application on amazon ec2. when type sbt run , runs on localhost (by way, can't @ via lynx, ok?) tried sbt run -dhttp.port=port -dhttp.address=my.amazon.public.ip , regular browser this webpage not available on my.amazon.public.ip:port . also need amazon, not heroku etc. so, how can run application visible across network, not localhost? just did not open port in security group. after that, worked.

java - Ant fails in try catch block -

in ant build have following code: <trycatch reference="exception_ref"> <try> <echo>start building delivery</echo> </try> <catch> <property name="exception" refid="exception_ref" /> <property name="message" value="error in trycatch block:${line.separator}${exception}" /> <echo message="${message}" /> <fail message="${message}" /> </catch> <finally> <echo>finally</echo> </finally> </trycatch> ant says: problem: failed create task or type trycatch cause: name undefined. action: check spelling. action: check custom tasks/types have been declared. action: check / declarations have taken place. what missing here? // edit: using ant in eclipse trycatch task provided ant-contrib third-party library. make sure download jar , have refere

onfocus function in javascript without using id -

i have table , few rows, when user enters value in cell, checks correct format , pop's message if value incorrect , want focus stay in current cell. dont have id in input type, directly passing value. can tell me, without using document.getelementbyid().focus(), other way focus on current cell. tia if event handler bound input should able capture this . otherwise should able read target property of the event object .

html - VB.NET/GetElementByClass how to div class click? -

</div></div></div><div class="f u" id="m_more_item"><a href="/browse/likes/?id=1026395497374065&amp;start=30&amp;refid=53"><span>diğerlerini gör</span></a></div></div></div></div></div></div></div></body></html> document code: dim h1 htmlelementcollection = nothing h1 = w.document.getelementsbytagname("div") each curelement htmlelement in h1 if instr(curelement.getattribute("classname").tostring, "f u") curelement.invokemember("click") but code not work me ? off example: vb.net - select class using getelementbyclass , click item programmatically the problem trying click div instead of trying click href tag. want instead. since there no "class" or on element, like... dim h1 htmlelementcollection = nothing h1 = w.document.getelementsbytagnam

Java Object class and multiple inheritance -

this question has answer here: if 1 class derived derived object, “multiple inheritence” 7 answers it may very basic question didn't find answer far, asking here. default in java, every class extends object class far know. again how able extend other class multiple inheritance not possible in java. in advance. a class can't have more 1 direct super-class, can have multiple ancestors. for example, arraylist extends abstractlist extends abstractcollection extends object . though arraylist has 3 ancestors, has 1 direct super-class - abstractlist .

python - Starcluster, how to do a specific task on separate node -

working on python application process high statistical data , perform long complex calculation. when user requests async thread has been created , starts calculation , save results in database @ equal interval, @ main thread keep looking changes in database , update user results. now i'm asked use mit's starcluster works aws. have created master , slave clusters my question how use mpi4py to perform calculation @ node (slave) machine , other things @ master? i haven't written code found example showing how works in sense of load balancing, https://gist.github.com/brantfaircloth/2379572 is there way can call specific api @ node machine perform task @ node machine?

c - What is Partial Linking in GNU Linker? -

the best explanation able find official document: -r --relocateable generate relocatable output--i.e., generate output file can in turn serve input ld. called partial linking. side effect, in environments support standard unix magic numbers, option sets output file's magic number omagic. if option not specified, absolute file produced. when linking c++ programs, option not resolve references constructors; that, use -ur. option same thing `-i'. i interested in knowing happens symbols present in inputs linker. take specific case when have static library libstatic.a contains single object file component.o . now, want create static library libfinal.a work interface libstatic.a . use command create it: ld -r -o libfinal.a wrapper.o -l. -lstatic where wrapper.o provides exclusive apis call functions defined in libstatic.a will libfinal.a combined archive having wrapper.o , component.o or references can-be-resolved between wrapper.o , component.

mysql - how to execute the rest of the batch after exception thrown during the progress -

i trying have batch process number of insert queries using addbatch. during execute, throws out exception @ first query causes exception however rest of batch not processed. best approach handle matter? if using rollback , isolate error query before reprogress, may repeat same situation @ next error query. inefficient, particularly if batch insert volume huge. advice. can try surround first query try catch block , duck exception. although suggest not best coding practice. when have list of insert statements executed need take care whole got executed or none of operation got successeded.in addition per business scenario have have @ batch skip , restart ability if works you

json - How can I tell RestTemplate to POST with UTF-8 encoding? -

i'm having problems posting json utf-8 encoding using resttemplate. default encoding json utf-8 media type shouldn't contain charset. have tried put charset in mediatype doesn't seem work anyway. my code: string datajson = "{\"food\": \"smörrebröd\"}"; httpheaders headers = new httpheaders(); mediatype mediatype = new mediatype("application", "json", standardcharsets.utf_8); headers.setcontenttype(mediatype); httpentity<string> entity = new httpentity<string>(datajson, headers); resttemplate resttemplate = new resttemplate(); responseentity<boolean> formentity = resttemplate.exchange(posturl, httpmethod.post, entity, boolean.class); you need add stringhttpmessageconverter rest template's message converter charset utf-8. resttemplate resttemplate = new resttemplate(); resttemplate.getmessageconverters() .add(0, new stringhttpmessageconverter(charset.forname("utf-8"))

algorithm - Single pass EDI parsing without an XML schema - Possible? -

before sigh , hold head in hands, please understand i'm working pretty old system on rather tight timeline. we have single pass edi parser written in business language. currently, data definitions including loop level, area, , name of each segment stored in database table. table assigns each segment within area incremental sequence number. e.g., 004010 810 header area: segment sequence big 5 nte 10 cur 15 ref 20 ynq 25 per 30 n1 (start of loop) 35 n2 40 etc. etc. so, if read segments in order appear in standard, can each 1 can assigned sequential number, "depth" (how many loops "down" appears) , name (2-3 characters). the algorithm followed parser @ present follows: reset currentarea 1 each segment in document { search segment's name in table restricting area >= currentarea. if not found, have error. else { if area changed { empty temporary "search bounds" table. create single recor

c++ - How to use miniupnpc with Boost.Asio UDP when binding a socket to a random port -

i'm astonished lack of documentation on miniupnp, believe there's lot of people using it, no documentation @ all, found piece of code in source of raknet guide me. now i'm having conceptual issue... i'm developing app connects server via udp (the server should accessible, server udp port specific 1 open, , can test using open port checker), server puts 2 or more clients talking each other (p2p), need circumvent nat in clients work. i have nat punch through working, , solves lots of cases. now, want add upnp functionality, attack nat issue too. i'm using miniupnpc, , handle connections boost.asio. struct upnpdev * devlist = 0; devlist = upnpdiscover(2000, 0, 0, 0, 0, 0); if (devlist) { std::cout << "\nlist of upnp devices found on network :\n"; struct upnpdev * device; for(device = devlist; device; device = device->pnext) { std::cout << "\ndesc: " << device->descurl << "\n st

c# - Is good practice to create controls as partial views in .NET MVC5? -

i'm pretty new in mvc , planing something, i'm not sure practice or not. create ui controls partial views. example, have autocomplete control, have autocomplete partial views scripts needed , everything, , pass model through renderpartial? so, hear comments? mvc offers lot of options separate view code might confusing in begging. main 4 of them are: partial views @helper methods html helpers display/editor templates i not go in details here because there lot of info them. example @helper methods vs html helpers vs partial views . or editor/display templates vs partial views . for complicated controls autocomplete suggest use partial views or html helpers.

javascript - Three js render child mesh always before his parent -

Image
i have scene() , meshes: scene: scene.add(layer1) layer.add(layer2) layer2.add(layer3) wanted result is: layer1 covered layer2 , covered layer3. it works fine, when go far away camera, there start loss precision problem , looks this: (layers not correctly rendered 1 another) i tried solve materials, layer2.material.depthtest = 0; layer3.material.depthtest = 0; works fine, there problem object between camera , layers. do exist best practice solution?

css - Sass / Compass in Symfony2 -

i try'in use scss files symfony2 , asseticbundle. my config.yml assetic part: assetic: debug: %kernel.debug% use_controller: false bundles: [] filters: sass: ~ compass: ~ #closure: # jar: "%kernel.root_dir%/resources/java/compiler.jar" #yui_css: # jar: "%kernel.root_dir%/resources/java/yuicompressor-2.4.7.jar" my base.html.twig : <!doctype html> <html> <head> <meta charset="utf-8" /> <title>{% block title %}welcome!{% endblock %}</title> {% block stylesheets %} {% stylesheets filters="compass" "@testbundle/resources/public/sass/main.scss" %} <link rel="stylesheet" href="{{ asset_url }}" /> {% endstylesheets %} {% endblock %} <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" /> </he

Why can't Git handle large files and large repos? -

dozens of questions , answers on , elsewhere emphasize git can't handle large files or large repos. handful of workarounds suggested such git-fat , git-annex , ideally git handle large files/repos natively. if limitation has been around years, there reason limitation has not yet been removed? assume there's technical or design challenge baked git makes large file , large repo support extremely difficult. lots of related questions, none seem explain why such big hurdle: git large files what file limits in git (number , size)? git - repository , file size limits versioning large text files in git how handle large git repository? managing large binary files git what practical maximum size of git repository full of text-based data? [quora] basically, comes down tradeoffs. one of questions has example linus himself: [...] cvs, ie ends being pretty oriented "one file @ time" model. which nice in can have million files, , check out

java - ESAPI for XSS prevention not working -

i working on fixing cross site scripting issues in our code in jsps. below original code //scriplet code <% string userid = request.getparameter("sid"); ...%> and in same jsp have <input type = hidden name = "userid" value = "<%= userid %>" /> i have made changes include esapi-2.1.0.jar in lib , esapi.properties, validation.properties in classpath. made below changes scriplet code fix above code //scriplet code <% string userid = esapi.encoder().encodeforhtml(request.getparameter("sid")); ...%> i thought fix issue when scan code using fortify, these lines again highlighted having xss issue. please if guys have idea on how should handled. thanks. ------- update thanks lot @avgvstvs. insightful.follwd guidelines, not sure if missng somethn. code - string usersid=esapi.encoder().encodeforhtmlattribute(request.getheader("janus_sid")); sessio

jquery - Getting a JS error when publishing site -

getting a: error: referenceerror: $ not defined when publish website. though have jquery lib added in layout page, , on partialview complains not finding jquery lib how reference it: <script src="~/scripts/jquery-1.10.2.min.js"></script> when run website locally, works fine, no js errors, published, starts complaining. add code question, not sure code add. want know if there difference in how js files loaded when site published, when running locally. has experienced such errors? on 2nd thoughts, i'll try add code anyway. code complains this: (and in partialview) <script type="text/javascript"> $(document).ready(function () { $('#slider').rhinoslider(); $("#sliderholderqitoz").toggle("fade", 6000); }); </script> my layout looks this: <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=devi

ListView grid in React Native -

Image
i'm building simple app in react native fetches listings remote json source , displays them on screen. so far, using excellent example here, i've managed results display using listview components in rows (i.e. 1 result per row, see screenshot). need results display in grid, i.e. 3 6 items per row, depending on screen size , orientation. what best way these results grid? can use listview this, or one-per-row results? i've tried playing around flexbox styles but, since react doesn't seem accept % values , listview doesn't accept styles, haven't yet had success. you need use combination of flexbox , , knowledge listview wraps scrollview , takes on properties. in mind can use scrollview's contentcontainerstyle prop style items. var testcmp = react.createclass({ getinitialstate: function() { var ds = new listview.datasource({rowhaschanged: (r1, r2) => r1 !== r2}); var data = array.apply(null, {length: 20}).map(number.call

c# - Why can the resource cannot be found? -

i have asp.net application following view directories. -account -shared -layout -home -index -about -upload -uploadindex -uploadview -uploaddelete in layout have fellowing actionlink: <li class="navbar-links"> @html.actionlink("view uploads", "uploadindex", "upload", new { @class = "navbar-links" }) </li> if in de home/index page go home/uploadindex. when type in de url http://localhost:12345/upload/uploadindex , actionlink upload works. how make actionlinks works other directory other controller. a link in mvc (i think you're using mvc) routed controller invokes view. link /upload/uploadindex default handled method uploadindex on uploadcontroller . however, @html.actionlink("view uploads", "uploadindex", "upload", new { @class = "navbar-links" }) doesn't think it's doing. resolves https://msdn.microsoft.com/en-us/library/dd49212

javascript - My unsaved changes directive needs to work for all forms with different names -

i have directive opens modal alert user of unsaved changes , need check form dirty different unknown names. have tried use scope access forms name , this have not been successfull. can access form name elem[0].name not carry form $dirty value. <form class="form-inline" role="form" name="myformname" confirm-on-exit> cool form html </form> app.directive('confirmonexit', ['modalservice', '$rootscope', '$stateparams', '$state', function (modalservice, $rootscope, $stateparms, $state) { return { restrict: 'a', link: function (scope, elem, attrs, formctrl) { onroutechangeoff = $rootscope.$on('$statechangestart', routechange); function routechange(event, newstate, newparams, fromstate, fromparams) { if (scope.myformname.$dirty) { return; } event.preventdefault(); var modaloptions = {

Does Drools Salience Have Performance Impacts? -

for example, if have 1 million fact objects, going through set of rules, execution order of rules irrelevant. there performance difference between: explicitly assign different salience values each rule use default salience value (0) or rules same salience value? just curiosity, because heard latter 1 performs better. i did benchmarking myself. result shows different salience approach have overhead, , increases total processing time (not though), time spent on fact object processing seems same. not sure if observation meets underlying code logic. i should thank both detailed explanation. for drools 6. each rule match (also called activation or rule instantiation) given rule added bidirectional linked list. firing rule matter of iterating list, firing each rule in turn. each rule evaluate placed on binaryheapqueue , rules popped in turn, evaluated, linked list produced, , iterated attempt firing. if there large number of rule matches, per rule, cost of hea

how to improve simple prolog login? -

i building first project in swi-prolog.it expert system guess user identification base on input of user. of code produces dialog allows user enter information, verifies information , allows user have access. there way improve code? % user facts enable user log in user(dac,dac11). user(dac101,daa). % login gui. checks database log in logingui :- new(dialog,dialog('login')), send_list(dialog, append, [ new( username, text_item(username)), new(password, text_item(password)), button(enter, and(message(@prolog, checkuser, username?selection, password?selection), message(dialog, destroy) ))]), send(dialog, default_button, enter), send(dialog, open). % verfies user logging checkuser(username,passwo

r - Can I lag daily data by months with lag ( )? -

i have daily data on several years several currencies. lag variables in data set 1 month (i.e. june 15 july 15, not 30 days). na's fine not possible. i have gotten far writing this: ddply(data, .(currency), function(x){ #first column date, 2nd currency, rest data. y=x[,-(3)] #this data want lagged y$date=as.date(y$date) %m+% months(1) #this increases dates 1 month x$date=as.date(x$date) #what data dont want lagged x[, (1:3)] below z=merge(x[,(1:3)], y, by=c("date", "currency")) #merge date, #lagged stuff merges non-lagged stuff 1 month later original obs date return(z) }) i can include data if necessary, given have works dont want spend time on it. i want check cant use lubridate %m+% months(1) syntax within lag function. have tried lag function package "statar" uses along_by syntax haven't been able figure out. thanks!

php - Is it possible to include an image in a HTML email in Laravel -

i'm trying send html email via laravel's mail::send() . view in i'm using blade template, i'm not quite sure on how go including image in body of email. in template, have <h4>you have updated session!</h4> @if ( $old_date != $date) <p>you have changed {{ $old_date }} {{ $date }}</p> @endif <p>if have questions or concerns, please contact office of admissions</p> {{ html::image('/images/full-logo.png', 'logo') }} however, email comes out broken link icon in body of email. possible pass image parameter view? in controller sends email, have $data = array ( 'first_name' => $student->first_name, 'last_name' => $student->last_name, 'date' => $day, 'old_date' => $old_day, ); mail::send ( '/emails/create_student', $dat

How to encrypt a pdf file in Fedora 21 -

is possible password protect pdf file in fedora 21? used pdftk purpose no longer available , surprisingly cannot find alternative. mcpdf here replace pdftk mcpdf drop-in replacement pdftk. it fixes pdftk’s unicode issues when filling in pdf forms, , command line interface itext pdf library pdftk compatible syntax. from readme on github

sql - Submit Date After 7 -

i have table in there 2 columns date status create table status ( date nvarchar(20), status bit ) now want select records status = false , date after 7 days of submit, if today have insert 2 records false status want query show record after 7 day on 8-04-2015 records of 1-04-2015 status false should show. if understand question; please tell do. as @gvee stated in comment above, should store dates either date or datetime field. allow query so: select [date], [status] <yourtable> [date] <= dateadd(d, -7, getdate()) , [status] = 0 this give results false status 7 days or older. alternatively, where clause this: where datediff(d, [date], getdate()) >= 7 , [status] = 0 if absolutely must keep column nvarchar data type, date format provided, can convert datetime so: convert(datetime, [date], 105) so where clause this: where datediff(d, convert(datetime, [date], 105), getdate()) >= 7 , [status] = 0

video - Matlab thinks an AVI it's written is corrupt -

i'm using matlab interface scientific camera using mex, , matlab program uses videowriter() write file disc. camera rgb-capable, , if write file such, video fine. however, current application, need grayscale images, , i'm using rgb2gray() convert it. unfortunately, when analysis code tried read video file again, error: error using videoreader/init (line 450) unable read file. file appears corrupt. and attempting read video vlc confirms corrupt. difference in code between grayscale , colour versions line: frame = rgb2gray(frame); my whole writing section of code is: vid = videowriter('testvid.avi'); vid.framerate = framerate; vid.quality = 100; open(vid); = 1 : frames; %read frame data variable 'frame' frame = rgb2gray(frame); writevideo(vid,frame); end i've spent far long fighting this, ideas? you need close video object, using close(vid) after writing last frame.

c# - my windows phone app reminder not fire my page -

i use reminder class developing reminder app not launching page set in reminder instance code: uri uri = new uri("/custompage.xaml", urikind.relative); reminder reminder = new reminder("myreminder") { title = "remindertitle", content = "wakeup", begintime = datetime.now.addminutes(2), recurrencetype = recurrenceinterval.daily, expirationtime = datetime.today.adddays(30), navigationuri = uri }; scheduledactionservice.add(reminder); so after popup windows reminder page

asp.net mvc 4 - How can I use a Knockout viewmodel inside a server loop? -

i want use html helpers , knockout create seamless transition of data server client, , server again on postback. my viewmodel has few properties , array of items. need know how can iterate on array in asp.net razor while assigning knockout bindings individual elements in array. here's have far: @for (int = 0; < model.fields.count; i++) { <div name="customformfield" data-bind="with: fields[@i]"> <div class="form-group"> @html.labelfor(m => m.fields[i].sqldatatype) @html.listboxfor(m => m.fields[i].sqldatatype, new selectlist(selectdatatypeoptions), new { @class = "form-control", data_bind = "value: sqldatatype" }) </div> </div> } my ko javascript: <script> function viewmodel() { this.addfield = function() { alert("wut"); } } $(function (){ var jsonmodel = @html.raw(json.

c# - Width of control based on width of window -

i'm trying figure out, how write responsive ui in xaml. i have 2 controls on window. minwidth of each control id 400. if width of windows >800, width of each control should 50%, if change widht of window <800, each control should have 100% of window. it's pretty simple set html/css, , right i'm trying in wpf without progress. can me that? i tried handle wrappanel, not work. wraps properly, not change width of control. i have 2 ideas doing this: using binding converter, , bind width/height of each item container width/height. creating custom panel, de desired layout. only few ideas, hope helps.

c# - Visual Studio's enumeration during debugging (Results View): "Entry point was not found.":"" -

Image
in cases, when trying expand results view of ienumerable in visual studio might cause error: entry point not found.":" . so decided test little, , found out happens when class has generic parameter (which call t ) , implements ienumerable[bar[t]] (something doesn't directly uses t ) or doesn't uses t @ all, ienumerable[string] (these may not cases). here's example class visual studio cannot expand results view properly: class foo<t> : ienumerable<list<t>> { readonly list<list<t>> l; public foo() { l = new list<list<t>>(); } public void add(list<t> l) { this.l.add(l); } public ienumerator<list<t>> getenumerator() { return l.getenumerator(); } ienumerator ienumerable.getenumerator() { return getenumerator(); } } and here's example class visual studio enumerates: class foo<t> : ienumerable<t> { rea

javascript - Angular $scope not working inside modal window -

i'm following this guide implement authentication angular app , i'm having trouble accessing models inside controller. somewhere in app, open modal window this: loginmodal().then(function() { // successful login, proceed page user wants return $state.go(tostate.name, toparams); }).catch(function() { // login failed, return home return $state.go('home'); }); loginmodal() service, looks this: myapp.service('loginmodal', function($modal, $localstorage) { function assigncurrentuser(user) { $localstorage.user = user; return user; } return function() { var instance = $modal.open({ templateurl: '/partials/modals/login.html', controller: 'logincontroller', windowclass: 'small' }); return instance.result.then(assigncurrentuser); }; }); when loginmodal() service used, opens modal window on page contains html of /partials/mo

playframework - Scala compiler not recognizing implicit session in DBAction -

we told guys @ slick-play-plugin everytime declaring dbaction in our play! endpoints, have our disposition current session, since implicit request contains field named dbsession . here's example of wrote: def insert = dbaction { implicit rs => detailsform.bindfromrequest.fold( formwitherrors => { badrequest(views.html.employee.details(none, formwitherrors)) }, details => { employees.insertwithdetails(details) home.flashing("success" -> messages("success.insert", details.name)) } ) } this not compiling due following error: application.scala:30: not find implicit value parameter s: slick.driver.mysqldriver.simple.session being line 30: employees.insertwithdetails(details) function insertwithdetails defined in tablequery[employee] object following definition: def insertwithdetails(details: details)(implicit s: session) = insert(employee(details.id, details.name, db.positions.find