Posts

Showing posts from April, 2010

angularjs - Getting data from a web service with Angular.js -

im trying data in json format remote ws using angular , im having trouble. data comes web service correctly cant use inside controller. why that? angular code: var booksjson; var app = angular.module('booksinventoryapp',[]); // data ws app.run(function ($http) { $http.get("https://some_api_path").success(function (data) { booksjson = data; console.log(data); //working }); }); app.controller('booksctrl', function ($scope) { $scope.data = booksjson; console.log($scope.data); //not working }); html: <section ng-controller="booksctrl"> <h2 ng-repeat="book in data">{{book.name}}</h2> </section> you should put $http.get inside controller. also, web service returns object not array. ng-repeat should this: book in data.books here working example: var app = angular.module('booksinventoryapp', []); app.controller('booksctrl', function($scope, $

Missing JS files in WorkExecution app of Maximo Anywhere 7.5.2.1 4Q release -

i have updated maximoanywhere 7.5.2.1 latest release 4q ism library. after building apps , deployed workexecution app, see blank screen. console log complains 2 missing js files 1.copyplanstoactualshandler.js 2.crewutil.js make framework happy, copied on copyplanstoactualhandler.js issuesandreturns app, , created dummy crewutil.js file. after this, presented login screen , able workexecution app. http://10.1.152.114:10080/maximoanywhere/apps/services/preview/workexecution/common/1.0/default/js/application/handlers/copyplanstoactualshandler.js failed load resource: server responded status of 404 (not found) dojo.js:2 error: scripterror(…)(anonymous function) @ dojo.js:2 http://10.1.152.114:10080/maximoanywhere/apps/services/preview/workexecution/common/1.0/default/js/application/business/util/crewutil.js failed load resource: server responded status of 404 (not found) dojo.js:2 error: scripterror(…) these files should exist

javascript - How to pass 'this' into a Promise without caching outside? -

i have variable called langdataservice.isdataready promise wawiting resolved. upon resolve logic happen. how can pass promise? langdataservice.isdataready.then(function () { this.modalon() }); i know can cache var self_ = this; i'm curious of other alternatives? langdataservice.isdataready.then(function () { this.modalon() }.bind(this));

c++ - How to create a dll for one class that reference other dlls in c# asp.net? -

