Posts

Showing posts from March, 2010

javascript - CSS not applying when url is "example.php/1/2" -

i doing site, blogplatform, info based on get. wanna show specific post if url "post.php/1/2" 1 user-id, , 2 post-id. when this, php-file doesnt find js nor css file. error: "resource interpreted stylesheet transferred mime type text/html:" , syntax error javascript, saying "unexpected <". works fine on other sites. i sorry describing bit bad, hope understand. otherwise i'll explain better! edit: gotta routing problem. if go on "post.php" works fine, "post.php/" troublesome. sounds using relative paths , 404 (or other html page) instead of desired css/js file. so try using absolute paths (begin path / , not ../) like: <link rel="stylesheet" type="text/css" href="/styles/main.css"> and not <link rel="stylesheet" type="text/css" href="../styles/main.css">

intershop - Intershop7: How to use NumberSequenceProvider correctly -

i working on latest , greatest intershop 7.8.0.3 , trying implement new functionality generates unique, human readable sku. first idea use numberseriesprovider implement functionality. however, unfortunately class marked deprecated , replaced numbersequenceprovider. there unfortunately huge documentation gap feature. so far good. numbersequenceprovider provides method nextvalue(sequenceid) provide next sequence entry. problem how define sequenceid. have seen there method createsequence(...) can used so. method adds sequence database , stores sequenceid in local sequencenumbergenerators cache. without calling createsequence(...) method sequence - far can see - never available nextvalue(sequenceid) method , therefore call method result in error. i not understand how supposed work in production scenario multiple application servers. need call createsequence(...) method on every server start make sequence available in local sequencenumbergenerators cache. approach try create sequen

c++11 - Intel C++ cannot convert `T **` to `T const * const *`, GCC can -

the problem extension of existing code i have numerical library has been designed 1 “flavor” in mind. want generalize this. basic data structure “spinor” multi dimensional matrix. there lots of functions take arrays of these spinors. generalized functions need take 1 such spinor array each flavor. say there function which, minimally, following: void copy_spinor(spinor *out, const spinor *in) { std::cout << out << " " << in << "\n"; } my generalization this: void copy_spinor(spinor *out[num_flav], const spinor *const in[num_flav]) { std::cout << "fwd: "; copy_spinor(out[0], in[0]); } in real code, there loop on num_flav , not needed demonstration here. as far understand, 1 has read const spinor *(in[num_flav]) , in pointer array of num_flav elements (or quantity because foo[] *foo in function parameter) of type pointer-to-const-spinor. the problem not compile when using spinor *non_const[2]

c# - try convert string to decimal -

