Posts

Showing posts from September, 2011

apache - Is there a special case in Apache2 when calling a CGI and the URI includes a single query string parameter without a value? -

today got error , surprised since looked fine... i have cgi written in c++ accepts uris query string. query string selects page, etc. cgi installed in standard location ubuntu installation: /usr/lib/cgi-bin/snapmanager.cgi today finishing adding login screen , once logged in, wanted add logout link. link adds ?logout @ end of uri: http://www.example.com/cgi-bin/snapmanager.cgi?logout that failed. checking error log, got error saying "logout" appeared on command line. rather surprising, if ask me! tried with: http://www.example.com/cgi-bin/snapmanager.cgi?logout=now and worked expected. no logout on command line. i tried: http://www.example.com/cgi-bin/snapmanager.cgi?logout&host=foo and worked too. again, no logout on command line. however, if switch parameters position fails again: http://www.example.com/cgi-bin/snapmanager.cgi?host=foo&logout so looks apache2 calls cgi logout query string parameter on command line when 1 query strin

mouseevent - Javascript: prevent dropdown open when selecting -

i want prevent dropdown menu opened when selecting range of cells. know, can add onmousedown event , call event.preventdefault() the problem disable dropdown single click event too. there way distinguish between selection of range (the mouse pressed , not released) , click on single cell (mouse pressed , released)? have tried onselectstart doesn't me in case. here small demo: https://jsfiddle.net/vqsv99t4/2/ i have updated code work according need. disable text selection : removed javascript css .noselect { -webkit-touch-callout: none; /* ios safari */ -webkit-user-select: none; /* chrome/safari/opera */ -khtml-user-select: none; /* konqueror */ -moz-user-select: none; /* firefox */ -ms-user-select: none; /* internet explorer/edge */ user-select: none; /* non-prefixed version, not supported browser */ } source: https://stackoverflow.com/a/4407335/1957036 stopping event bubble <td&g

msiexec - Creating MSI installation package using Visual Studio 2015 -

i have been working on project involving ms access database (adodb). have built , executed project. having troubles in making package out of installation on other pc. vb6 package deployment wizard , didn't have worry dependencies , all. have no idea how in vs2015. have tried installshield , visual setup. both stuck missing dependencies. 1 netframework (can installed manually) second target pc doesn't recognize adodb string. can me out in how create package transport required depencies , bonus installs netframework on target pc on own (the way happens in done installation of games directx) thanks

python - Django 1.10 - NoReverseMatch at /login/ when trying to render login page -

this question has answer here: what noreversematch error, , how fix it? 1 answer error noreversematch 1 answer this question has been asked many times couldn't figure out problem. i started development django . developing log app authenticate users project using django in-built authentication system. i facing error when rendering login page through project.urls . url(r'^login/$', views.login, {'template_name': 'login.html', 'authentication_form': loginform}), i used loginform customize html fields bootstrap css classes. here app views.py - @login_required(login_url="login/") def home(request): return render(request, "home.html") if user not logged in login_required redirect user login page. getting err

Call the specific position in list (Python) -

i kinda new in python, still learning. can guys me how can call specific position of list? for example: list_of_numbers = [24, 45, 743, 23, 541]: how can number 743 ? to need index list. naming variable list , putting number along list in square brackets remember python starts counting 0. example: list_of_numbers=[24, 45, 753, 23, 541] list_of_numbers[2]

primefaces - add listener to page refresh event -