i have following class trying make dll from using system; using system.collections.generic; using system.linq; using system.web; using nrules.fluent.dsl; using nrule.site.model; using nrule.site.utilities; namespace nrule.site.rules { public class allowatleastonecountryrule : rule { public override void define() { fundprofile productprofile = null; string str = ruletexts.allowatleastonecountryrule; bool enabled = allrules.getdict()[str]; when() .match<fundprofile>(() => productprofile) .exists<fundprofile>( p => enabled, p => ruleviolation(p)); then() .do(_ => productprofile.displayerror(str)); } bool ruleviolation(fundprofile pp) { if (pp.countrieslistp.count==0) return true; if (pp.countrieslistp.any(c => c.allowed)) return false;

Logging SOAP message on http gateway spring integration -

i using spring integration (4.0.6) make soap calls rest service using int-http:outbound-gateway , int-ws:outbound-gateway. there way log soap request message in case of exception. <int:gateway id="mygateway" service-interface="myservice"> <int:method name="getdata" request-channel="reqchannel" reply-channel="repchannel"> </int-gateway> my outbound-gateway configured below <int-http:outbound-gateway id="og1" request-channel="reqchannel" url="xxx" http-method="post" reply-channel="repchannel" reply-timeout="10000" message-converters="converter" request-factory="reqfactory"> <bean id="reqfactory" class="org.springframework.http.client.simpleclienthttprequestfactory"> <property name="ctimeout" value="20000"/> <property name="rtimeout" value=&qu

java - Error:Gradle: Execution failed for task ':core:compileJava'. > Compilation failed -

Image
i make simple game educational purposes got weird gradle error when i'm trying launch game. my source code: build errors i of course googled error because lack of experience didn't found solved problem. in advance naomi, i think problem package name com.mlgfappy.420 , numbers possible causing problem. create new project without numbers in package , try same code.

c# - Simulating real key strokes on an inactive webrowser control -

i have c# winforms app webbrowser control embedded website automation. need send programatically keyboard strokes within app embedded webbrowser control even when app hidden or not focused . setting text html text boxes works not (i.e. html form angularjs validation ignores it's not real typing suppose). i've spent 2 weeks searching , trying different approches: sendinput or sendkeys: works fine when app foregrounded (not good). raising onkeydown , onkeypress events: not working me @ form level , @ webbrowser control level. raising keydown,keypress, keyup events jquery in dom: no success. is there @ solution this? thanks after lot of trial , error found solution. angularjs form validation mechanism waits "change" event happen (and not keydown,keyup,keypress). trigger event wasn't easy (jquery.trigger didn't job). injected following function in webbrowser control , invoked it. setinputtext = function (id, str, x) { var el = $

ios - Errors thrown from here are not handled....bug -

Image
could please explain why i'm getting error based on other code located? why compile fine: func serializejsondata(jsondata: nsdata) -> nsdictionary { { let searchresultsjson: nsdictionary = try nsjsonserialization.jsonobjectwithdata(jsondata, options: .mutablecontainers) as! nsdictionary return searchresultsjson } catch let error nserror { print("json error: \(error.localizeddescription)") let returndictionary = [:] return returndictionary } } func parseforms(formsarray: nsarray) -> nsarray { var retval = [searchformobject]() form in formsarray as! nsdictionary { } return retval } when when switch methods around this: func parseforms(formsarray: nsarray) -> nsarray { var retval = [searchformobject]() form in formsarray as! nsdictionary { } return retval } func serializejsondata(jsondata: nsdata) -> nsdictionary { { let searchresultsjson: nsdictionary = t

arrays - Nesting an undefined number of loops in java -

i have array in java, of changing length (around 3-5). want change value of each element each possible element of array (newvalues) combinations i'd loop in loop, in case number of loops defined length of array. i'm strangely confused. take example: arraylist<integer> originallist = new arraylist<integer>(); \\has varying length arraylist<integer> newvalues = new arraylist<integer>(); originallist.add(0); originallist.add(0); newvalues.add(1); newvalues.add(2); newvalues.add(3); the array is: 0 0 i want loop trough of these perform action them: 1 1 1 2 1 3 2 1 2 2 2 3 ... i know become exponentially large, since original array should not big should ok. try this. static void loop(list<integer> originallist, list<integer> newvalues, int index) { if (index >= originallist.size()) system.out.println(originallist); else { (int = 0; < newvalues.size(); ++i) { originallist.se

java - Scanner expects more input than is needed -

i'm having issue piece of code meant validate user input integer , between numbers 1-6. the issue when add validation scanner waits input 3 times before continues. functions if don't include validation code. ideas why happening? int level; boolean = false; double physact; system.out.print("on scale of 1 6, how active\ndo consider yourself?\n1 = lazy, 6 = pro athlete: "); system.out.flush(); while (!good){ if (!in.hasnextint()){ in.next(); system.out.print("sorry, must enter whole\nnumber between 1 , 6: "); } else if ((in.nextint() < 0) || (in.nextint() > 7)){ in.next(); system.out.print("sorry, must enter whole\nnumber between 1 , 6: "); } else { = true; } } level = in.nextint(); switch(level){ case 1: physact = 1.2; break; after switch goes on , used other operations. your loop should read input once , remember mentioned. otherwise each call in.nextint

IIS: 2 application pools, 1 w3p -

i read on other sites iis creates 1 w3wp.exe process each application pool. server has 5 app pools, , 2 of them have application. in task manager see 1 w3wp.exe. can explain why? here screenshot: run following command @ command prompt , more info, %windir%\system32\inetsrv\appcmd.exe list wp then see worker processes belong application pools.

Want to use VBScript to run .bat file in a different folder -

i'm trying run .bat file using vbscript. can vbscript work when executed within same folder .bat, however, can't figure out how make run when outside folder. dim shell set shell = createobject("wscript.shell") shell.run "c:\users\js\desktop\createindex\createindex.bat" going out on limb suspect batch script requires own parent folder working directory. can set working directory accordingly changing code this: set shell = createobject("wscript.shell") shell.currentdirectory = "c:\users\js\desktop\createindex" shell.run "createindex.bat" if above doesn't need provide more information should happen , does happen. running external command/script in visible mode , without automatically closing cmd helps debugging: shell.currentdirectory = "c:\users\js\desktop\createindex" shell.run "cmd /k createindex.bat", 1, true

c++ - Including libraries in G++ using -l confusion -

i'm trying use external library i'm confused how fits together. i have following code i'm trying compiled: #include "cryptopp/sha.h" int main() { cryptopp::sha1 sha1; return 0; } i'm using g++ compiling, , research i've gathered need append -lcryptopp to end of compile command so: g++ crypto.cpp -o crypto.exe -lcryptopp but following error: /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lcryptopp this confused, i'm not sure -lcryptopp looking for, looking sha.cpp/sha.h files i'm including in code? more importantly how specify whatever it's looking want in cryptopp folder in same folder main .cpp? -lcryptopp tells linker link exe against dynamic library (shared object) file libcryptopp.so . gnu linker searches shared object files in various directories /lib , /usr/lib , others. you can specify additional directories search library files -l option, -l/usr/local/li

How to write a "List<int[,]>" in C++? -

i'm attempting make c++ equivalent code of following c# code, because i'm following tutorial in c#, , i'm more comfortable using c++. thought process maybe making outer array, allocating new array each index represents matrix size. okay or there better way go implementing in c++? // current c# code list<int[,]> pieces; pieces = new list<int[,]>(); /* piece */ pieces.add(new int[4, 4] { {0, 0, 0, 0}, {1, 1, 1, 1}, {0, 0, 0, 0}, {0, 0, 0, 0} }); /* j piece */ pieces.add(new int[3, 3] { {0, 0, 1}, {1, 1, 1}, {0, 0, 0} }); /* o piece */ pieces.add(new int[2, 2] { {1, 1}, {1, 1} }); /* s piece */ pieces.add(new int[3, 3] { {0, 1, 1}, {1, 1, 0}, {0, 0, 0} }); /* t piece */ pieces.add(new int[3, 3] { {0, 1, 0}, {1, 1, 1}, {0, 0, 0} }); /* z piece */ pieces.add(new int[3, 3] { {1, 1, 0}, {0, 1, 1}, {0, 0, 0} }); my initial code making matrix in array. since i'm not looking change

java - How to lock a code block based on a certain condition? -

edit: i've added table example (see google sheets link) , how resulting apple object should like. i've programmed multi-threaded web scraper using jsoup, extracts information website , saves map. main thing can't work program not connect website if scraped information. information program it extracts information table on website , starts thread every word in table. so threads started word class member. every thread has same concurrenthashmap object. plan check if word exists in map key. if not, should connect website information word, add data , put in map afterwards. if map contains word, thread should value map , add data it. so main goal not connect website twice same word. here relevant code snippets: main class starting thread every word in table. "element" contains word , url more information word. for (element element : allrelevanttableelements) { executorservice.execute(new worker(element, data, concurrentmap)); } worker class

architecture - x86 and x64 share instruction set? -

i don't know how 32bit application can run on 64bit os. my understanding 32bit/64bit refers register size. instruction set should different have different sizes of register. but know there x86-64 instruction set 64bit version of x86 instruction set. is reason can run 32bit application on 64bit os because of x86-64? if so, why 32bit applications not compatible in 64bit windows? why need wow64? (sometimes asked choose version install.) does x64 instruction set have other instruction set except x86-64? people told me x64 extend memory range , instruction set have identical. correct? is reason can run 32bit application on 64bit os because of x86-64? yes part. let me briefly explain 32bit/64bit not refer register size because question register (type) talking about? more accurately, 32bit/64bit refer width of address bus (ie how memory can addressed) or in other words size of pointer in c. then, in turn 32/64bit (indirectly) refer word size aka size of basi

python - re.split on multiple characters (and maintaining the characters) produces a list containing also empty strings -

i need split mathematical expression based on delimiters. delimiters ( , ) , + , - , * , / , ^ , space. came following regular expression "([\\s\\(\\)\\-\\+\\*/\\^])" which keeps delimiters in resulting list (which want), produces empty strings "" elements, don't want. hardly ever use regular expression (unfortunately), not sure if possible avoid this. here's example of problem: >>> import re >>> e = "((12*x^3+4 * 3)*3)" >>> re.split("([\\s\\(\\)\\-\\+\\*/\\^])", e) ['', '(', '', '(', '12', '*', 'x', '^', '3', '+', '4', ' ', '', ' ', '', ' ', '', '*', '', ' ', '3', ')', '', '*', '3', ')', ''] is there way not produce empty strings, maybe modifying regular expression? of course can

Android Second activity does not load -

sorry english. i'm trying use second activity in android, doesn't load. it's code jump it. below, can see code. thanks. 1- first activity public class mainactivity extends activity { button button; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); addlisteneronbutton(); public void addlisteneronbutton() { final context context = this; button = (button) findviewbyid(r.id.btenviardados); button.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { system.out.println("helooo"); intent intent = new intent(mainactivity.this, com.example.seven.reader.activity_janela1.class); startactivity(intent); system.out.println("ebadasdadas"); } }); } 2- second activity public class activity_janela1 extends activity { public void

image - Plone Error "Value error: unable to find update_version_before_edit" -

i trying (very hard) plone version 4.2.4 work correctly. had previous installation removed. attempted reinstall @ later point. seemed fine until couldn't upload pictures , had pulled in data previous install (folders , such). i've tried purge 5 times , fresh install either pulls in data (folders in particular) previous installation or breaks somehow not allowing me upload files etc. does have suggestions on how combat this? i'm ready ditch plone. error message: traceback (innermost last): module zpublisher.publish, line 126, in publish module zpublisher.mapply, line 77, in mapply module zpublisher.publish, line 46, in call_object module products.cmfplone.factorytool, line 453, in __call__ module zpublisher.mapply, line 77, in mapply module zpublisher.publish, line 46, in call_object module products.cmfformcontroller.fscontrollerpagetemplate, line 91, in __call__ module products.cmfformcontroller.basecontrollerpagetemplate, line 28, in _call

ruby on rails - ERROR: 'rake/rdoctask' is obsolete and no longer supported -

out of blue, started getting following error message: (in /users/me/.rvm/gems/ruby-1.9.3-p125@mysql2/gems/rails-0.9.5) rake aborted! error: 'rake/rdoctask' obsolete , no longer supported. use 'rdoc/task' (available in rdoc 2.4.2+) instead. /users/me/.rvm/gems/ruby-1.9.3-p125@mysql2/gems/rails-0.9.5/rakefile:3:in `<top (required)>' when rails s (in development environment terminal - mac mountain lion). application in production, went production environment, did bundle show, , modified gemfile, harcode gems versions. here's have on my local development environment (what's producing error message). actionmailer (3.2.3) actionpack (3.2.3) activemodel (3.2.3) activerecord (3.2.3) activeresource (3.2.3) activesupport (3.2.3) annotate (2.4.1.beta1) arel (3.0.2) bcrypt-ruby (3.0.1) bootstrap-datepicker-rails (0.6.15) bootstrap-sass (2.0.2) builder (3.0.4) bundler (1.1.3) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.6.1) common

sql server - how to call function inside a trigger? -

what problem @temp variable? create function dbo.getnumofreviews2 (@email varchar(40)) returns int begin declare @numofreviews int select @numofreviews = count(*) dbo.reviews email = @email group email return @numofreviews end create trigger setdiscount on dbo.[contains] insert declare @orderid int declare @productid int declare @size varchar(15) declare @temp int if cursor_status('global','c_cursor')>=-1 begin deallocate c_cursor end declare c_cursor cursor select productid,orderid,size inserted begin open c_cursor fetch next c_cursor @productid,@orderid,@size while (@@fetch_status=0) begin @temp = dbo.getnumofreviews2(select billingemail dbo.orders orderid=@orderid) if (select count(*) dbo.[contains] orderid = @orderid) > 5 or (select sum(quantity) dbo.[contains] orderid

tvos - How to detect if Siri button is clicked from Apple TV Siri Remote -

i clicking on siri button of apple tv siri remote. now, want siri perform action saying on click of siri button of remote within app. there way it? no. unfortunately, there no way detect if siri button has been clicked. clicking siri button send app in background giving siri process focus. i recommend filling feature request using bug report system

eclipse - Error When Deploying Java Appp to App Engine? Can not get the System Java Compiler. Please use a JDK, not JRE? -

Image
i got issue when deploying java app app engine unable update app: cannot system java compiler. please use jdk, not jre. see deployment console more details unable update app: cannot system java compiler. please use jdk, not jre. that absurd because set jdk1.7 in installed jres following picture: in log file. debugging information may found in c:\users\appdata\local\temp\appengine-deploy3218365179732638698.log unable update: java.lang.runtimeexception: cannot system java compiler. please use jdk, not jre. @ com.google.appengine.tools.admin.application.compilejavafiles(application.java:904) @ com.google.appengine.tools.admin.application.compilejsps(application.java:892) @ com.google.appengine.tools.admin.application.populatestagingdirectory(application.java:687) @ com.google.appengine.tools.admin.application.createstagingdirectory(application.java:629) @ com.google.appengine.tools.admin.appadminimpl.doupdate(appadminimpl.java:569)

php - Code never executed, not getting any errors -

i trying use ajax , html5 handle file uploads clients computer folder on server. right alert message below in addition success function never executed , not sure why. not getting js errors. both php script , folder save file granted full read/write permissions. it extremely difficult me work without seeing errors. i appreciate assistance in identifying cause of problem, , getting errors or @ least alert message execute. many in advance! jquery $.ajax({ url: 'upload.php', //server script process data type: 'post', xhr: function() { // custom xhr myxhr = $.ajaxsettings.xhr(); if(myxhr.upload){ // check if upload property exists myxhr.upload.addeventlistener('progress',progresshandlingfunction, false); // handling progress of upload } return myxhr; }, //ajax events success: function(data){ alert("ok");

Optimize jpeg images using assetic from css file instead of image tag -

the article below i'm trying do, instead of working on <img> tags want work references made in css well, background-image:url('someimage.jpg'); make optimizing hundreds of images have on website far faster manually doing , more convenient. for example documentation how using twig templating engine. {% image '@appbundle/resources/public/images/example.jpg' filter='jpegoptim' output='/images/example.jpg' %} <img src="{{ asset_url }}" alt="example"/> {% endimage %} is possible assetic , jpegoptim (or through other solution) http://symfony.com/doc/current/cookbook/assetic/jpeg_optimize.html your best bet, honestly, write script jpegoptim existing files. it's possible want creating new assetic filter, if want save jpegs different location (what using image tag filter now), little detail looks it'd quite hard. if used filter find , rewrite images in-place, have big clunky version of

android - Possible to alternate row colors in textview? -

what have done created 1 button 3 textview(tablelayout) , making looks record display. however, encountered problem want alternate row colors , found out can listview. there way can without listview current code? sortname(button) date(textview) name(textview) url(textview) 12/01/2015 google www.google.com 02/11/2015 yahoo www.yahoo.com activity_record.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="#b7010101"> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightsum="3" android:id="@+id/linearlayout"> <button android:id="@+id/sortname" android:layout_width=&qu

Failed to convert string to Tag in C# (ix developer) -

ix developer software uses c# scripting , trying pass tag name string in order fetch value on button click event. while compiling gets compiled 0 error when click on button @ runtime throws object reference not set instance of object please me , doing wrong. this code , log file please , link referring namespace neo.applicationframework.generated { using system.windows.forms; using system; using system.drawing; using neo.applicationframework.tools; using neo.applicationframework.common.graphics.logic; using neo.applicationframework.controls; using neo.applicationframework.interfaces; using neo.applicationframework.tools.opcclient; using system.reflection; public partial class screen1 { void button1_click(system.object sender, system.eventargs e) { getglobaldataitem("value1").value = 20; } private globaldataitem getglobaldataite

asp.net mvc - Authentication & Authorization Role issue -

Image
i'm having controller name usercontroller in admin area (section). in can assign them roles admin (a) user (u) or user (u) admin (a). when change role of user updated in database ,but when login application user of had changed role user contains old role.i have put break point variable 'role' returning previous role. i'm surprised how can 'role' variable return old role. public override string[] getrolesforuser(string username) { string[] role = { obj.getall().where(x => x.emailaddress == username).firstordefault().role }; return role; } user controller assignrole action in code i'm updating role public actionresult assignrole(int id, string role) { try { bol.tbl_login user = (bol.tbl_login)obj.login.getbyid(id); if (role == "a") { user.role = "u"; } else if (role == "u") { user.role = &quo

Script inside Ajax PHP File -

i coding program fetching divs using script name "awesome-grid.js", facing issue while getting data through ajax. script not working , divs coming in wrong layouts. function getload() { $.ajax({ data:'&task=results', type:'post', url:'ajax/ajaxloaddata.php', success: function(result) { document.getelementbyid('results').innerhtml = result; } }); } above script using ajax.

web services - How to store data in online and access using android app -

this first app doing create.i want create quiz app store questions online , when user uses app, questions fetched server. i dont want storage data offline. i want know how store data on server. if can done free of cost plz specify also. thnx in advance. use parse.com storage. when app used retrieve questions backend , display on screen. can learn more parse here tutorial start here i providing part of code retrieve server , display in listview. parsequery<parseobject> query = parsequery.getquery("post"); query.findinbackground(new findcallback<parseobject>() { @override public void done(list<parseobject> postlist, parseexception e) { if (e == null) { // if there questions, display (parseobject post : postlist) { question q= new question(post.getobjectid(), post.getstring("question")); posts.add(q); } ((arrayadapter<question&

pointers arithmetics not working in c++ -

i had worked pointer arithmetics in c but, started learn new , delete in c++ & not understand why runtime errors when incrementing pointer in c++ following error when use p++ or ++p... free(): invalid pointer: 0x0000000002324c24 ***0x2324c240x2324c28aborted (core dumped) #include<iostream> using namespace std; int main() { int *p; p=new int[4]; *p=34; *(p+1)=36; cout<<++p;//doesnot work(i wanted print address) cout<<p+1;//works delete[] p; return 0; } you need delete[] original pointer, 1 got result of new[] . , loose original pointer because ++p . that leads undefined behavior when delete[] p .

matlab - Sum of a cell array along the column -

i have cell array <1x74 cell> , each element of cell matrix of 4 x 4. how sum have final matrix of 4 x 4. did in following manner: total = in{1,1}+in{1,2}+in{1,3}+in{1,4}+in{1,5}+in{1,6}+in{1,7}+in{1,8}+in{1,9}+in{1,10}+.....in{1,74}; total = zeros(2,2); i=1:size(in,2) total = total+in{1,i}; end display('this result: ') total as mentioned in comments, if don't want define total in prior, this for i=1:size(in,2) if i~=1 total = total + in{1,i}; % executes numbers equal or larger 2 else total = in{1,i}; %executes on i=1 end end

duplicates - How to do de-duplication on records from AWS Kinesis Firehose to Redshift? -

i read document of official aws kinesis firehose doesn't mention how handle duplicated events. have experience on it? googled use elasticcache filtering, mean need use aws lambda encapsulate such filtering logic? there simple way firehose ingest data redshift , @ same time has "exactly once" semantics? lot! you can have duplication on both sides of kinesis stream. might put same events twice stream, , might read event twice consumers. the producers side can happen if try put event kinesis stream, reason not sure if written or not, , decide put again. consumer side can happen if getting batch of events , start processing them, , crash before managed checkpoint location, , next worker picking same batch of events kinesis stream, based on last checkpoint sequence-id. before start solving problem, should evaluate how have such duplication , business impact of such duplications. not every system handling financial transactions can't tolerate duplication. n

php - Not able to store data in table -

this question has answer here: can mix mysql apis in php? 5 answers not able insert data in table using mysql database $conn = new mysqli("localhost","username","password", "dbname"); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $stmt = $conn->prepare("insert mail_sent(mid, miid,status) values (:mid, :miid,:status)"); $stmt->bind_param('dds',$mail_id, $inv_id, $mailstatus);//line 37 $stmt->bindparam(':mid', $mail_id); $stmt->bindparam(':miid', $inv_id); $stmt->bindparam(':status', $mailstatus); $stmt->execute(); fatal error: call member function bind_param() on non-object in c:\wamp\www\mail\toinvite.php on line 37 your problem confusing pdo mysqli. pdo have syntax :mid , mys

c# - Get the href innertext with HtmlAgilityPack -

i trying create news agent news websites.so have use html parser htmlagilitypack .so here ca see code : public async void parsing(string website) { httpclient http = new httpclient(); var response = await http.getbytearrayasync(website); string source = encoding.getencoding("utf-8").getstring(response, 0, response.length - 1); source = webutility.htmldecode(source); htmldocument resultat = new htmldocument(); resultat.loadhtml(source); list<htmlnode> toftitle = resultat.documentnode.descendants().where (x => (x.name == "div" && x.attributes["class"] != null && x.attributes["class"].value.contains("latest-news"))).tolist(); var li = toftitle[0].descendants("li").tolist(); foreach (var item in li) { var link = item.descendants("a").tolist()[0].getattributevalue("href", null); var img = item.descendants("img&quo

android - Use RecyclerView inside ScrollView with fixed Recycler item height -

i implementing recyclerview inside scrollview <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:focusableintouchmode="true" android:orientation="vertical"> <android.support.v7.widget.recyclerview android:id="@+id/rv1" android:layout_width="match_parent" android:layout_height="wrap_content" android:divider="@android:color/transparent" android:dividerheight="0dp" android:listselector="@android:color/transparent" /> </linearlayout> set recyclerview fixed height this mrecyclerview_other.sethasfixedsize(true); recyclerview.layoutmanager layoutmanager_other = new linearlayoutmanager(context); mrecyclerview_other.setlayoutmanager(layoutmanager_other

dbpedia - Difference in count result of a SPARQL query -

i have query: prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix dbpedia-owl: <http://dbpedia.org/ontology/> select ?nom ?resource ?url (count( distinct (?o) ?nb)) { ?resource rdfs:label ?nom. ?resource foaf:isprimarytopicof ?url. ?resource rdf:type ?p. ?resource dbpedia-owl:wikipageexternallink ?o filter ( langmatches( lang(?nom), "en" )). ?nom <bif:contains> "apple". minus { ?resource dbo:wikipageredirects|dbo:wikipagedisambiguates ?dis } }group ?nom ?resource ?url now if replace line select ?nom ?resource ?url (count( distinct (?o) ?nb)) by: select ?nom ?resource ?url (count( (?o) ?nb)) it give me different results: example first example: | "simon apple"@en | <http://dbpedia.org/resource/simon_apple> | <http://en.wikipedia.org/wiki/s