the code below not work. 1)it not converting in try function double liczbaa=convert.todouble(a) not doing , skipping exception , program breaks. 1)it doesnt show format exception "bad values" in trzyde_wynik.text namespace kubik { public sealed partial class trzyde : page { public trzyde() { this.initializecomponent(); } private void wylicz_click(object sender, routedeventargs e) { string a, b, c; = wpis_a.tostring(); b = wpis_b.tostring(); c = wpis_c.tostring(); try { double liczba1 = convert.todouble(a); double liczba2 = convert.todouble(b); double liczba3 = convert.todouble(c); } catch(formatexception) { trzyde_wynik.text = "bad values"; } double liczbaa = convert.todouble(a); double liczbab = convert.todouble(b); double liczbac = convert.todouble(c); double trzyde_w =

r - S3 operator overloading for multiple classes -

i defined 2 classes can add 2 of own objects or number , 1 of own objects. a <- structure(list(val = 1), class = 'customclass1') b <- structure(list(val = 1), class = 'customclass2') `+.customclass1` <- function(e1, e2, ...){ val1 <- ifelse(is.numeric(e1), e1, e1$val) val2 <- ifelse(is.numeric(e2), e2, e2$val) val_res <- val1 + val2 print('customclass1') return(structure(list(val = val_res), class = 'customclass1')) } `+.customclass2` <- function(e1, e2, ...){ val1 <- ifelse(is.numeric(e1), e1, e1$val) val2 <- ifelse(is.numeric(e2), e2, e2$val) val_res <- val1 + val2 print('customclass2') return(structure(list(val = val_res), class = 'customclass1')) } print.customclass1 <- function(x, ...){ print(x$val) } print.customclass2 <- function(x, ...){ print(x$val) } + # [1] 2 + 1 # [1] 2 b + b # [1] 2 1 + b # [1] 2 but obviously, goes wrong when try add 2 custom classes. a

url - ManageYourTeam - Yii - apache error -

i installed manageyourteam app ( http://manageyourteam.net/ ) in web sever. i install in (example): /path/public/myt and installation ok. in path (/path/public) there urls /path/public/myt /path/public/app1 /path/public/app2 <private_ip>/myt -> ok <private_ip>/app1 -> ok <private_ip>/app2 -> ok now added alias each webapp: /etc/httpd/conf.d/app1.conf /etc/httpd/conf.d/app2.conf alias /app1 /path/app1 <directory /path/app1/> adddefaultcharset utf-8 </directory> to migrate app1 , app2 /path/app1 , /path/app2 and ok. /path/public/myt /path/app1 /path/app2 <private_ip>/myt -> ok <private_ip>/app1 -> ok <private_ip>/app2 -> ok but when moved /path/public/myt/ /path/myt/ using same .conf app1 , app2 (but changing names) myt dont works. i think error dynamic urls. posible. myt write in yii framework. thanks. temporary solution: edit /path/myt/protected/config/main.php c

titan - performannce tuning in local dynamodb of titangraph -

thank reading this my system configuration follows processor : intel® pentium(r) cpu g2020 @ 2.90ghz × 2 o.s : ubuntu 16.04 lts o.s type : 64-bit r.a.m : 5.5 gib i have use titan 1.0.0 gremlin query 3.0.1-incubating. have code defines child count of having 10000 verticex created binary tree having edges code -> ` baseconfiguration conf = new baseconfiguration(); conf.setproperty("storage.backend", "com.amazon.titan.diskstorage.dynamodb.dynamodbstoremanager"); conf.setproperty("storage.dynamodb.client.endpoint", "http://localhost:4567"); conf.setproperty("storage.batch-loading ", "true"); conf.setproperty("storage.buffer-size", "10000"); conf.setproperty("query.fast-property", "true"); conf.setproperty("storage.buffer-size","65536"); conf.setproperty("cache.db-cache", "true"); co

Unable to connect to Pentaho data integration repository -

Image
i have set pentaho data integration 7.0 on aws server. when try go connect repository, in order create new repository, pdi 7.0 doesnt show option connect repository. i not getting idea, how option working ?

javascript - html button won't call function -

trying call function called "clear()" in javascript won't work, function works when put console won't when click button <script type="text/javascript" src="nandc.js" ></script> <span id="status">player1's turn (x)</span> <br> <button onclick="btnclick(11)" id="11">&nbsp;</button> <button onclick="btnclick(12)" id="12">&nbsp;</button> <button onclick="btnclick(13)" id="13">&nbsp;</button> <br> <button onclick="btnclick(21)" id="21">&nbsp;</button> <button onclick="btnclick(22)" id="22">&nbsp;</button> <button onclick="btnclick(23)" id="23">&nbsp;</button> <br> <button onclick="btnclick(31)" id="31">&nbsp;</button> <button onclick="bt

javascript - Create new item with custom title instead of ID in firebase via Angular -

i'm doing end via angular , using firebase db. it's working great, , i've create controller create new pots - works perfectly. however, when creating new post, give in firebase long , random id. .controller("videosctrl", function(firebase, $scope, $firebasearray) { var ref = firebase.database().ref('posts') $scope.groups = $firebasearray(ref); $scope.addgroup = function() { $scope.groups.$add({ title: $scope.newgrouptitle, caption: $scope.newgroupcaption, creator: $scope.newgroupcreator, privacy: $scope.newgroupprivacy, published: $scope.newgrouppublished, }) } i'm using scope create new pots, i'd instead of having random id have title title: $scope.newgrouptitle, so db when create post like: --mydomain ---- posts ------ random id generated --------title --------caption --------creator --------privacy --------published ------ random id generated --------title --------caption --------creator --------privacy --

javascript - Array.filter first of value -

i have json array based on structure: [ {property1: "bmw", property2: value, property3: value, property4: value}, {property1: "mercedes", property2: value, property3: value, property4: value}, {property1: "bmw", property2: value, property3: value, property4: value}, {property1: "nissan", property2: value, property3: value, property4: value} ] how can filter array find first time new value appears property1 , store in separate array? i array like: ["bmw", "mercedes", "nissan"] if want store unique values, should use javascript built in-object set() the method .add(value) append value set if doesn't exist let carnames = new set(); let cars= [ { property1: "bmw" }, { property1: "mercedes" }, { property1: "bmw" }, { property1: "nissan" } ]; cars.foreach(car => carnames.add(car.property1)); console.log(

android - Building an app made with Intel-xdk with Cordova Cli -

i'm evaluating intel-xdk, idea using tool in classes (people 15 18 y.o.), i'm on ubuntu 16.04 , installed xdk 3759 linux 32. couple of days ago, installed update installed nodejs, npm , cordova because far june xdk no more provide cloud build service, anyway, after installing android sdk tools, build tools , platform tools, when try compile simple project i've got error error: /home/prof/prova-xdk/platforms/android/gradlew: command failed exit code 1 error output: /home/prof/android-sdk/build-tools/25.0.2/aapt: 3: /home/prof/android-sdk/build-tools/25.0.2/aapt: syntax error: unterminated quoted string failure: build failed exception. what went wrong: execution failed task ':cordovalib:processdebugresources'. com.android.ide.common.process.processexception: failed execute aapt can please explain me error? may check code? file? everybody! alessandro i recommend update 3900 (hotfix coming address login , several other issues) , use "cordova ex

ASP.net MVC - create query in model -

i'm novice @ mvc . have 3 models: department, unit, employees. public class department { public int departmentid { get; set; } public string departmentname { get; set; } public int managerid { get; set; } } public class unit { public int unitid { get; set; } public string unitname { get; set; } public int managerid } public class employees { public int employeeid { get; set; } public string employeename { get; set; } } i want edit objects unit , department in single view. use structure view model: public class structuremodel { public ienumerable<departments> departments { get; set; } public ienumerable<units> units { get; set; } public ienumerable<employee> employees { get; set; } } i want have in view tables departments , units column managername instead managerid (managername == employeename unit.managerid == employee.employeeid) . controller: private registraicontext db = new registraicontext(); public actionresult index()

javascript - Adding a Circle/Radius around Google Map markers -

anyone able me add circle/radius around google map markers? function createmarker ( size, i,id,lat,lng,pin,title,counter,image,price,single_first_type,single_first_action,link,rooms,baths,cleanprice,single_first_type_name, single_first_action_name){ var mylatlng = new google.maps.latlng(lat,lng); var marker = new google.maps.marker({ position: mylatlng, map: map, icon: custompin(pin), shape: shape, title: title, zindex: counter, image: image, idul: id, price: price, category: single_first_type, action: single_first_action, link: link, infowindowindex : i, rooms: rooms, baths: baths, cleanprice: cleanprice, size: size, categor

rust - Conditional compilation with a if let enum matching which consists of one item -

i have following enum : pub enum game { match(gameworker), #[cfg(feature = "cups")] cup(cupworker), } so, enum consists of 1 item if cups feature disabled. code below match compiles okay in place use if let s on matching enum there error: working match : fn clear(&mut self, silent: bool) { match *self { game::match(ref mut gm) => gm.clear(silent), #[cfg(feature = "cups")] game::cup(ref mut c) => c.clear(silent), } } if let leads compile error: let m: &mut game = game::match(...); if let game::match(ref mut gamematch) = *m { // ... } error: error[e0162]: irrefutable if-let pattern --> src/game.rs:436:32 | 436 | if let game::match(ref mut gamematch) = *m { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ irrefutable pattern minimal example is there way allow such if let s ? construction somewhy not allowed use it, don't un

Linux capabilities with yocto -

i want give several files linux capabilities (e.g. cap_net_admin). using yocto , file system should read-only , must not changed after flashing software (this means pkg_postinst setcap work not possible). is there other way give capabilities files without changing file structure after booting target? pkg_postinst scripts executed while building read-only rootfs, approach works. must ensure commands call in script available in build host, though, otherwise execution of script fail , gets deferred first boot on device. how ensure setcap command available depends on yocto release, change in yocto 2.3. here's complete example recipe: license = "mit" do_install () { install -d ${d}/${bindir} touch ${d}/${bindir}/foobar } pkg_postinst_${pn} () { setcap cap_chown+e "$d/${bindir}/foobar" } # dependency when installing on target. rdepends_${pn} = "libcap" # dependency rootfs construction, yocto > 2.3. package_write_deps = "

join - Arel: Need help converting SQL statement into Arel code for Rails -

trying following sql work in rails query. the query: select addr.* addresses addr join users u on addr.addressable_type = 'user' , addr.addressable_id = u.id join customers c on c.id = u.actable_id , u.actable_type = 'customer' c.account_id = 1 , c.site_contact = 't' this rails code: # inside account.rb model def site_addresses = address.arel_table #arel::table.new(:addresses) u = user.arel_table #arel::table.new(:users) c = customer.arel_table #arel::table.new(:customers) # trying debug/test rendering sql. eventually, want # return relation array of addresses. sql = address. joins(u). on(a[:addressable_type].eq("user").and(a[:addressable_id].eq(u[:id]))). joins(c). on(c[:id].eq(u[:actable_id]).and(u[:actable_type].eq("customer"))). where(c[:account_id].eq(self.id).and(c[:site_contact].eq(true))).to_sql raise sql.to_yaml #trying debug, i'l

How to setup GIT for a GWT project -

which files , folders of gwt project have tracked, can ignore? i think ./src, ./test have tracked. found out ./war important, i've red, contains generated files. i found out ./test-classes must tracked, don't understand why. usually folders , files git version control gwt projects including: .settings war .classpath .project usually files , folders ignored git (you can find here) : *.class # package files # *.jar *.war # gwt caches , compiled units # war/gwt_bree/ gwt-unitcache/ # boilerplate generated classes # .apt_generated/ # more caches , things deploy # war/web-inf/deploy/ war/web-inf/classes/ #compilation logs .gwt/ #caching compiled files gwt-unitcache/ #gwt junit compilation files www-test/ #old gwt (1.5) created dir .gwt-tmp/ in word, files changes have impact project should version controlled. , output files/folders or files have no impact project can ignored git.

css - Prevent scroll to top when using "-webkit-overflow-scrolling: touch" on iOS 10 -

i working on ios 10 app there webkit page containing vertical scrollable area css rule -webkit-overflow-scrolling: touch . if scroll down area , tap clock on ipad status bar, area scrolled top. how can disable "scroll top" behavior maintaining smooth scrolling given -webkit-overflow-scrolling: touch ? both objective-c or javascript solution accepted. thank you

node.js - mongoose aggregate keeps node server blocked -

i have couple hundred thousand documents in collection, each timestamp field. i want count number of records respect each day last month. i'm running mongoose aggregate command unfortunately taking long time expecting. following aggregate function: function dailystats() { var lastmonth = new date(); lastmonth.setmonth(lastmonth.getmonth() - 1); mymodel.aggregate( { $match: {timestamp: {$gte: lastmonth}} }, { $group: { // data count grouped date _id: {$datetostring: {format: "%y-%m-%d", date: "$timestamp"}}, count: {$sum: 1} } }, {$sort: {"_id": 1}}, function (err, docs) { console.log(docs); }); } now, whole point of callbacks non-blocking code. however, when function executed, takes around 20-25 seconds. whole time, node application doesn't respond other apis! f

ios - Can we add transition animations in Swift Playground? -

Image
can add animations in swift playground? like in picture. how can manage set ui in programme written in playground? if animation takes place in single view can use playground if looking transition between different views better use project gives tools handle transitions between views storyboard , code based https://developer.apple.com/library/content/featuredarticles/xcodeconcepts/concept-projects.html

php - Calling custom plugin from view helper -

is there way call custom plugin view helper in zf3? as per zf3, factory helper created me. in zf2 how call plugin. $ecommerceplugin = $this->getservicelocator() ->get('controllerpluginmanager') ->get('customplugin'); as servicelocator removed zf3, how call plugin? edit module.config 'view_helpers' => array( 'invokables' => array( 'customplugin' => \mymethod\controller\plugin\customplugin::class ) ), mymethodcontroller\customplugin class customplugin extends abstractplugin { //my methods } i recommend registering customplugin viewhelpermanager . can find information configuration in zend's manual . typically how module's module.config.php may look: <?php return [ 'controller_plugins' => [ 'invokables' => [ 'customplugin' => \mymethod\controller\plugin\customplugin::class ],

javascript - Making directory with ANT build.xml throws error creation wasn't successful for unknown reason -

i'm trying create directory lastmodified timestamp of file,but while creating directory timestamp throws error, <macrodef name="getfiletimes"> <attribute name="dir" /> <attribute name="file" /> <attribute name="setprop" default="@{file}_ctime" /> <sequential> <exec executable="cmd" dir="@{dir}" outputproperty="@{setprop}"> <arg value="/c" /> <arg line="dir @{file} |find ' @{file}'" /> </exec> <script language="javascript"> tmp = project.getproperty("@{setprop}").split(" "); project.setproperty("@{setprop}", tmp[0]+"_"+tmp[2]) ; </script> </sequential> </macrodef> <getfiletimes dir="${results.dir}" file="log.log" /> <echo>

sql server - 1 sql with 2 different sqlconnections using c# -

i have 2 different connections located on different sql servers, source server , target server. want compare table exists in both servers , align target server table source server one. sqlconnection src = (databaseconnection.getsqlconnection()); sqlconnection trg = new sqlconnection(properties.settings.default.idcconnectiondev); src.open(); trg.open(); sqlcommand source = new sqlcommand("select * source table", src); sqlcommand traget = new sqlcommand("select * target table", trg); sqldatareader drsrc = source.executereader(); sqldatareader drtrg = traget.executereader(); datatable tbl1 = new datatable(); tbl1.load(drsrc); datatable tbl2 = new datatable(); tbl2.load(drtrg); now question how run following query: (select * source table) except (select * target table) or other sql query using tables both connections. you not able run sql statement across 2 different data tables, since on different connections. you create linked server on

angular - Angular2 Template mixins and helpers -

is there way define helper functions generate html code before compilation time? for example, nice generate <i class="icon icon-hamburger" aria-hidden="true"></i> <icon>hamburguer</icon> without overhead , performance impact of creating component , need translated before template compilation. it's recommended use aot (ahead of time compilation) in production, put overhead , performance impact component creation minimum. have want, need create dynamic component, add overhead process, , doesn't work (well) aot . a fast directive this: @directive({ selector: '[jmicon]', host: { 'attr.aria-hidden': 'true' } }) export class icondirective { @input() public jmicon: string; @hostbinding('class') public classlist(): string { return 'icon icon-' + this.jmicon; } } with usage: <i jmicon="hamburger"></i>

java - Is it possible to switch to the next element from the active element in selenium? -

for example, active element input element. need able switch span element in order click checkbox. can't use xpath or css selectors because part of dynamic table element path changes every time. have tried using actions , moving element before clicking doesn't work. other way can think of create hashmap , store key associated checkbox checkbox value (on/off) seems lot quite trivial. <div class="checkbox"> <label> <input class="ace" data-element-name="compulsory" type="checkbox"> <span class="lbl"></span> </label> </div>

if statement - SQL query - To update a column with if condition and join -

request in writing update query joining 2 tables , if condition. converting amount usd here. there 2 tables. - amount , original currency, b- exchange rate, currency, , type. exch_rate value should fetched below conditions , b.[rate type]='actual'. in case if particular currency not have corresponding row b.[rate type]='actual', should consider exch_rate of row value b.[rate type]='na' this have got far. query able update items has corresponding row in table b [rate type]='actual'. not sure how can check if corresponding rows there or not , update accordingly update set [usd_amt]=a.[amt] * b.[exch rate] [dbo].a inner join [dbo].b on a.[currency]=b.[from cur] , month(a.month)=month(b.[eff date]) b.[to cur]='usd' , b.[rate type]='actual' table a: amt | currency | month | usd_amt 100 | gbp | jan 200 | isd | feb table b: from cur | cur| rate type | month | exch_rate gbp usd actual ja

java - Creating a derivation tree from a set of Grammar rules -

i have 2 arrays, defining set of rules in context free grammar. array 1 being left side of rule , array 2 being right side of rule, example : a = b | c translate array1[0] = a, array2[0] = b c from this, want construct possible derivation given integer defines how many steps can occur. example, ---> c constitute 1 step. if integer 3, program print out possible derivations occur in 3 steps. any advice on how tackle program appreciated, i've been trying think way around problem hours no success. i'm using java. thanks. since using string objects express derivations use starting symbol , split derivation using delimiter " ". search derivations non-terminals in right order , try recursively derive them. if there terminals left, print out complete derivation have stored in structure, e. g. list, contains every derivation. last point still other options available derive. but think modelling not since not efficient. problem dealing typically solved

mysql - Grasping 3NF - Is this an indicator of a 3nf database? -

so, understanding, in 3nf database, primary key value can used determine every single other attribute in table. does mean foreign keys exclusively used create composite entities? how foreign keys fit in 3nf database? what 'signs' database normalised? can tables in database normalised, while others not? so, understanding, in 3nf database, primary key value can used determine every single other attribute in table. not really. that's trivially true all normal forms. table in 3nf if it's in 2nf , there no transitive dependencies. strictly speaking, normal forms refer individual tables, not databases. does mean foreign keys exclusively used create composite entities? how foreign keys fit in 3nf database? no. can mix foreign key references , discrete values in way makes sense. or in ways make no sense. what 'signs' database normalised? the "signs" definitions of various normal forms. want know whether table "us

excel - Alternative for r2excel package in R 3.3.3 -

until happily using r2excel package save multiple data sheets excel format using script: library("r2excel") filename <- "r2excel-example1.xlsx" wb <- createworkbook(type="xlsx") sheet <- createsheet(wb, sheetname = "example1") xlsx.addtable(wb, sheet, head(iris), startcol=2) saveworkbook(wb, filename) now have updated r version 3.3.3 package no longer available: devtools::install_github("kassambara/r2excel") error in loadnamespace(name) : there no package called ‘curl’* i have found difficult export files excel using other packages in old version. can recommend solution exporting multiple dataframes single excel file, compatible r3.3.3? (saving csv not option several reasons including need saving multiple sheets in 1 file). thanks

git - TortoiseGit with server-sided hooks (through http) -

first of thank wonderful website (yes i'm new, @ least writer :p). since didn't found here answer problem try ask directly :) saw here maybe http related don't know post quite old ... the main problem: i want make hook run on remote server (on linux system). when try act client doing tortoisegit clone trying commit , push modifications, completed without launching remote script present in .git/hooks folder on remote server repository. tried script named update , , pre-receive . script have echo "hello" , doesn't print anywhere when launching. what i've checked: the extension ".sample" gone, scripts can executed, own user account, did manage make hooks work on client side (like prepare-commit-msg ). a more detailed example: in order go further did try commit , push not through tortoisegit on windows (like client) directly sort of local testing on linux server (to investigate closer problem before trying again tortoisegit...)

javascript - Building and updating array objects -

i'm working on simple registration system displays number of seats available in particular workshop. it's built in google apps script runs javascript syntax. i build array of class objects user when log in. 1 of object keys seats , shows available number of spots left in workshop. that, compare master list of classes max number of registrants current registration list. class object [{ date: 4/10/2017, title: "workshop 1", desc: "a string description 1", seats: "" }] google sheets table | date | title | description | seats | | |-----------|------------|----------------------------|-------|---| | 4/10/2017 | workshop 1 | string description 1 | 20 | | | 5/10/2017 | workshop 2 | string description 2 | 25 | | current registrations | user | class0 | class1 | |-------|-----------|-----------| | user1 | 4/10/2017 | | | user2 | 4/10/2017 | 5/10/2017 | | | |

simulink - Time driven simulation backwards steps -

i looking alternative simulink allow control stepping mechanism. same concern raised in question , simulink not allow backwards stepping, complex systems x(t,u) "changing variables" (t <- -t) requires weeks of work, cannot controlled (u) correctly due interdependance between past states , present decisions (u=f(x(s)),s<=t). conceptually, trick consists in manually storing previous states in memory : simulink user , difficult , error prone, whereas stepping backwards in time simple , fit nicely in simulink, developer 's point of view.

php - Can't decode my HTML entities -

i storing raw html this... nl2br(htmlentities($this->input->post('raw_html'))) in database data looks this... &amp;lt;ul&amp;gt; &amp;lt;li&amp;gt;improve our understanding of issue&amp;lt;/li&amp;gt; &amp;lt;li&amp;gt;strengthen listening , writing skills&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt; when try , display markup database use this: echo html_entity_decode($html_from_db, ent_compat, 'utf-8'); but output being shown in browser: <ul> <li>improve our understanding of issue</li> <li>strengthen listening , writing skills</li> </ul> lesson name and html entities shown in source code... no entities being decoded. why not working? probably when you're using encode htmlentities encoded twice. see @ function params: function htmlentities ($string, $quote_sty

c# - PostAsync does not add cookies -

i have website using web security , web system built in asp.net identity, both applications having same credentials of user, requirement when sign in in web security application through redirects or something, can logged other website using credentials user provide. i have tried redirecting , putting login credentials in control , triggering submit not working. //here code redirecting external url response.redirect("http://localhost:2534/account/logon?username=" + m.username + "&password=" + m.password, false); next thing tried call logon post method directly website , still not working private static readonly httpclient client = new httpclient(); var values = new dictionary<string, string> { { "username", "username"}, { "password", "password" }, { "rememberme", "true" } }; var content = new formurlencodedcontent(values); var response = await client.postasync(http://local

asp.net - Inserting data into multiple tables using single RadDataForm with EntityDataSource -

i have scenario in have insert data multiple tables using single raddataform entitydatasource following 3 tables , columns comtype: id, contype contactdetail: id, contactname, city contactcom: id, contactdetailsid, comtypeid, comvalue the point able insert single table not able insert multiple tables. [ <asp:label id="comvaluelabel3" runat="server" associatedcontrolid="comvaluetextbox" cssclass="rdflabel rdfblock" text="comvalue"></asp:label> <telerik:radtextbox id="comvaluetextbox" runat="server" rendermode="lightweight" text='<%# bind("comvalue") %>' wrappercssclass="rdfinput" /> ] 1 ​ following syntax of calling other tables columns while insertion <asp:label id="contactnamelabel2"runat="server"associatedcontrolid="contactnametextbox" cssclass="rdflabel rdfblock" text="c

Jmeter only runs the first thread -

Image
i'm still new jmeter , i'm having trouble running more 1 thread in test plan. i'm trying run tests using gui (just make check pass), when run test plan, seems run first thread in plan. there i've done wrong in test plan? add "view result tree" listener in test plan level instead of adding individually each thread group. solve issue. hope helps..

ios - Update Once each in specific time -

override func update(_ currenttime: timeinterval) { // called before each frame rendered parallax.update(currenttime) } how can control update done once on specific period of time your code doesn't add question, don't know if looking for, here code call function every x time (swift 3): // call mymethod every 1 second : timer.scheduledtimer(timeinterval: 1, target: self, selector: #selector(mycontroller.mymethod), userinfo: nil, repeats: true) please search before post question -> answer

Compare IDs between two indices in elasticsearch -

i have 2 indices in elasticsearch cluster, containing ought same data in 2 different formats. however, number of records different. ids of each document should same. there way extract list of ids present in 1 index not other? if 2 indices have same type these documents stored, can use this: get index1,index2/_search { "size": 0, "aggs": { "group_by_uid": { "terms": { "field": "_uid" }, "aggs": { "count_indices": { "cardinality": { "field": "_index" } }, "values_bucket_filter_by_index_count": { "bucket_selector": { "buckets_path": { "count": "count_indices" }, "script": "params.count < 2" } } } } } } the query abo

web scraping - CSS selector in Python BeautifulSoup -

i have built simple scraper looking @ airbnb listings. goal go through given site (i.e. this one ). first_page = beautifulsoup(requests.get("https://www.airbnb.com/s/copenhagen--denmark/homes?allow_override%5b%5d=&s_tag=khqeqtpz&section_offset=1").text, 'html.parser') listings = first_page.find_all('div', 'listing-card-wrapper') listing in listings: print(listing.select("#listing-15616363 > div.infocontainer_v72lrv > > div.ellipsized_1iurgbx > div > span:nth-child(1) > span:nth-child(1)")) the code correctly loops through 18 elements on page. however, prints 18 empty arrays indicating listing.select statement not working. got css tag chrome dev tools copy selector function. this because listing-15616363 specific every listing (notice format listing-{listing_id} ) , there no class has id = 'listing-15616363' among looped listings. for instance, if want fetch url, can : listing.find(

android - ChatFirebaseAdapter Load more data when reach Top of recyclerview -

hi everyone i'm using adapter link https://github.com/alebarreto/firebaseandroidchat/blob/master/app/src/main/java/alessandro/firebaseandroid/adapter/chatfirebaseadapter.java firebaseadapter = new chatfirebaseadapter(mfirebasedatabasereference.child(path), usermodel.getid(),this, getactivity()); rvlistmessage.setadapter(firebaseadapter); rvlistmessage.addonscrolllistener(new recyclerview.onscrolllistener() { @override public void onscrollstatechanged( recyclerview recyclerview, int newstate){ super.onscrollstatechanged(recyclerview,newstate); if (newstate == recyclerview.scroll_state_idle) { // on scroll stop // here load more data } } }); i know how can limite number of data loaded chatfirebaseadapter , how tell chatfirebaseadapter load more messages when reach top of recyclerview

How to play live FLV stream? -

i capturing video webcam in pc , in fly convert flv (using ffmpeg). result have continuously growing .flv file. , play live stream. trying vlc plays file no longer duration read file on initialization. player can use live playing flv? working on ubuntu 16.04. thank in advance answers!

web - PHP Login Form Session Variable Destroying -

i new php , creating login screen session variable. trying destroy or unset session variable when logging out doesn't seem work. my session variable: $_session['currentuser'] this button should end session: <input type="submit" name="logout" id="logout" value="log out"> when pressing button: if(isset($_post['logout'])) { session_unset(); session_destroy(); } my practice, set session variable random: $_session['currentuser'] = time(); session_destroy(); and reload/refresh page. example: header('location: /'); die; if not redirect after session destruction, page render as if session not destroyed (html render...)

c - Why is this code giving bad file descriptor -

i having issue following code. giving me bad file descriptor error. #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> #include <limits.h> int main() { int fd = open("/tmp/test", o_rdonly); long len = 20; long word; ssize_t ret; if(fd == -1) { perror("open"); return 1; } if(len > ssize_max) { len = ssize_max; } ret = read(fd, &word, len); while(len != 0 && ret != 0) { if(ret == -1) { if(errno == eintr) { continue; } perror("read"); break; } len -= ret; word += ret; ret = read(fd, &wor

javascript - Webpack, trouble loading local fonts -

i having issues loading local fonts when using webpack. have host few of own fonts have folder in /client/fonts fonts. right now, loading them production web pack build && cp -r ./client/fonts dist/ in npm script build process. trying see if file-loader me not have rely on cp. after bit of googling, tried see if use filer-loader needs (in webpack production build) - ,{ test: /\.(otf|eot|svg|ttf|woff|woff2)$/, loader: 'file-loader', query: { outputpath: 'fonts/' } } however, when run build task see no fonts imported. not sure doing wrong here. reference webpack entry/output : entry: { js: [ path.join(__dirname, 'client/app.jsx') ], vendor: [ 'react', 'react-dom', 'lodash', 'react-redux', 'redux' ] }, output: { path: path.join(__dirname, '/dist/'), filename: 'bundle.min.js', publi

sql server - SQL Query - Multiple Joins return as Columns -

first off i'm terrible @ sql , proving point. end goal have database (what's gold) i'm trying export devices out of , getting few key fields in process. i'm able data want query below. however, due joins, it's returning duplicate rows finds match. ideally, i'd want each unique item added column i'm left 1 row per device many columns needed attributes if it's null. select device.sdisplayname, networkinterface.snetworkaddress, networkinterface.snetworkname, devicegroup.sgroupname, activemonitortype.smonitortypename, actionpolicy.spolicyname, device.snote , deviceattribute.svalue networkinterface join device on (networkinterface.ndeviceid = device.ndeviceid) left outer join dbo.devicetype on device.ndevicetypeid = devicetype.ndevicetypeid left outer join dbo.pivotdevicetogroup on pivotdevicetogroup.ndeviceid = device.ndeviceid left outer join dbo.devicegroup on devicegroup.ndevicegroupid = pivotdevicetogroup.ndevicegroupid left outer join