Posts

Showing posts from February, 2014

javascript - How to run controller code after scope is compiled -

i have router runs controller when go url: #/create . have configured so: $routeprovider .when("/create", { templateurl: "templates/create", resolve: { form: function () { return { fields: [] }; } }, controller: "createcontroller" }) and inside controller load of components asynchroniously inside services , assign respective scope property. .controller(function ($scope, service /* other components */) { // code console.log($scope); // gives $rootscope service.get().load([["forms"]], $scope); // reaso passing scope service assign loaded data }) sometimes when refresh page have request modules, not have them assigned scope. after lots of debugging have found out problem. running trouble when template not compiled , instead of $scope getting $rootscope , modules assigned other/incorrect scope. question here is, how can run controller code after s

Refresh QueryTable throwing "General ODBC error" - VBA Excel 2011 for Mac -

edit: new mistake found? i may have found out why script wouldn't work anymore. there has been office update , seems have implemented microsoft query gets rid of odbc-manager installed , configured needs. actual problem may microsoft query doesn't have unicode-library , don't know put them microsoft query read/get them. or rather don't know how give microsoft query path unicode-library in manager there no possibility change it, or maybe there , didn't find it? in addition cannot open microsoft query manager unless open directly excel workbook. original question this code worked time. exact same code runtime error. here asked in case , got work. here's code: sub connectsql() dim connstring string dim slogin string dim qt querytable slogon = "uid=*;pwd=*;" sqlstringfirma = "select * gi_kunden.tbl_firma" sqlstringperson = "select * gi_kunden.tbl_person" connstring = "odbc;dsn=kundedb;&

web services - tWebService component - NullPointerException - createPropertyMapper -

i've problem twebservice talend component, impossible me find solution my job i have many ws call in job. can call , response 1 simple ws (2 string param, , 2 string response) but, other ws, more complex (string , object param, , string , object response), twebservice failed. looks ws not call, problem seems talend. mapperfactory failed createpropertymapper. aim moment call ws static parameters , log response tlogrow component stacktrace exception in component twebservice_9 java.lang.nullpointerexception @ org.talend.webservice.mapper.mapperfactory.createpropertymapper(mapperfactory.java:406) @ org.talend.webservice.mapper.mapperfactory.createcomplextypemapper(mapperfactory.java:339) @ org.talend.webservice.mapper.mapperfactory.createtypemapper(mapperfactory.java:220) @ org.talend.webservice.mapper.mapperfactory.createpropertymapper(mapperfactory.java:423) @ org.talend.webservice.mapper.mapperfactory.createcomplextypemapper(mapperfactory.java:339)

php - Laravel relationships on a table with two types of flags -

