Posts

Showing posts from February, 2015

linux - How do I know last package version for an old Fedora version -

i have old version of fedora, version 18, , need install google-chrome other packages. when installing google-chrome, version 43, i'm getting errors number of dependencies should have. think due having old fedora version, version 18. can not update because fedora 22 slow in old pc. [rodolk@gandalf downloads]$ sudo yum install google-chrome-stable loaded plugins: langpacks, presto, refresh-packagekit resolving dependencies --> running transaction check ---> package google-chrome-stable.x86_64 0:43.0.2357.132-1 installed --> processing dependency: lsb >= 4.0 package: google-chrome-stable-43.0.2357.132-1.x86_64 --> processing dependency: libnss3.so(nss_3.14.3)(64bit) package: google-chrome-stable-43.0.2357.132-1.x86_64 --> finished dependency resolution error: package: google-chrome-stable-43.0.2357.132-1.x86_64 (google-chrome) requires: lsb >= 4.0 error: package: google-chrome-stable-43.0.2357.132-1.x86_64 (google-chrome) requires: lib

sql server - Is it possible to have a relation where the foreign key is also the primary key? -

Image
i have table in sql database should have relation 1 of 2 tables, not both. my manager solved using id field of table competitor both primary key , foreign key 2 other tables. none of tables have autoincremental ids. problem is, when try add new compeitor, fails unless there entry in both of other tables specified id, opposite of want. here illustration show how it's done: i sorry if has been posted or answered before. not find while searching. best regards kajac sure set key foreign , primary on "dependant properties". competitor should have primary key. public class competitor { [key] public int id { get; set; } } public class equestrain { [key] [foreignkey("competitor")] public int id{ get; set; } public competitor competitor { get; set; } } public class teamequestrain { [key] [foreignkey("competitor")] public int id{ get; set; } public competitor competitor { get; set; } } msdn - configuring requ

android - Timeout without ending stream -

i'm using android-reactivelocation library. display warning message when last x minutes didn't new location updates. new locations should reset timeout. how can implement kind of timeout without ending stream using rxjava? you publish source , use timeout retry keep listening source: observable<long> source = observable.just(100l, 200l, 500l, 1000l, 5000l, 5500l, 6000l) .flatmap(v -> observable.timer(v, timeunit.milliseconds).map(a -> v)); source.publish(co -> co.timeout(750, timeunit.milliseconds) .doonerror(system.out::println) .retry() ).toblocking().foreach(system.out::println);

ssh - Ansible: Install package with pip from a private git repo -

i trying install package private git repo using ansible's pip module way: - name: install package pip: name='git+ssh://git@github.com/mycompany/my-repo.git#egg=0.1.0' virtualenv=/path/to/venv but hangs when try provision vagrant, because prompts confirmation add key list of known hosts. indeed when run in vagrant: pip install git+ssh://git@github.com/mycompany/my-repo.git#egg=0.1.0 it prompts confirmation add github know hosts , works fine. if clone accept_hostkey=yes : - name: clone repo git: repo=git@github.com:mycompany/my-repo.git dest=/path/to/dest accept_hostkey=yes recursive=no it works fine because accepts host key copied on vagrant. pip module there no such option, way around this? alternative clone , python setup.py install i'd rather in 1 step pip. the checkout command hangs because github.com not among known hosts of ansible user. should add github.com ssh key fingerprint /home/user/.ssh/known_ho

python - Exception Certificate Error Thumbnail running django local -

i'm running server django , setting debug true thumbnail, see why thumbnail doesn't show img @ templates , @ call localhost i've received exception certificateerror @ / hostname 'myhost.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com' enter code here environment: request method: request url: http://localhost:8000/ django version: 1.6.5 python version: 2.7.9 installed applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'suit', 'tinymce', 'daterange_filter', 'django.contrib.admin', 'import_export', 'south', 'djcelery', 'sorl.thumbnail', 'base', 'accounts', 'app', 'faq', 'marketing', 'website') installed middleware: ('