i have action needs happen after page refreshed (not pressing f5 time page has been refreshed). how add such event listener? i use this: <h:form> <p:remotecommand name="update_page" process="@this" update="form" actionlistener="#{myview.myaction}" /> . . . . </h:form> <script> $(document).ready(function() { update_page(); } </script> load or refresh of page run remotecommand .

javascript - CryptoJS to OpenSSL encryption conversion -

i need port javascript code c99 backend. in javascript code use cryptojs perform aes encryption: var key = cryptojs.md5(math.random().tostring()).tostring(); key = cryptojs.enc.hex.parse(key); var iv = cryptojs.md5(math.random().tostring()).tostring(); iv = cryptojs.enc.hex.parse(iv); var data = "testdata"; var encrypted = cryptojs.aes.encrypt(data, key, { iv:iv, mode:cryptojs.mode.cbc, padding:cryptojs.pad.zeropadding }); now need implement same code in c openssl library. have created random md5 strings without problem cannot see how implement aes encryption 0 padding. have: bool crypto_aes_encrypt(const char* data, unsigned char *key, unsigned char *iv, unsigned char **out_buf, int *out_buf_len) { err_load_crypto_strings(); openssl_add_all_algorithms_conf(); /* initialize cipher context */ evp_cipher_ctx *ctx = evp_cipher_ctx_new(); if(!ctx) { return null; } /* initialize aes encryption */ if(evp_encryptinit_ex(ctx, evp_

Jquery could not select elem by id -

<input type="button" id="elem" value="search"> <script> var elem1 = $("#elem"); elem1.onclick = hello; function hello() { alert("hello"); } </script> i don't understand why couldn't select id element jquery, how js document.getelementbyid as elem1 jquery object, doesn't have onclick property. can use either of these method bind event handler. here, [0] underlying dom element can use onclick elem1[0].onclick = hello; or use .on() bind event handler elem1.on('click', hello);

Create/Update a row depending on values of other columns in table in MySql -

following table schema, using mysql 5.7 version create table rule_reports ( pkey int(11) not null auto_increment, email varchar(250) default null, domain varchar(250) not null, rule_id bigint(20) unsigned not null, rule_type varchar(250) not null, log_time datetime default null, count int(11) default null, primary key (pkey), key dwl (domain,rule_id,log_time) ) i want increment count column instead of new row in table, if combination of values of domain,rule_id,rule_type exists in table row sample rows of table +------+-------------------------+---------+------------------+------------------+-------------------------+---------- | pkey | email | domain | rule_id | rule_type | log_time | count +------+-------------------------+---------+------------------+------------------+-------------------------+----------- | 1 | user1@yopmail.com | user1 | 566 | type1 | 2016-09-13 1

android - How to make view over recyclerview permanent example not scroll in nestedscrollview -

hi want make view not scroll able on recyclerview,for example textview above recyclerview in nestedscrollview,how can make textview not scrolling while recycler scroll usual my code <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.nestedscrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:keepscreenon="true" app:layout_behavior="@string/appbar_scrolling_view_behavior" android:fillviewport="true" > <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:focusableintouchmode="tru

c# - How to get each web user's status is online or offline on server side ? -

when user close tab or browser means user can't online want manage status using online or offline status. how status please solution. assuming have authentication system can add new column person/account table datetime value. here can store timestamp when user last active. can update field using middleware. whenever user request new page can update timestamp in database. decide if user online have take range in seconds assume user online, if user requested page 10, 20 , 30 seconds ago can assume user online.

api - How reliable is http://www.geoplugin.net to get Geo location. -

i use free api service provided http://www.geoplugin.net . working fine , free. before deploy in project wanted know if reliable. becoz, if identifies wrong country, things can pretty wrong in program. there out there have used same ? thing reliable. ? thanks in advance.

angularjs - md Select required -

i'm trying load mddialog setting parameter (product in case), , when loads (md selects included) says fields required, , doesn't stop until change option. the code : <md-input-container class="md-block" flex-gt-sm style="min-width: 150px;"> <label>expiration type</label> <md-select name="expirationtype" placeholder="expiration" ng-model="product.expirationtype" ng-required='product.name'> <md-option value="1">only expiry date</md-option> <md-option value="2">only shelflife</md-option> <md-option value="3">expiry date & shelflife</md-option> <md-option value="4">non expirable</md-option> </md-select> <div ng-messages=&

php - Laravel 5.3 using multiple authentication (e.g admin, customer) -

i have read lot of threads multi-auth in laravel, of configurations see somehow complicated, have seen multi-auth package not support laravel socialite. aware question asked multiple times, if can give better answer. appreciated! things have tried i familiar laravel make:auth i familiar laravel socialite facebook , twitter , google plus. give try. still need basic knowledge laravel's new multitenancy. in config/auth.php add guards array: 'customer' => [ 'driver' => 'session', 'provider' => 'customers', ], than in same file add providers array: 'customers' => [ 'driver' => 'eloquent', 'model' => app\customer::class, ], than create migration customers db table (you can use laravel's out of box migration users table) next eloquent model app\customer these included: use app\scopes\authorizedscope; use illuminate\foundation\a

Django URL mapping - NameError: name X is not defined -

[a similar question asked, not marked answered, here . considered continuing thread website told me i'm supposed post answer, seems have start new topic.] i'm trying follow this tutorial , i'm having problems url mapping. part described "so best practice create “url.py” per application , include in our main projects url.py file". relevant, hope, part of folder structure, arose following steps of tutorial letter (if possible; usage of 'patterns' module impossible example) , using django 1.10 following: myproject/ myapp/ urls.py views.py myproject/ urls.py the myproject/urls.py follows: from django.conf.urls import include, url django.contrib import admin admin.autodiscover() myapp.views import hello urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^myapp/', include(myapp.urls)), ] the myapp/urls.py follows: from django.conf.urls import include, url urlpatterns = [ url(r'^hello/',

What is the pattern for handling resuming a user session for an iOS app restoration? -

i use resumelogin() async method when ios app starts or restored. can pause restoration until function returns because have view controllers have behaviors dependent upon user session (or no user session). or wrap such code in resumelogin() async call , live multiple server calls? or in first resumelogin() call send message on success view controllers can watch , change ui they've built. looking optimal, simplest maintain solution. using swift / happy objc.

python - OpenCV LBP small example - cv2.error / Assertion failed -

Image
i trying use code hanzra tech implement small lbp example. but using number images mint database 28 x 28 pixel , this: the code fails @ end, open images scores missing: it gives me error, exact line causes error shown in error itself: i tried other images, failed on same place. here code . same in example. adjusted txt files , folders test/train images.

php - Laravel save multiple records -

i've got array within arrays , add it. $options = $request->options; foreach ($options $option) { $option['poll_id'] = $this->id; } dd($options); but reason not add array. so receive this: array:1 [ 0 => array:1 [ "name" => "testtest" ] ] but expect this: array:1 [ 0 => array:1 [ "name" => "testtest", "poll_id" => 1 ] ] you're not changing $options foreach destroying $option each iteration. try instead: $options = []; foreach ($request->options $key => $value) { $options[$key]['poll_id'] = $this->id; }

openjms - Is there any way to create topics in Open JMS other than admin UI? -

i able create topics in open jms using admin ui. there java api or rest api or shell command so? administration api can used in java. sample code: import org.exolab.jms.administration.adminconnectionfactory; import org.exolab.jms.administration.jmsadminserverifc; // ... string url = "tcp://localhost:3035/"; jmsadminserverifc admin = adminconnectionfactory.create(url); string topic = "mytopic"; boolean isqueue = boolean.false; if (!admin.adddestination(topic, isqueue)) { system.err.println("failed create topic " + topic); }

python - Datastore One-to-Many Google App Engine -

Image
i'm struggling display array items in template. started entity relationships in gae , i'm not finding suitable solutions on so. have perform query first in handler. if so, how coz i'm struggling logic. datastore project entities example display datastore employees entities example display project.py class project(ndb.model): projectid = ndb.integerproperty(required=true) title = ndb.stringproperty(required=true) description = ndb.stringproperty(required=true) startat = ndb.datetimeproperty(indexed=true) endat = ndb.datetimeproperty() isfullday = ndb.booleanproperty() days = ndb.keyproperty(kind='companyday', repeated=true) employees = ndb.keyproperty(kind='employees', repeated=true) client = ndb.keyproperty(kind='client') class employees(ndb.model): name = ndb.stringproperty() role = ndb.stringproperty() template data fetched backend through angular's http service <md-c

assembly - how to print char on the screen -

i try make '#' left side of screen , other side '$' it's not stop on 25*40 .model tiny .code .startup cld mov ax, 0b800h ;for open screen mov es, ax mov di, 0 mov cx, 25*40 ;try divide screen mov ax, 5c23h rep stosw mov ax, 0b800h mov ds, ax mov si,0 mov cx, 25*40 mov ax, 6f24h rep stosw .exit end .model tiny .code .startup cld mov ax, 0b800h ;for open screen mov es, ax xor di, di ; di = 0 mov dx, 25 ; lines counter line_loop: mov cx, 40 mov ax, 5c23h rep stosw mov cx, 40 mov ax, 6f24h rep stosw dec dx jnz line_loop .exit end for fun , exercise power of xor you, shorter variant of code (try step on in debugger or head , understand how works): ... xor di, di ; di = 0 mov dx, 50 ; 50 half-lines fill mov ax, 5c23h ; start '#' half_line_loop: mov cx, 40 rep stosw xor ax, 3307h ; 5c23 xor 3307 = 6f24, 6f24 xor 3307 = 5c23 dec dx jnz half_l

swift - How to add a set of sprites in a certain pattern -

Image
i'm making game has player goes , down if hold screen. not important part though. what need add enemies, come toward you. i need know how add enemies in couple of different patterns. like this:(look @ coins pattern, how can achieve this?) you define 2-dimensional array indicate coin should e.g. var coinrow = [[int]]() coinrow.append([0,1,1,1,1,1,1,0]) // '0' means 'no coin here' coinrow.append([1,1,1,1,1,1,1,1]) // '1' means 'put coin here' coinrow.append([0,1,1,1,1,1,1,0]) then treat each coin 'area' 3x8 grid given starting location of bottom-left hand corner (0,0), following: let coinstart = cgpoint(0,0) coinpos = coinstart row in 0...2 { // iterate on rows column in 0...7 { // , columns if coinrow[row][column] == 1 { // should there coin here? putcoin(at: coinpos) // yes - draw 1 } coinpos.x += coin.width + coinhorizontalse

c# - Speech recognition in Windows application -

here code: private void button1_click(object sender, eventargs e) { speechrecognitionengine recognizer = new speechrecognitionengine(); grammar dictationgrammar = new dictationgrammar(); recognizer.loadgrammar(dictationgrammar); try { button1.text = "speak now"; recognizer.setinputtodefaultaudiodevice(); recognitionresult result = recognizer.recognize(); textbox1.text = result.text; } catch (invalidoperationexception exception) { textbox1.text = string.format("could not recognize input default audio device.is microphone or sound card available?\r\n{0} - {1}.", exception.source, exception.message); } { recognizer.unloadallgrammars(); } } here not recognizing exact word giving microphone.it s taking word,which not meaningfull. how rectify problem?

javascript - Check if property quantity is > 1 then push price * quantity -

the function below loops through properties of objects in var input example [{ name: 'nagellack 15 ml 2 2', id: '1057290002', price: '1.9', brand: 'a.o.n.', quantity: 1 }, { name: 'ceramic nail lacquer 6 ml coral reef coral reef', id: '1027410001', price: '6.9', brand: 'artdeco', quantity: 1 }] and pushes new objects into products_list [] i'm trying set condition checks when quantity of object > 1 , multiplies price quantity. issue here is, price of 1 product although there quantity of 2. i don't know best place in code set condition. function() { var input = {{dl_purchase_products}}; var products_list = []; for(i=0;i<input.length;i++){ products_list.push({ id: input[i].id.slice(0,6), price: input[i].price, <---- should price 2 quantity: input[i].quantity }); } return

appcelerator titanium - hide navigation bar android -

is possible hide permanently android bottom navigation in appcelerator titanium? many questions subject no fine solutions. <fullscreen> true </fullscreen> in tiapp doesn't work titanium 5.5.1 $.index.addeventlistener('open', function(e) { $.index.activity.actionbar.hide();}); doesn't work. 'window':{navbarhidden:true,tabbarhidden:true,fullscreen:true} in tss doesn't work etc. thank you. this method worked me, set app fullscreen without nav bar , tab bar. assuming main window's id not set or set 'index', should work, it's approach you've tried: $.index.addeventlistener('open', function(e) { $.index.activity.actionbar.hide(); }); in app.tss or index.tss: "window":{ navbarhidden:true, tabbarhidden:true, fullscreen:true } in tiapp.xml: <fullscreen>true</fullscreen> <navbar-hidden>true</navbar-hidden> if issue still same, try add (speci

c# - Execute query and send result to views at every page actualisation in asp.net -

i want don't know if way it. need color menu element in red if result of query not zero. request need data session first. so mean query must executed every page , result must send menu view in shared folder. i have try lot of thinks of them succeed. try use session can't session value in session_start in global.asax try filter call in global.asax same probleme session. how must that. sorry english. thank help.

ruby on rails - some blog sharing pop up, show pinterest-502 error. while locally working fine everything -

a{:href => "javascript:posttopinit('#{b.blog_image.url}','#{strip_tags(b.description)}','#{redirect_url_pinterest}')"} shre on pinterest and js function posttopinit(image_url, description, url) { window.open('http://pinterest.com/pin/create/button/?url=' + url + '&media=' + image_url + '&description=' + description + ' ' + url, 'sharer', 'toolbar=0,status=0,width=650,height=436'); } pop shows 502 error, our server experiencing mild case of hiccups. we've reported team.

angularjs - Can't get input value in Angular (Ionic) -

i'm new angular , ionic , have problem getting value of input. "undefined". here code: .controller('myctrl', function($scope) { $scope.submit = function () { console.log($scope.name); } } <form ng-submit="submit()"> <input type="text" ng-model="name"> <button class="button">send</button> </form> try this <form> <input type="text" ng-model="name"> <button ng-click="submit()" class="button">send</button> </form>

python 3.x - Force User to Provide Profile Before Saving in Django Admin -

am trying force user provide profile before saved django admin. here profile model class userprofile(models.model): user=models.onetoonefield(auth_user_model,related_name='profile',primary_key=true) #other fields def get_user_info(user): return userprofile.objects.get(user=user) @receiver(post_save, sender=auth_user_model) def create_profile_for_new_user(sender, created, instance, **kwargs): if created: profile = userprofile(user=instance) profile.save() am using authtools user profile sender auth_user_model. if add new user within admin,they saved if have not provided or filled in profile. want prevent them being saved until fill in profile fields. insights on how this? here admin.py from django import forms django.contrib.auth import get_user_model django.contrib.auth.forms import passwordresetform django.utils.crypto import get_random_string authtools.admin import nameduseradmin authtools.forms import

Multiple databases in django with migrations -

i have 2 databases configured, 1 1 tables, table, have in second database, database2. store data, , retrieve data without using router, 'using' attribute on save , get. upgrading our app django 1.8 while ago, , seemed working, table in database2 doesn't change often, has been working ok since upgrade. but need make change table in database2. so try manage.py migrate table --database database2. migration seems take, error in end. runtimeerror: error creating new content types. please make sure contenttypes migrated before trying migrate apps individually. i've been trying add contentypes , auth fake migrations in database2, still error. adding router make go away? there other ways? thanks!

How to get data from Android emulator? -

Image
this how android device monitor like. can not press pull file device button. why? you cannot data's emulator. can use android devices data's.

preload images on javascript (React, Jquery) app, images loaded twice -

Image
please @ edit 3 below, figured out not issue react browser's chaching mechanism. i'm trying create app creates simple carousel out of given array of images url. i've written module helps me invoke callback once images loaded, how look: imagesloader.js export default { // module loads array of images urls , when completes // calls callback images elements array load(imagesurlsarray, callback){ const imagesloaded = []; imagesurlsarray.map((url) => { const img = new image(); img.onload = () => { imagesloaded.push(img); if(imagesurlsarray.length === imagesloaded.length){ callback(imagesloaded); } }; img.src = url; }); } } i know can use promises , resolve once urls loaded, , no check errors right now. here component updates state images retriveed module above: componentdidmount() { imagesloader.l

javascript - How can i create nested functions -

i'm trying create "nested functions". can't seem find solution! const func1 = (value1) => { const func2 = (value2) => { console.log(value1 + value2) } } func1(2).func2(3) what want accomplish create own little "jquery function" const $ = (element) => { const addclass = (name) => { const x = document.queryselectorall(element); (i = 0; < x.length; i++) { x[i].classname = name } } } $('#circle').addclass('nice') i think topic broad single question, here simple example of how this, started: const $ = (selector) => { const items = document.queryselectorall(selector); const self = { addclass: (name) => { (let = 0; < items.length; i++) { items[i].classlist.add(name); } return self; }, removeclass: (name) => { (let = 0; < items.length; i++) { items[i].classlist.remove(name); }

localhost - Installing a WordPress theme locally using WAMP? -

hello trying upload theme locally using wamp zip file 19.4 mb if useful information. when go upload theme getting message: are sure want this? please try again. does know why or have suggestion why happening ? try adding theme manually first, path:wordpress_folder/wp-content/themes/. unzip theme file here. , try activate.

html - Angular 2 event not being triggered in <td> -

i have implemented functions swiping left , right on web page. have used angular 2 touch events call them, inside div this: <div (touchstart)="touchstart($event);" (touchend)="touchend($event);" (touchmove)="touchmove($event);" (touchcancel)="touchcancel($event);"> <div class="mnd"> <ul> <a (click)="minusmnd()"> <li class="forrige"> &#10094; </li> </a> <a (click)="plussmnd()"> <li class="neste"> &#10095; </li> </a> <li>{{maanednavn[maaned-1]}}<br> <span style="font-size:18px">{{aaret}}</span> </li> </ul> </div> <div class="kalender"> <table *ngif="datoer"> <tr> <th>man</th> <th>tir</th> <th>ons</th> <th>tor

angularjs - API Request timeout issue -

i calling 1 post api give me response after period of time after completing job. job taking time complete , getting timeout error in api response. can me resolve this? there have set before calling api keep api call alive until gets response? in advance. i tried below solutions didn't worked me in http post call set header "connection":"keep-alive" used timeout property still didn't worked please set timeout value keep-alive . setting connection type not work in scenario. should set properties of keep-alive. try luck , let me know if query.

firebase - Creating Users in AngularFire without Signing In -

im making app in angularjs , app has scenario user admin role can create users. i know can create users using $createuserwithemailandpassword("my@email.com", "mypassword") sign outs current user . i want create users,not let them sign in after registering. i found can use firebase admin sdk it. unable initialize in controller gives error require not defined var admin = require("firebase-admin"); admin.initializeapp({ serviceaccount: "/myservice.json", databaseurl: "urldb" }); i responded comment on previous answer : the firebase admin node.js sdk should run in trusted environment only. creating user without signing them in considered administrative task. you should not use firebase admin sdk add functionality same app give regular users. security concern.

qt - Prevent redrawing of underlayed elements int QtQuick Qml custom control -

i have 2 custom qml components, inherited qdeclarativeitem . in constructors of components set options: setflag(qgraphicsitem::itemhasnocontents, false); setcachemode(qgraphicsitem::itemcoordinatecache); in application have element of 1 type above element of type. elements don't share properties, when 1 of them redrawing, redrawing too. if put standard element above elements (like text or rectangle ) , change it's properties, doesn't make elements redrawn. suppose, i've forgot set flag in components. how prevent redrawing of 1 item when changing? i'm using qt 4.8 , qtquick 1.1 in raster-based rendering system, drawing done on backing store buffer. thus, when changes in qgraphicsview , items not obscured must drawn in back-to-front z order. if any visible item changes, all visible items intersect must redrawn. what you're seeing looks normal behavior. unless provide code, it's impossible tell otherwise.

JavaScript closure inside loops – simple practical example -

var funcs = []; (var = 0; < 3; i++) { // let's create 3 functions funcs[i] = function() { // , store them in funcs console.log("my value: " + i); // each should log value. }; } (var j = 0; j < 3; j++) { funcs[j](); // , let's run each 1 see } it outputs this: my value: 3 value: 3 value: 3 whereas i'd output: my value: 0 value: 1 value: 2 what's solution basic problem? well, problem variable i , within each of anonymous functions, bound same variable outside of function. what want bind variable within each function separate, unchanging value outside of function: var funcs = []; function createfunc(i) { return function() { console.log("my value: " + i); }; } (var = 0; < 3; i++) { funcs[i] = createfunc(i); } (var j = 0; j < 3; j++) { funcs[j](); // , let's run each 1 see }

How to construct a list in Prolog? -

let's want construct list 10 elements each elements can 0 or 1 or 2. have 2 lists list1 , list2, positions of 1 , 2. how can construct whole list using function this: construct(list1,list2,l). example: input: construct([1,3,5],[8],l) output: l = [1,0,1,0,1,0,0,2,0,0] what constructh(top, top, _, _, []). constructh(num, top, l1, l2, [1 | ho]) :- num < top, member(num, l1), np1 num+1, constructh(np1, top, l1, l2, ho). constructh(num, top, l1, l2, [2 | ho]) :- num < top, member(num, l2), np1 num+1, constructh(np1, top, l1, l2, ho). constructh(num, top, l1, l2, [0 | ho]) :- num < top, \+ member(num, l1), \+ member(num, l2), np1 num+1, constructh(np1, top, l1, l2, ho). construct(list1, list2, lout) :- constructh(1, 11, list1, list2, lout). ?

java - Login into application via different credentials from different systems opens the same dashboard of a User (duplicate) -

this issue appears , tried 100 of times manually in 2 systems. can plz me in replicating scenario, ---login gmail 2 systems different credentials @ same time .. but both of inbox belong single user (duplicate).... i tried via selenium parallel browser test : , iterated script more 15 times .... but issue not replicated : what reasons issue , if have faced far..? it replicated @ client end , , said occurs in difference of .5 second .....then why not getting caught via selenium

PHP can nest class in two files? -

i know php can't nest classes, seems can if 2 classes in 2 files: mainclass.php: <?php ini_set('display_errors', 'on'); error_reporting(e_all | e_strict); class mainclass { private $var; public function __construct() { require_once ('subclass.php'); $subinstant = new subclass(); } } $maininstant = new mainclass(); and subclass.php <?php ini_set("display_errors", "on"); error_reporting(e_all | e_strict); class subclass { public function __construct() { $this->var="this-var\n"; echo $this->var; $test="test in construct\n"; echo $test; function testvar() { //$this->var = "this-var in fun\n"; //echo $this->var; $funtest="test in fun\n"; echo $funtest; } testvar(); } } no errors output, , result expected. don't understand require_once , seems include code in subclass.php , what's differe

html - CSS positioning issues: invalid property value -

solved i have simple css/html code, no matter do, "invalid property value" exception chrome, , logo won't positioned properly. help. edit: fixed first problem, image not move related border. sorry, i'm totally new web design , need little bit of help. <html lang="de" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>my website</title> <style type="text/css"> *{ padding: 0; margin: 0; } .header { width: 100%; height: 100px; border: none; border-bottom-style: solid; border-bottom-width: 5px; position: relative; border-bottom-color: rgb(220,30,60); } .logo { position: absolute; padding-bottom:50 px; height: 150%; width: auto; } </style> </head> <body>

python bottle zombie process -

when developing bottle webapp python 3.5, regularly zombie process. when using auto-restart development mode. windows console still updates access logs, , errors, program isn't running in foreground anymore, can't access use ctrl+c. way kill open task manager , end process manually. if don't kill it, still listening on port, , have precedence on newly started process. haven't found rule when happens, nor have found way reproduce. how can avoid multi-spawned zombie process?

excel - Reattaching Named Ranges in VBA -

i'm trying remove named ranges in excel workbook, store them in collection , after deleting, reattach them workbook. my code looks this sub resetnamedranges() dim rname excel.name dim cname excel.name dim rangednames excel.names dim collnames new collection set rangednames = thisworkbook.names each rname in rangednames collnames.add rname rname.delete next each cname in collnames names.add cname.name, cname.refersto, cname.visible, cname.macrotype, cname.shortcutkey, cname.category, cname.namelocal, cname.referstolocal, cname.categorylocal, cname.referstor1c1, cname.referstor1c1local next end sub but isn't working. quit sure i'm missing something. use dictionary , capture relevant properties such. your collection method fails reasons outlined in comments above: .delete method removes reference name object put in collection. collection full of broken references, , can't restore names

angularjs - How we can merge json object together -

i have first function: $scope.loaddatafromtomonth= function (from,to,year) { // $scope.loaddatafromtomontharrivee(from,to,2016); var url = servername+'admin/dashboard/getincidentdepartbymonthfromto/'+from+'/'+to+'/'+year; // alert(url); function onsuccess(response) { console.log("+++++getincidentdepartbymonthfromto success++++++"); if (response.data.success != false) { $scope.payloadgetincidentdepartbymonthfromto = response.data.data; var getincidentdepartbymonthfromto= $scope.payloadgetincidentdepartbymonthfromto; console.log(json.stringify(getincidentdepartbymonthfromto)); $scope.data = {}; // new object $scope.data.datasets = []; // new array in data object .. $scope.data.labels =[]; var thewholeob={}; var datasetobj = {}; //temp object push dataset array.. var datasetobjtwo = {}; /////////////anomalies depart datasetobj.data = [];

c - Three Delay Pluses -

how make 15ns time delay loop need 3 clock pluses need per image. picture { void adrf6755_lock(void) { unsigned int i; (i=0;i<3;i--) { time_delayns(15); adrf6755_ce_low; } i guess developping embedded system. if software built under operating system such linux, can use standard functions "int nanosleep(const struct timespec *req, struct timespec *rem);" function suspends execution of calling thread until either @ least time specified in *req has elapsed. must include header "time.h". structure "timespec" defined shown below: struct timespec { time_t tv_sec; time_t tv_nsec; } here example of function suspends calling thread 15ns: void delay_15ns() { struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 15; nanosleep(ts, null); }

socket.io - How to enable sticky sessions on a LoopbackJS app running on CloudFoundry/Bluemix -

i have loopbackjs app deployed on ibm bluemix , horizontally scaled across 3 instances. app uses socket.io implement chat system. i'd activate sticky sessions each request coming same client routed same app instance. i know sticky sessions supposed avoided according 12 factors . seems solution in order have socket.io working multiple nodes. as stated here , seems need set jsessionid session cookie in loopback application. i did following in server.js of loopbackjs app: var session = require('express-session'); app.use(session({ secret: 's3cur3', name: 'jsessionid', proxy: true, resave: true, saveuninitialized: true })); after making change, when issue request loopback app, can see 2 cookies set in response headers: set-cookie:__vcap_id__=988ce9aa9b7f49cdb31d04f697d892b6024579565ea443589ed10e7a4c1c05f0; path=/; httponly, jsessionid=s%3adb3ksqgzfkweg39wrlkcsb3awpazcogd.tca1vybvb5dqemjxds%2blxuj207wnc7ugms5bpjzq9xc; path=/; httponly;

reporting services - SSRS parameter to select "future" or "past" dates. (contracts expired or current by expiration date) -

Image
what expression , dataset query structure use add drop-down filter filter contract records date, selecting either "expired", expirationdate < today(), or "current", expirationdate >= today()? one option use parameter along dataset filter. add new parameter report. set available values "expired" , "current". add filter dataset expression check each row. example: =iif(parameters!myparam.value = "expired" , fields!expirationdate.value < today, true, iif(parameters!myparam.value = "current" , fields!expirationdate.value >= today, true, false)) the filter should this:

On tcl tests - how to interpret tcltest::test -

i looking @ tests in tcl source tree , see 1 in compexpr-old.test: test compexpr-old-14.17 {compileprimaryexpr: string primary looks var ref} { expr $ } $ it looks wrong me: test runs script expr $ , expects return value "$". interpretation right? it cannot right because expr $ wrong syntactically. i checked out tcltest.tcl, definition of tcltest::test long, wish can me on here. i don't know version of test suite looking @ (probably 8.4 variant?), when @ whole of test in tcl trunk, see this: test compexpr-old-14.17 {compileprimaryexpr: string primary looks var ref} -body { expr $ } -returncodes error -match glob -result * in case, checking result error , value of result (i.e., content of error message) glob matches * , i.e., (effectively ignoring it). is, test checks error obtained expr $ , otherwise doesn't care. the test posted (which uses older syntax tcltest ) won't pass on modern versions of tcl. in 8.4, did pass; area

Kafka produce or consume msg failed from windows clients to remote Linux servers -

i both download kafka_2.10-0.10.0.1 windows , linux machine(i have cluster has 3 linux machines ,192.168.80.128/129/130).so , use windows machine kafka client , linux machines kafka servers. try produce msg windows remote kafka server, command , response below: f:\kafka_2.10-0.10.0.1\kafka_2.10-0.10.0.1\bin\windows>kafka-console-pr oducer.bat --broker-list 192.168.80.128:9092 --topic wuchang dadfasdf asdfasf [2016-11-08 22:41:30,311] error error when sending message topic wuchang key: null, value: 8 bytes error: (org.apache.kafka.clients.producer.intern als.errorloggingcallback) org.apache.kafka.common.errors.timeoutexception: batch containing 2 record(s) ex pired due timeout while requesting metadata brokers wuchang-0 [2016-11-08 22:41:30,313] error error when sending message topic wuchang key: null, value: 7 bytes error: (org.apache.kafka.clients.producer.intern als.errorloggingcallback) org.apache.kafka.common.errors.timeoutexception: batch containing 2 record(s) ex pired

How to declare a cursor after the begin section of an Oracle PL/SQL procedure -

i new in oracle pl/sql. trying write procedure first data column in table , assign variable. each row/value in result, perform query , loop through result of new query , perform various inserts , updates. after go outer loop , continue sequence. attempt follows: create or replace procedure cmsadmin.proc_rfc_upd_new_mrsp ecode number; emesg varchar2(200); cursor y (select distinct cod_unicom fcode rfc_upd_new_mrsp_pool); begin t in y loop cursor x ( select distinct s.nif premise,a.cod_unicom reading, a.cod_lect_area area sumcon s, lect_areas a.cod_unicom = t.fcode , s.num_sum in (select num_sum rfc_upd_new_mrsp_pool cod_unicom = t.fcode) ); met in x loop /* store record trace*/ insert rfc_upd_new_mrsp(nif, cod_unicom,cod_lect_area, usuario, f_actual, programa) values (met.premise, met.reading, met.area, user, sysdate,'rfc_mr