i have 2 tables products , users both of objects has images associated in table images the schema images table id | image_id | resource_id | flag 1 | 567575 | 1 | user 2 | 423423 | 1 | product based on flag identifying whether users image or whether products image. if need eager load users image how do it? user model <?php namespace app\entities; use illuminate\database\eloquent\model; class user extends model implements transformable { use transformabletrait; protected $table = 'users'; protected $primarykey = 'users_id'; public function images() { return $this->hasmany('app\entities\image','resource_id'); } } product model <?php namespace app\entities; use illuminate\database\eloquent\model; class product extends model implements transformable { use transformabletrait; protected $table = 'products'; protected $primarykey = 'products_id';

changing spinners value based on other spinners from mysql database (Android) -

can point me tutorials or guides on this. how update value of 1 spinner based on selection of previous spinner. data values coming mysql database. have searched around have not found satisfactory answer. pls help. spinner = (spinner) findviewbyid(r.id.spinner); spinner.setonitemselectedlistener(spinnerlistener); spinner2 = (spinner) findviewbyid(r.id.spinnersportcentername); spinner2.setonitemselectedlistener(spinnerlistener); from above have 2 spinners. right im getting data database. , code below. getting data. need update value of second spinner based on item selected in first spinner. how do that? pretty clueless right now. private void getdata(){ //creating string request stringrequest stringrequest = new stringrequest(facilityconfig.data_url, new response.listener<string>() { @override public void onresponse(string response) { jsonobject j = null; try {

swift - Read NFC (Mifare Classic 1K) with CryptoTokenKit -

Image
i'm trying read/write milfare classic 1k nfc card (supplied factory) using acr122. can detect card, cannot communicate it. i have been searching web days trying find kind of documentation on (without success). i know these cards encrypted surely there default password or way reset card? here's have far: card.beginsessionwithreply { (result, error) -> void in print("began card session: \(result) \(card.valid) \(card.currentprotocol)"); let aid : [uint8] = [0xff, 0x86, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x0, 0x00]; var data = nsdata(bytes: aid, length: aid.count) card.transmitrequest(data, reply: { (data, error) -> void in print("transmit: data: \(data) error \(error)"); }) data = "hi".datausingencoding(nsutf8stringencoding)!; card.sendins(0xff, p1: 0x00, p2: 0x00, data: data, le: nil, reply: { (data, uint, error) -> void in if let e = error

drag and drop in flash cc 2015 with createjs -

can know how simple drag , drop in flash canvas createjs ? this.circle.addeventlistener("pressmove", fl_mouseclickhandler_2.bind(this)); function fl_mouseclickhandler_2() { // start custom code // example code displays words "mouse clicked" in output panel. evt.target.x = evt.stagex; evt.target.y = evt.stagey; } thanks

c# - Make all TextBoxes UPPERCASE -

is there way can make textboxes in form uppercase. have been doing txtpersonname.charactercasing = charactercasing.upper; ....; you can textbox controls in controls collection of form , set charactercasing property charactercasing.upper foreach(var tb in this.controls.oftype<textbox>()) { tb.charactercasing = charactercasing.upper; }

spring - Changes in Oracle database are not visible for a certain query -

i have large query looks this: select stuff, case when (some subselect) > 0 'value 1' when (another subselect) > 0 'value 2' else 'value 3' end status (yet subselect) e it works great. then, spring, trough jparepositories make changes effect some subselect part, reason, these changes not immediate. in other queries changes visible, tried using several transnational mechanism in spring, tried not using transaction @ all, i'm using saveandflush on repositories, without luck. but delay happened if restarted tomcat server before changes visible. delay visible external db manipulation program, i'm guessing problem not application. can kind of oracle caches or transactions effect this? how can purge, flush, commit them? edit (for request in comments): in java make basic changes java code myentity myentity = myentitydao.findone(someid); myentity.setproperty(newvalue); myentitydao.saveandflush(myentity); where m

angularjs - how to get the min and max value from json in angular js -

i want maximum , minimum value json in angular js json: { "data":[ { "name": "ranjith", "age": 22 }, { "name": "rahul", "age": 20 }, { "name": "jinesh", "age": 25 }, { "name": "vishnu", "age": 24 } ] } and controller:- var app = angular.module('myapp', ['']); app.controller('myctrl', function($scope, data) { $scope.data = data.data; $scope.min=""; $scope.max=""; }; }); i want minimum , maximum value array , store in variables min , max you can use $scope.min = math.min.apply(math,$scope.data.map(function(item){return item.age;})); $scope.max = math.max.apply(math,$scope.data.map(function(item){return item.age;}));

java - Chain of webservices using camel -

i've got 2 webservices. 1 take input string, , return xml document. second take xml first , return xml document. i'm interested in second document. the catch can't modify in anyway how these webservices work, , input parameter has send inside url (it doesn't work inside body of request) so basically, want call web service input=body (that's work). want call second webservice input=body returned first one. here camel config: <route> <from uri="direct:language-identifier" /> <tod uri="http://opener.olery.com/language-identifier?input=${body}&amp;bridgeendpoint=true"/> </route> <route> <from uri="direct:tokenizer" /> <setheader headername="input"><simple>${in.body}</simple></setheader> <tod uri="http://opener.olery.com/tokenizer?bridgeendpoint=true"/> </route> <route> <from uri="servlet:opener-

c - Chaining of Relational operators is giving wrong output -

can explain me? did wrong? when run program doesn't show me right answer. ex : when type weight = 50 kg , height = 130 cm answer should "your bmi 29.58. overweight2.you have chance cause high blood pressure , diabetes need control diet. , fitness." but answer shows "your bmi 29.58. normal......" #include<stdio.h> #include<conio.h> int main() { float weight, height, bmi; printf("\nwelcome program"); printf("\nplease enter weight(kg) :"); scanf("%f", &weight); printf("\nplease enter height(cm) :"); scanf("%f", &height); bmi=weight/((height/100)*(height/100)); if(bmi<18.50) { printf("your bmi : %.2f",bmi); printf("you underweight.you should eat quality food , sufficient amount of energy , exercise proper."); } else if(18.5<=bmi<23) { printf("your bmi : %.2f \nyou normal.you should eat quality food , ex

Need advice for ASP.NET Grid[checkbox] -

i created web app. , now, i'm having problem it. used grid checkbox. have scenario when user select data save in database, tick checkbox in grid. now, problem when save data. takes 3-5mins save. there way optimize it? here's code each ogriditem in dgobj.items dim ocheck checkbox = ogriditem.findcontrol("chkselect1") if ocheck.checked = true try if apptype.text = 124 webctrl.strcommand = "exec spfilterunliquidation '" & apptype.text & "', '" & getgriditem("appid").text & "', '" & dgobj.datakeys(ogriditem.itemindex) & "', '" & getcompanyid & "' set dateformat mdy exec spupdateunliquidate '" & getgriditem("appid").text & "', '" & dgobj.datakeys(ogriditem.itemindex) & "', " & getgriditem("diffamnt").text &

c - Read return garbage data in serial port programming in linux -

i want communicate pc using rs232 port. can open "/dev/ttys0" , write data using write() function, can't read correct data "dev/ttys0" using read() . read() function read unnecessary data.please tell me how solve problem? my program code here : #include <stdio.h> #include <string.h> #include <fcntl.h> #include <termios.h> #include <unistd.h> int main() { int n = 0, fd = 0, bytes = 0; char buffer[10]; struct termios term; fd = open("/dev/ttys0", o_rdwr | o_noctty | o_ndelay); if (fd == -1) { perror("open"); return; } else { fcntl(fd, f_setfl, 0); perror("port"); } tcgetattr(fd, &term); cfsetispeed(&term, b115200); cfsetospeed(&term, b115200); term.c_cflag |= (clocal | cread); term.c_cflag &= ~parenb; term.c_cflag &= ~cstopb; term.c_cflag &= ~csize; term.c_cfla

python - pyspark on cluster, make sure all nodes are used -

deployment info: "pyspark --master yarn-client --num-executors 16 --driver-memory 16g --executor-memory 2g " i turning 100,000 line text file (in hdfs dfs format) rdd object corpus = sc.textfile("my_file_name") . when execute corpus.count() 100000 . realize these steps performed on master node. now, question when perform action new_corpus=corpus.map(some_function) , job automatically distributed pyspark among available slaves (16 in case)? or have specify something? notes: i don't think gets distributed (or @ least not on 16 nodes) because when new_corpus.count() , prints out [stage some_number:> (0+2)/2] , not [stage some_number:> (0+16)/16] i don't think doing corpus = sc.textfile("my_file_name",16) solution me because function want apply works @ line level , therefore should applied 100,000 times (the goal of parallelization speed process, having each slave taking 100000/16 lines). should not applied 16 times on

c# - Binding image StorageFile to XamlCropControl -

i working xamlcropcontrol library here . can't binding image storagefile crop-control. xamlcropcontrol, that: <xamlcrop:cropcontrol x:name="crop" imagesource="ms-appx:///assets/wrench.jpg" desiredaspectratio="1.0" /> but in case, need bind image picked gallery pass crop-control. bellow, did not work @ all. public async void imagereceiver(storagefile image) { bitmapimage bitmapimage = new bitmapimage(); filerandomaccessstream stream = (filerandomaccessstream)await image.openasync(fileaccessmode.read); bitmapimage.setsource(stream); imgparam = bitmapimage; } private bitmapimage imgparam; public writeablebitmap imgparam { { return imgparam; } set { imgparam = value; raisepropertychanged("imgparam"); } } and in xaml file: <xamlcrop:cropcontrol x:name="cropcontrol" imageso

symfony - OneToMany relationship with checkboxes as choices in a form using custom FormType -

i have model costtypeconnection has 1 many relation departmentconnection. i want, departmentconnection displayed checkboxes. my costtypeconnection class has variable $costtype , entity costtype , has $name varaible in it. my departmentconnection class has variable $department , entity department , has $name variable. my costtypeformtype: .... public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('costtype', 'text', array( 'label' => 'costtype' )) ->add('departmentconnections', 'collection', array( 'type' => new departmentconnectiontype(), 'allow_add' => false, 'label' => false, 'by_reference' => false, 'options' => array('label' => false), ))

sql - Add a field to multiple views, is possible? -

i have add column, field multiple views in sql server. example of view i'm using, tbxxx stay table , vwxxx view: alter view [dbo].[vwfornitori_search] select iditem, idana, codice, ragione_sociale, c.valore colore tbanagrafiche left join tbcolori c on tbanagrafiche.colore = c.idcolore iditem = 'for' , isnull(eliminato, 0) = 0 , isnull(obsoleto, 0) = 0 go i have add views field, column, principal table's primary key! modified view be: alter view [dbo].[vwfornitori_search] select iditem, idana, codice, ragione_sociale, c.valore colore, idana id tbanagrafiche left join tbcolori c on tbanagrafiche.colore = c.idcolore iditem = 'for' , isnull(eliminato, 0) = 0 , isnull(obsoleto, 0) = 0 go usually primary key has same name, idana . there's way single script list of views ? you follo

python - How to use pyinstaller with hidden imports for scipy.optimize leastsq -

my wxpython application compiled fine pyinstaller, until functionality, based on from scipy.optimize import leastsq statement added. how fix this? first time run command pyinstaller myscript.py in cmd, myscript.spec file created (or can create manually). file let specify hidden imports, , found (by long , tedious trial-error process) following hidden imports did trick: 'scipy.special._ufuncs_cxx' 'scipy.linalg.cython_blas' 'scipy.linalg.cython_lapack' 'scipy.integrate' 'scipy.integrate.quadrature' 'scipy.integrate.odepack' 'scipy.integrate._odepack' 'scipy.integrate.quadpack' 'scipy.integrate._quadpack' 'scipy.integrate._ode' 'scipy.integrate.vode' 'scipy.integrate._dop' 'scipy.integrate.lsoda' these should linked through hooks, not head around how, "quick&dirty" way. now execute pyinstaller myscript.spec . my full file looked along these lines

angularjs - unreachable code after return statement Angular Material Failing when linked in index.html -

hi guys im setting new project work im doing trying working keep momentum up. seem having problem getting angular material load properly. im using node , bower modules seems loading them fine. however when ever im loading page console reports hitting unreachable code after return statement title suggests. being hit in angular material js file being imported bower. i have no idea why happening , progress past point brilliant thank you. edit i possibly have found fix issue having. backend of web application using controlled django , there conflict between angular js , django in using same tags show values variables. stopping angular material instantiating properly. still unreachable code warning material working expect to. i hope helps people debug problems having when seeing issue. include minified version of library. automatic semicolon insertion different depending on browser, if library code has return statement broken across 2 lines, might end semicolon 1 shou

java - Zero returned getting url parameter in jsf -

i trying parameter passed url ..and returns 0. here managedbean...a simple bean 2 variables. import javax.faces.bean.applicationscoped; import javax.faces.bean.managedbean; import javax.faces.bean.managedproperty; import javax.faces.bean.requestscoped; @managedbean @requestscoped public class userbean { @managedproperty("#{param.id}") private int id; private string name; public int getid() { system.out.println(id); return id; } public void setid(int id) { system.out.println(id); this.id = id; } public string getname() { return name; } public void setname(string name) { this.name = name; } public userbean() { super(); } public string createurl() { return "yoga.xhtml?id=267"; } } here xhtml page par

osx elcapitan - Suddenly every git command causes `error: bad signature` in every Git repository -

i have weird problem. today, working in multiple git repositories, of sudden, started getting $ git st error: bad signature fatal: index file corrupt in every single repository. i tried jakub's reply in post how resolve "error: bad index – fatal: index file corrupt" when using git , didn't work. if fixed issue second, i'm doing changes repository (like git add somefile ) error comes back. i know broad , unspecific question... how can solve this? i'm running mac on el capitan (10.11.1) update: i wanted restart computer after incident , mac crashed @ startup massive kernel errors. booted once safemode analyse it, couldn't find anything. restarted mac, , kernel error gone, including git problem caused file corrupt error. index file of git repositories did work in still broken, timemachine restore them. so, think problem maybe related kernel problems, caused strange behaviour. now, working again. but still have eye on that, because pro

azure - Can't connect to Office 365 in Android -

first of all, sorry english. well, i'm trying log in microsoft account android, use github example provide microsoft ( https://github.com/officedev/o365-android-connect ). follow steps in end when try connect account server throws exception. error: server_error:2016-01-28 11:05:38-cc63876c-3c31-48aa-9847-513381e09296-ioexception:https://login.microsoftonline.com/common/oauth2/token ver:1.1.7 i can't find information problem. knows happening? thanks all. aitor. the ioexception caused number of situations. let's see if can come more information: were able see login page , provide credentials? what happens if open browser in device , go https://login.microsoftonline.com/common/oauth2/token can share of logs before , after error?

Thousands separator and decimal places formatting with TEXT in Excel -

Image
how can use text in excel format string , thousand separator , 2 decimal places i tried =("gbp "&text(a1,"###,#.##") gbp 1,234.5 without last 0 i tried =("gbp "&text(a1,"###,#.00") , when a1 = 0 , gbp .00 (my current workaround when a1 0 , return "" , i'd able without condition) desired: when a1 0 , want gbp 0.00 when 1,234.50 , want gbp 1,234.50 a number format used in either cell's number format or in text function can have 4 different styles; positive, negative, 0 , text. these separated semi-colons. can provide blank result of types supplying nothing section. =text(a3, "\g\p\d #,##0.00;;;")         

asp.net mvc 4 - Virtual List is not populating in EF6 -

virtual list not populating second row of data. here model of userprofile [table("userprofile")] public class usrprofile { [key] public int userid { get; set; } [required] public string username { get; set; } public int? introducerid { get; set; } [foreignkey("introducerid")] public virtual usrprofile introducer { get; set; } public virtual list<userinrole> userinroles { get; set; } public virtual list<usrprofile> members { get; set; } } and userinrole model [table("webpages_usersinroles")] public class userinrole { [key] public int roleid { get; set; } [foreignkey("roleid")] public virtual userrole userrole { get; set; } public int userid { get; set; } [foreignkey("userid")] public virtual usrprofile user { get; set; } } here query user public jsonresult g

javascript - Error using ui-router: "$injector:modulerr" -

i following angularjs tutorial: learn build modern web apps angular , rails thinkster , faced 1 problem. after making inline template have blank page , error $injector:modulerr following details: failed instantiate module flappernews due to: error: [$injector:modulerr] http://errors.angularjs.org/1.2.19/$injector/modulerr?p0=...) @ error (native) @ http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js:6:450 @ http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js:34:97 @ array.foreach (native) @ q (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js:7:280) @ e (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js:33:207) @ http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js:33:284 @ array.foreach (native) @ q (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js:7:280) @ e (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js:3

actionscript 3 - Cloning object (Drag and drop) Flash As3 -

Image
how make clone of movieclip after has been dragged, , make clone appear dragged movieclip before being dragged? this have far: movieclip_1.addeventlistener(mouseevent.mouse_down, fl_clicktodrag_2); function fl_clicktodrag_2(event:mouseevent):void { movieclip_1.startdrag(); } stage.addeventlistener(mouseevent.mouse_up, fl_releasetodrop_2); function fl_releasetodrop_2(event:mouseevent):void { movieclip_1.stopdrag(); } also know how make reset button, reset dragged , dropped objects on stage you can select symbol want make duplicate of in library panel , go symbol properties (by right clicking symbol , selecting properties ) , enable export actionscript as symbol example, i've created plus symbol , named symbol plus. once you've done that, can create new instance of symbol: addchild(new plus()); note plus same gave symbol in symbol properties, if name symbol movieclip_1 in library , it's exported actionscript code this: addchild(new moviecli

Error upon installing SQL Server 2008 Express -

i trying install sql server 2008 express error set.exe not valid win32 application i not have disc space on machine @ moment, 10,5 gig, perhaps problem? advice perhaps on cause , how fix it. regards looks corrupted download. instead of [run], choose [save] , run local hard drive. verify size of download before running executable. if doesn't work, try download again. make sure read system requirements on ms dl sqlexpr_x86_enu.exe : microsoft® sql server® 2008 express

Building and running app via Gradle and Android Studio 2.0 is slower -

Image
i have multi-project (2 modules) of building takes 1/2 min each time. when press run in android studio, have wait every time rebuild app, extremely slow. it's took 6/8 min each time. is possible automate building process in android studio? or have advice on how make process faster? here build.gradle file (app module): allprojects { repositories { mavencentral() maven { url "https://jitpack.io" } maven { url 'http://clinker.47deg.com/nexus/content/groups/public' } } } apply plugin: 'com.android.application' dependencies { compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:1.0.0' compile filetree(dir: 'libs', include: '*.jar') compile('com.fortysevendeg.swipelistview:swipelistview:1.0-snapshot@aar') { transitive = true } compile 'com.android.support:multidex:1.0.1' compile 'com.github.nirhart:parallaxscroll:1.0' compile &#

javascript - Changing CSS based on URL or if child of parent (Wordpress) -

this seems pretty straightforward cant seem find solution... i have border-bottom on header , want change colour of border depending on section user in. example parent pages below: home | parent 1 | parent 2 id if on 'parent 1' or child page of 'parent 1', change border-color to... else if on 'parent 2' or child page of 'parent 2' change this.. , on. thanks try this: function mycustom_style() { $pageid = wp_get_post_parent_id(get_the_id()); //get parent page id if(!empty($pageid)) { //can use switch case if($pageid=='16') //your page id { echo "<style>.myclass{ border-color: red}</style>"; } } } add_action( 'get_header', 'mycustom_style');

Adding a Task in outlook 2013 using Asp.net Web Application -

i have asp.net web app thru want access outlook 2013 , add/edit/delete outlook tasks. i have exchange server 2010. i not know how proceed solution. need use javascript api office or ews or what... pls suggest... for starters can't access outlook directly server/web application: https://support.microsoft.com/en-us/kb/257757 you cannot use javascript api office there no support task items. your option use exchange web services. here's starting point: https://msdn.microsoft.com/en-us/library/office/jj900166(v=exchg.150).aspx

c++ - Launch failed.Binary not found -

Image
i installed mingw , eclipse(c++), when want run helloworld program error. console shows me: thanks in advance you must add mingw bin directory (for example c:\mingw\bin) path environment variable. more information there how set path variable also you doesnt have liblto_plugin-0.dll in mingw's bin dir, can install plugin or disable in compiler flags just use: -fno-use-linker-plugin

ms office - How to get All Microsoftword files using C# -

i've opened 4,5 different files , want detail of each file. detail means file name, fullpath etc. objword = (microsoft.office.interop.word.application)system.runtime.interopservices.marshal.getactiveobject("word.application"); (int = 0; < objword.windows.count; i++) { label.content = objword.activedocument.fullname.tostring() + environment.newline; } using above lines i'm able detail of current active file detail. how can detail of other files not active. you're accessing same activedocument on each iteration of loop (and overwriting value every time). try changing line in for loop to: label.content += objword.windows(i).document.fullname.tostring() + environment.newline;

wix - From installed file ,how to find which msi would have installed the file? -

my manager gave me list of config files machine msi installed. and asked me find msi came . (because need write logic msi). how find msi files came ? opening in orca manually , search tough number of msi more. is there other alternative approach? using wix creating msi. i md5 hash of .config files query msifilehash table in .msis until found matching hash.

php - Convert imagemagick ColorDodge function to imagick -

Image
i'm trying understand how apply filter on 2 images using php imagemagick library : convert 1.jpg \( -size 2816x1584 tile:2.jpg \) -compose colordodge -composite out.jpg how can using imagemagick php extension without using exec / system? http://php.net/manual/en/book.imagick.php note command-line version little clumsy requires hard-code image size. think preferable clone original image (so clone same size) , fill clone pattern, rather explicitly stating size, creating canvas , filling it: convert 1.jpg \( +clone -fill pattern:checkerboard -draw "color 0,0 reset" \) -compose colordodge -composite result.png in php, can this, using 1.jpg and checkerboard 2.jpg #!/usr/local/bin/php -f <?php $img1 = new imagick("1.jpg"); $img2 = clone $img1; $texture = new imagick("2.jpg"); $img3 = $img2->textureimage($texture); $img1->compositeimage($img3, imagick::composite_colordodge, 0, 0); $img1->writ

sql - Select the customer who has the most different categories in his orders -

the question need answer following: find customer(or customers in case of tie),who has done order cointains different categories. these tables: products: create table products ( prod_id number not null , "category" number not null references categories, title varchar (40) not null, actor varchar (40) not null, price varchar (40) not null, primary key (prod_id)); orderlines: create table orderlines ( orderlineid number not null, orderid number not null references orders, prod_id number not null references products, quantity number not null, orderdate varchar2 (80) not null, primary key (orderlineid,orderid)); customers: create table customers ( customerid number not null, firstname varchar2 (20) not null, lastname varchar2 (20) not null, address1 varchar2 (40) not null, address2 varchar2 (40), city varchar2 (20) not null, state varchar2 (20) not null, zip varchar2 (20) not null, country varchar2 (20) not null, region varchar2 (20) not null, email varchar2 (20

postgresql - AWS Unload Error: 'The bucket you are attempting to access must be addressed using the specified endpoint.' -

i running following query in sql. trying unload data redshift bucket in personal s3 account: unload ('select * table upper(description) \'%something%\') 's3://mybucketname/sometextname.txt' credentials 'aws_access_key_id=xxx;aws_secret_access_key=xxx' parallel off when this, following error: the bucket attempting access must addressed using specified endpoint. please send future requests endpoint.,status 301,error permanentredirect,rid ae9f82cd626a5b05,extrid 1hl5hhhv9rkaq0vw7fb0kpm2wo1uomy4mmxq is s3 path correct? need change permissions s3 account or bucket? it looks redshift cluster , s3 bucket in different regions. , of now, redshift doesn't support unloading in different region. documentation : the amazon s3 bucket amazon redshift write output files must reside in same region cluster.

c# - Where to/ how to put the value in for a place holder, in a sSQL statement -

i have ssql statement want select values database, based on selected value of drop down list. here code. string ssql = ""; ssql = ("select * tbl_tripprefixdestination country {0}", ddlcountryselect.selecteditem.text); ssql += ""; ssql += ""; openconnection(conn); datatable dt = new datatable(); sqlcommand cmd = new sqlcommand(ssql, conn); to me seems right way this, yet still errors. can please me? ( dont mind at simplest level need: ssql = string.format("select * tbl_tripprefixdestination country '%{0}%'", ddlcountryselect.selecteditem.text); if you're doing wild card search or ssql = string.format("select * tbl_tripprefixdestination country = '{0}'", ddlcountryselect.selecteditem.text); for exact match. but should @ sqlparameter object: ssql = "select * tbl_tripprefixdestination country = @country"; ... sqlparameter

sql server - Is it possible to use XML dataset in SSRS report designer -

is possible use xml dataset in ssrs report designer ? need fetch large dataset like, master row - details1 - details2 - ... detailsn i created query returns me xml data using for xml raw not able use in query designer when adding new report. please note not using xml data source, trying add xml dataset using select query.. havn't tried stored procedure not sure if work well... in other words, possible add xml dataset (not datasource) ssrs reports if need xml looking treeview might this: declare @xml xml= '<root> <level content="level a"> <detail content="detail aa"> <item content="item aaa" /> </detail> <detail content="detail ab"> <item content="item aba" /> <item content="item abb" /> <item content="item abc" /> </detail> <detail content="detail ac"> &

c# - Remove Splash Screen on Windows Phone 8.1 -

is possible remove default splash screen on windows phone 8.1? app i'm develoving, don't need splash screen. thanks if open visual assets tab can change assets\splashscreen.png whatever want. i'm not sure if can removed though if not, suppose change screenshot of app if want fake behavior.

Exclude from brunch build devDependencies node_modules -

i'm using both bower , npm external libraries in app. bower.json contains application dependencies (backbone, lodash, etc...) package.json contains dev environment deps (babel, brunch, brunch plugins, etc...) here's part of brunch-config.coffee file: module.exports = config: files: javascripts: exclude: '/**/*.min.js' jointo: 'js/app.js': /^app/ 'js/vendor.js': /^(bower_components|vendor)/ and the, brunch build not embed node_modules (which dev dependencies only ). i remove bower , make happen npm. there way in brunch exclude brunch build node_modules mentioned in 'devdependencies' section of package.json? thanks lot, pierre (frontend beginner) brunch automatically detects packages using in application. no action required you. if there 10 brunch plugins , 2 babel addons, brunch won't use them unless write require('babel') in frontend cod

c++ - Android NDK application: AndroidManifest.xml not loaded -

written android ndk application, builds correctly , generates corresponding shared libraries. with command should produce apk package: android update project --name androidtest --path . --target 6 however noticed "androidmanifest.xml" not loaded (corrupting generates no error), , no apk package produced. this output get: updated project.properties updated local.properties updated file ~\androidtestproject\build.xml updated file ~\androidtestproject\proguard-project.txt how can apk package?

android - build.gradle dependencies auto updates itself -

compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' to compile 'com.google.android.gms:play-services:8.4.0' compile 'com.android.support:support-v4:23.1.0' compile 'com.android.support:design:23.1.0' time time, android studio automatically change values latest version extremely annoying , breaks application. there way prevent happening? did google search , stackoverflow searched nothing came up. instead of: compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:support-v4:22.2.1' compile 'com.android.support:design:22.2.1' try: playversion = '8.3.0' supportversion = 'support-v4:22.2.1' designversion = '22.2.1' compile "com.google.android.gms:play-services:$playversion" compile "com.android.support:$supportversion" compile "

xilinx ise - Cycle delay in Verilog -

Image
i have been struck @ point quite time , me out if can , solve it. there 4 inputs system - w, a,b,c. periodic inputs changing time. output o. stored signed 16 bit registers. when w less 16'b0000101100110011, output (o) directly equal 'a'. when w greater this, output changes 'b' happens during 0 crossing of c, i.e. when goes positive negative or vice-versa. if w greater above specified value c has not crossed 0 crossing, output 'o' continue 'a'. trying see value of msb of 'c'. changes value, trying change output 'a' 'b' not happening per given code: module trial(clk, w, a, b, c, o ); input clk; input signed [15:0] w; input signed [15:0] a; input signed [15:0] b; input signed [15:0] c; output signed [15:0] o; reg signed [15:0] temp; reg signed [15:0] temp1; reg signed [15:0] temp2; @(posedge clk) begin if (w<16'b0000101100110011) begin temp = a;