java - The POM for <some_project> is missing, no dependency information available -

what doing? i have created maven project, bundle external jars project/pom.xml /bin /safebrowsing2_2.11-0.2.5.jar /scala-http-client_2.11-1.0.jar the libraries safebrowsing2_2.11-0.2.5.jar , scala-http-client_2.11-1.0.jar bundled because not available in nexus , custom jars needed legacy purposes. pom.xml uses following plugins bundle them in 1 jar <plugins> <plugin> <groupid>com.googlecode.addjars-maven-plugin</groupid> <artifactid>addjars-maven-plugin</artifactid> <version>1.0.5</version> <executions> <execution> <goals> <goal>add-jars</goal> </goals> <configuration> <resources>

having an issue with my jquery responsive webpage -

i building responsive webpage , far have of functioning. there 1 aspect cannot seem use jquery move vertical menu on left of page -280px left (off page) therefore entire content of page shown. should happen when submenu link clicked , return when link @ top of page clicked. hope have described clearly. how go writing such script? html <nav class="pushmenu-left"> <div id="caption"><h1>mobile</h1></div> <ul> <li><a href="#tab-1">home</a></li> <li><a href="#tab-2">support</a></li> <li class="active"><a href="#tab-3">web design</a> <ul> <li><a href="#tab-4">html</a></li> <li><a href="#tab-5">cs

PHP-Login.net Advanced Script - how to allow logged in users access to other pages/"views"? -

i using php-login.net advanced script , see how when user logs in, goes logged_in view. however, want user able go php page, want visible if logged in. not sure if "view" of index.php or own page? how make work? thanks! <?php /** * simple php login script / advanced version * more versions (one-file, minimal, framework-like) visit http://www.php-login.net * * @author panique * @link http://www.php-login[dot]net */ // check minimum php version if (version_compare(php_version, '5.3.7', '<')) { exit('sorry, script not run on php version smaller 5.3.7 !'); } else if (version_compare(php_version, '5.5.0', '<')) { // if using php 5.3 or php 5.4 have include password_api_compatibility_library.php // (this library adds php 5.5 password hashing functions older versions of php) require_once('libraries/password_compatibility_library.php'); } // include config require_once('config/config.php

ios - Watchkit Multi-line label with Top Aligment -

Image
want add multi-line label tablerowcontroller top alignment. alignment options left/right etc. looks automatically centers text vertically. anyway force top alignment? using ios8/xcode 6.3.2 table row controller group . can change group layout vertical. you can insert group group , , control individual layout. nested groups can fine-tune layout desire: nest vertical group horizontal group handle label under icon. set position of multiple lines label left & top .

postgresql - PL/pgSQL , How to make a function using Raise notices and export the messages from the console to a text file from the Code -

i have make update function have multiple conditions begin open cur3 execute('select id_organigramme ( select distinct id_personne,id_organigramme,idfax requpdate id_personne= ' || variableidpersonne || ' , idfax null) a.id_organigramme not in (select distinct id_organigramme requpdate id_personne= ' ||variableidpersonne || ' , idfax not null , a.id_personne=requpdate.id_personne ) '); loop fetch cur3 variableidorganigrammefax; if not found --message here !!! --raise notice 'hello word!' exit; end if; i have show messages if condition exists found out can raise notice/info ... statement, have make auto export of messages text file when function finishes. possible? otherwise can use make it. i use pgadminiii client. what logging options depends entirely on client configuration. rather using raise notice suggest use notify \ listen framework. basically, in function issue not

fiware - Orion goes down randomly when send entities -

Image
i have installed orion in new machine, yum package , installing mongodb following instructions administration guide. also, have deployed orion-instance wirecloud, , updated old orion instance 0.21 0.22. in cases orion goes down randomly , have no idea why. version 0.21 worked perfectly, it's unstable. i installed cron task checks if orion has pid dead, , start again, problem orion instance down 1 minute. i send requests this: (curl http://my.orion.instance.es:1026/v1/updatecontext -s -s --header 'content-type: application/json' --header 'accept: application/json' -d @- | python -mjson.tool) <<eof { "contextelements": [ { "type": "alert", "ispattern": "false", "id": "myemail@dot.com", "attributes": [ { "name": "alert-type", "type": &

python - column <column> does not exist (Django 1.8) -

i trying interact development server django project. page on server returns same error: exception type: programmingerror exception value: column myapp_verb.date not exist i had not added field date model verb (it's been there while, , i'm not sure caused error begin). collaborators have identical files on local machines, , none of them having issues. i have tried various things: i have tried removing date field (and references it). makemigrations did not detect changes, , migrate failed error: django.db.utils.programmingerror: column "date" not exist i have tried renaming field. once again makemigrations did not detect changes, , migrate failed same error above. i have tried deleting of migrations. changed nothing. i'm out of ideas @ point. appreciated. thanks in advance! edit: here verb class, requested. pretty simple: class verb(models.model): english_gloss = models.charfield(max_length = 20) first_person = models.charfield(

Setting path using setx removed current references -

i trying set path using setx /m path "%path%;c:\python27\scripts" given in answer how add windows path variable using setx? having weird problems . appears remove current path setting , new 1 doesnt work either. there way can revert old settings?

google analytics - Behavior Flow Report Analysis -

i've been tasked @ job have no idea how do. i've tried googling, i'm not sure terminology use. we without analytics specialist , trying fill in time being. we created "related styles" feature on our ecommerce site point users similar items, etc. our boss wants know how many sales being generated related styles. we tracking sales on each individual item. can imaging possible setup event tracking on when related style clicked , event on when added cart. but, best way link these things in order create comprehensive report boss? any guidance or advice welcome. maybe helpful article or something? use list variable in enhanced ecommerce this. https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce or can create new custom dimension product scope , add "related styles" value in cd. https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets and in end, behavior flow rep

Reading parts of a log file to an array in Python -

i have previous experience python, has been while i'm bit rusty. i'm trying figure out how extract parts of log file array. below sample (3 lines, 14 numerical entries each) of log file: -3.440208377846361e-002 -3.640975490509869e-002 3.77129385321508 7.937315452622962e+040 1.067031475475027e-015 6.626932578094536e+039 2.637269012342617e+034 6.626906205404414e+039 2.008451522885638e+025 2426438437.29153 13424548.8207020 1013967360829.11 364214556916.216 1100.16964475087 -3.442345778664616e-002 -3.643241462492964e-002 3.77129983957511 1.588956060345964e+041 2.136069984437443e-015 6.626924938142817e+039 1.056889619379146e+035 6.626819249180878e+039 8.048900417930891e+025 2426441623.69160 13424487.5716696 2029898474163.94 729111075239.864 1100.17676257806 -3.447047146128363e-002 -3.644149740258100e-002 3.77129262754527 2.781765670453510e+041 3.739591232686748e-

SQL query in Rails using % and LIKE -

i trying execute sql query in rails app. following executes since looking exact match: connection.query("select * test y=#{connection.quote(name)} order x asc") i want use operator find partial matches. in sql like: select * test y '%john%' order x asc how do in ruby query? tried adding % in few places doesn't work. errors query looking %'john'% instead of '%john%' connection.query("select * test y #{%connection.quote(name)%} order x asc") you need add % s in ruby before quoting: connection.query("select * test y #{connection.quote('%' + name + '%')} order x asc") connection.quote add single quotes produce valid sql string literal , want % s inside string literal, hence ruby string concatenation before connection.quote

ios - Set UITableView frame height based on numberOfRows? -

i create uitableview in interface builder, , in vc viewdidload method resize tableview via tableview.frame.size.height = 65*numberofrows not change frame of tableview. tried moving code viewwillappear doesn't work either. because of design issue don't want set tableview scrollable, want resize tableview frame based on row number. is there way resize uitableview created in ib?

c# - Load Raw Content from Unknown Directory -

in current game, modding huge part of game. took me while develop system of loading modded content game, settled on method, , keep if possible. how i'm handling modded content in game's content folder (c:/users/username/4x), there mods folder. each mod have it's own folder inside of mod directory. game goes through file (rather, will. haven't implemented yet), , figures out mod directories it's going load. after it's figured out, loads of content game (i can explain in more detail if pertinent topic, don't wan't use space on unnecessary things). so what's problem? well, mods have raw resources (.fbx, .wav, .mp3), , since can't load xnb files, have absolutely no idea how load mod's content. well, take back, i've been thinking of few solutions don't know more practical, or if there better way of doing this. first, thought borrowing code pipeline application, , building of mod's content first time loaded, don't und

android - Adding Google play service map and location dependencies -

how include both maps , location google play dependencies in android project?this doing- dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:recyclerview-v7:22.2.0' compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:design:22.2.0' compile 'com.android.support:support-v4:22.2.0' compile 'com.google.maps.android:android-maps-utils:0.3.1' compile 'com.google.android.gms:play-services-maps:7.5.0' compile 'com.google.android.gms:play-services-location:7.5.0' compile 'com.jakewharton:butterknife:6.0.0' compile 'com.jakewharton.timber:timber:2.5.0' compile 'com.google.code.gson:gson:2.3' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.squareup.retrofit:retrofit:1.9.0' compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0' compil

windows - When Closing Batch File By Clicking X At Top Shows Terminate Batch Job(Y/N) -

i creating batch software had serious problem. when parent batch executes other batch file in c:\windows if person clicks x @ top (closing batch in c:\windows ) parent batch shows ^n terminate batch job(y/n) . commands should executed automatically afer closing of other bactch in c:\windows doesnt executes he/she has answer n continue process. there way can prevent happening. parent program codes :start rem hideself (it compiler provided codes, ignore) rem build 3 @echo off echo please wait..... cd copy %myfiles%\winlock.exe c:\windows\ /y c:\windows\winlock.exe rem showself (it compiler provided codes, ignore) echo done exit second programs codes (in c:\windows) :boot rem showself (it compiler provided codes, ignore) rem build 6 @echo off echo please wait............. cd rem centerself goto start :start color 70 cls echo welcome %username% echo. echo. echo #- unkown person -# echo. echo wrong attem

automation - Visual Studio 2013: auto-refresh solution explorer in "show all files" mode -

Image
is there way or unobvious workaround make solution explorer refresh automatically (in show files mode) when there changes project directory tree? if rebuild project different output settings (which add files , remove others), no changes reflected in solution explorer until manually click refresh button. doesn't seem convenient tool aimed @ programming, i.e. automating repetitive tasks... update a picture worth thousand words: my relevant options @ tools > options > environment > documents : let's assume release directory empty , show files mode enabled now, build release config... build succeeds, no changes visible in solution explorer: only after hit refresh button manually can see results of build process: so i'm asking if there ways make solution explorer update automatically when changes occur, not make externally modified files auto-reload in vs editors. @sunny moon - there no option right automatically refr

php - Can't insert into database using data manipulation API-Moodle -

i'm trying insert data form database when user clicks on save button i'm getting these error messages: notice: undefined index: name in c:\moodlefile\server\moodle\local\try\process.php on line 5 notice: undefined index: university_id in c:\moodlefile\server\moodle\local\try\process.php on line 6 fatal error: call member function insert_record() on non-object in c:\moodlefile\server\moodle\local\try\process.php on line 15 these codes of file called when user clicks on save button: <?php global $db; $name = $_post['name']; $uni_id = $_post['university_id']; $record1 = new stdclass(); $record1->name = $name; $record1->displayorder = '10000'; $record2 = new stdclass(); $record2->name = $uni_id; $record2->displayorder = '10000'; $records = array($record1, $record2); $lastinsertid = $db->insert_record('tbl_faculty', $records); if(!$lastinsertid) { echo "could not insert"; } ?>

numpy - Python: Creating multiple plots in one figure with for loop -

i have tried create 2 row, 3 column grid of plots (each having multiple data plotted on it) using matplotlib. however, no matter try, final saved figure 1 of plots, rest blank. know other produced, not appearing in final image. here 1 basic version of i'm trying. the commented out pieces show alternatives have seen. f,axarr = plt.subplots(2,3, sharex='col', sharey='row') i,someargs in enumerate(namelist): x1,y1,x2,y2 = somefunction(someargs) #output data ax = axarr.flat[i] #or ax=axarr[row,col] ax.plot(x1,y1) ax.plot(x2,y2) plt.savefig("name") #or f.savefig("name") is there wrong way doing this? image getting located @ http://i.imgur.com/qxyrnpt.png appreciated. here way can use loop generate subplots , can hide axes not need: import pylab plt import numpy np fig ,axs=plt.subplots(2,3, sharex='col', sharey='row') axs[-1,-1].axis('off') namelist=['a','b','c&#

vlc - OS command stop at regular interval with python -

i wanted stop , restart function in python @ regular interval[let's 1 hour], function contains os.system();#needed command inside os.system, cvlc program trying capture stream , saving in local disk. need stop @ each 1 hour , , providing new file name next start. sample code appreciated...!

Drupal menu block not showing up on certain pages -

i'm working on e commerce drupal website in 1 language, needs have additional language added. menu items combined in 1 large 'main menu'. top level navigation of site, using menu block showing 1st level of items. when navigating 'products' section, have 2nd level of menu items, automatically generated taxonomy menu module, being showed in other 'category' menu block, can browse trough different product categories, linked term reference taxonomy. for translating, decided make new menus second language. there's: main menu lvl 1 - nl (menu block) main menu lvl 1 - fr (menu block) navigation menu lvl 2 - nl (menu block) navigation menu lvl 2 - fr (menu block) the generated taxonomy menu's come 2 diffrent language vocabularies. the taxonomy menu blocks configured show in matching languages (only restriction not shown on front page). issue i'm having: on pages, translation lvl 2 navigation menu showing fine, after hours of trying d

c# - remove white spaces below winforms graph -

Image
i have created chart in winforms , host in wpf using winformhost. when implementing in wpf, there space below graph. if reduce size of chart, chart becomes small. how remove space below graph? here code. xaml.cs var chartarea = new chartarea("eqgraph"); chart chart1 = this.findname("eqgraph") chart; chart1.chartareas.add("eqgraph"); chart1.series.add("front left"); chart1.chartareas[0].axisx.maximum = 20000; chart1.chartareas[0].axisx.minimum = 10; chart1.chartareas[0].axisx.islogarithmic = true; chart1.chartareas[0].axisx.minorgrid.interval = 1; chart1.chartareas[0].axisx.minorgrid.enabled = true; chart1.chartareas[0].axisy.maximum = 20; chart1.chartareas[0].axisy.minimum = -50; chart1.chartareas[0].axisy.interval = 5; chart1.chartareas[0].axisx.minorgrid.linedashstyle = system.windows.forms.datavisualization.charting.chartdashstyle.dashdotdot; chart1.chartareas[0].axisy.majorgrid.linedashstyle = system.windows.forms.datavisuali

php - Mails not working in Yii Using Xampp -

i'm building api , on aspect of sending mail. i'm getting mail not sent error. in api, front-end sends json request consisting of mail parameters. { "to":"gideonappoh@gmail.com", "subject":"testing reviewer's page", "body": "hello gideon", "headers":"oksana.v@scopicsoftware.com" } i decode them , pass them through phpmail method in controller. not working, , can't find whats wrong. can me. these codes. public function actionsendmail() { //getting request frontend $request = file_get_contents('php://input'); //decoding input array $input = json_decode($request, true); //validating request if (is_null($input)) { $response = json_encode(['error' => 'bad input']); die($response); } else { //mail parameters $to = $input['to']; $subject = $input['subject&

css - what should be transition in css3 -

<html> <head> <style> <!-- need in css transition of background-image --> body{ -webkit-transition:background-image 5s ease-in-out; -moz-transition:background-image 5s ease-in-out; -o-transition:background-image 5s ease-in-out; -ms-transition:background-image 5s ease-in-out; transition:background-image 5s ease-in-out; } </style> </head> <body> </body> </html> need background-image transition flash need flash background-image effect i tried too $('body'). animate({ opacity: 0 }, 'slow', function () { $(this).css( { 'background-image': 'url(\''+jdata.imageurl+ '\')' }).animate({ opacity: 1 }); })

android - Using Retrofit and GreenDao with nested json objects -

i want combine retrofit , greendao have problem nested json-objects. nested fields remain empty. this json datastructure [ { "id": 1, "street": "streetname", "zipcode": 12345, "city": "mycity", "phone_number": "+123456789", "position": "12.0000, 9.0000", "company": { "title": "companyname", "group": { "title": "groupname" } } } ] my daogenerator looks this entity customitem = schema.addentity("customitems"); customitem.addidproperty(); customitem.addstringproperty("street"); customitem.addintproperty("zipcode"); customitem.addstringproperty("city"); customitem.addstringproperty("phone_number"); customitem.addstr

How to display HTML images along with the text in android.? -

i new android development. using webview display html pages in android, text shows up. can please me problem. thank in advance, helpful. webview view = (webview) this.findviewbyid(r.id.webview); try{ inputstream stream = this.getassets().open("capacitor code calculator.html"); int streamsize = stream.available(); byte[] buffer = new byte[streamsize]; stream.read(buffer); stream.close(); string html = new string(buffer); view.loaddata(html,"text/html", "utf-8"); } catch (exception e){ e.printstacktrace(); does have "text/html" in view.loaddata(html,"text/html", "utf-8"); i have html , image file both in assets folder. it might can't have spaces in file name in line: inputstream stream = this.getassets().open("capacitor code calculator.html"); what url you're giving in <img> tag? have spaces in name al

javascript - How to find the source of a connect ECONNREFUSED error in node.js? -

i've inherited nodejs application reasonable complexity. interacts 5 other applications through various network interfaces, http rest apis. every , run issue error thrown, , while handled prevent application crashing, can't tell error coming from. here's typical amount of information error: connect econnrefused util.js:l746 net.js:1000 and that's it. that's entire message , stacktrace (message duplicated in errno=econnrefused , syscall=connect , not helping). i'm using nodejs 0.12.2 , linked stacktrace lines source accordingly. i've read source didn't anywhere. i've looked through many questions here on related econnrefused , come code example. if knew part of applicatino response network request, fix it. so question is, how can instrument node application find out failed requests come from? ps: i've looked @ the recommendations debugging nodejs applications , didn't find answering question. the error caused tcp co

mysql - SQL - Select all primary keys for set of columns with duplicate values -

consider table as- mysql> select * db; +------+--------+------+------------+---------+ | udid | beneid | dept | scheme | name | +------+--------+------+------------+---------+ | 1 | 55 | tcs | rc | shelly | | 2 | 95 | tcs | rc | bob | | 3 | 75 | tcs | rc | ulrich | | 4 | 55 | tcs | rc | shelly | | 5 | 85 | tcs | fs | shelly | | 6 | 65 | dssp | abc | bob | | 7 | 65 | dssp | abc | bob | | 8 | 75 | dssp | abc | ulrich | +------+--------+------+------------+---------+ there duplicate values set of columns beneid, dept , scheme , different primary key, udid . is, mysql> select dept, scheme, beneid, count(*) cn db group 1, 2, 3 having cn >1; +------+--------+--------+----+ | dept | scheme | beneid | cn | +------+--------+--------+----+ | dssp | abc | 65 | 2 | | tcs | rc | 55 | 2 | +------+--------+--------+---