Posts

Showing posts from June, 2013

How do I install to my Linux laptop a software project hosted on git? -

how install, linux laptop, software project hosted on github? not attempting set project/repository myself. intention download project, in order use/execute it. name of process? how done? if helps, trying install command line interface last pass. instructions seem assist me downloading dependencies. downloading zip file provides folder filed random files. used installers, perhaps missing steps aid understanding. this off-topic stackoverflow, it's not programming. has nothing git, got files github, git has nothing installing it. the first thing should check if software available linux distribution, using system's software management tools. installing there simpler , mean software gets updated automatically in future. if isn't packaged distro, , project don't provide binaries, may need build software yourself. among files cloned github should readme or install file instructions on building , installing it. typically involves running configure script, o

c++11 - C++: error: exception handling disabled, use -fexceptions to enable -

i trying compile simple code -fno-exceptions flag. giving error. please let me know how suppress this. using gcc version 4.6.3 code #include <iostream> using namespace std; int main () { try { throw 20; } catch (int e) { cout << "an exception occurred. exception nr. " << e << '\n'; } return 0; } log > g++ throw.cc -o out -fno-exceptions throw.cc: in function ‘int main()’: throw.cc:10:11: error: exception handling disabled, use -fexceptions enable throw.cc:14:56: error: ‘e’ not declared in scope edit i have client code have lot throws this. have integrate in project , can't control compilation flags build(which come config has -fno-exceptions enabled). wanted quick work around can suggest. edit i found workaround see below answer. you cannot use -fno-exceptions flag program, use exceptions (try/catch/throw). quote gcc manual before detailing library support -fno-exceptions, firs

python - Pycharm unresolved reference issue -

Image
i have strange pycharm behavior. have project , folder in named core (see picture details). in have 2 python files: agentmeasurement.py , collectorbase.py . now, want import type agentmeasurement agentmeasurement.py in collectorbase , write following: from agentmeasurement import agentmeasurement . works fine (when run script), pycharm marks unresolved reference. i tried mark core source root, can't reference other folders package (i.e. from core.agentmeasurement import agentmeasurement ) , can write from agentmeasurement import agentmeasurement makes code unreadable. how can make pycharm work correctly in such case?

java - Does DeferredResult have a race condition when returning a potentially already-set instance? -

i'm using deferredresult in spring mvc application handle server-side processing of potentially long-running action. might very fast, or take second or two. but in either case, incoming http request causes action pushed queue, separate thread (via executorservice ) responsible consuming. callback called, notifying pusher operation has completed. i refactored of behavior utility method: public static deferredresult<string> toresponse(gamemanager gamemanager, final player player, action action) { deferredresult<string> deferredresult = new deferredresult<>(); gamemanager.execute(action, new handler<result>() { @override public void handle(result result) { jsonobject obj; try { obj = gamemanager.getgamejson(player); obj.put("success", result.getresult()); obj.put("message", result.getmessage());

objective c - AUHAL with USB audio device -

i've got usb audio device (presonus audiobox) , want able switch audio output of program between usb device , default output device (the internal speakers). apple documentation tells me have use auhal: if need connect [..] hardware device other default output device, need use auhal. source normally, make device description , if exists. wrote function test this: -(osstatus) showauhaldevices { //show available auhal devices // create description audiocomponentdescription test_desc; test_desc.componenttype = kaudiounittype_output; test_desc.componentsubtype = kaudiounitsubtype_haloutput; test_desc.componentmanufacturer = kaudiounitmanufacturer_apple; test_desc.componentflags = 0; test_desc.componentflagsmask = 0; // determine number of available components uint32 count = audiocomponentcount(&test_desc); // print result osstatus err = noerr; cfstringref compname; audiocomponent test_comp; (uint32 = 0; &l

javascript - angularjs watch for change in scope variable made from another controller -

i have following service function pathfactory() { this.path = null; this.setpath = function(path) { this.path = path; } return this; } my navigation controller: function navcontroller($scope, pathfactory) { list = document.getelementsbytagname("ul"); list = list[0]; var items = list.getelementsbytagname("li"); for(var = 0 ; < items.length ; i++) { items[i].setattribute("navindex", i); items[i].addeventlistener("click", navclick); } function navclick(e) { switch(e.path[1].hash) { case "#home": pathfactory.setpath("home"); break; case "#bots": pathfactory.setpath("bots"); break; case "#servers": pathfactory.setpath("servers"); break; case "#status":

regex - Regexp for parsing a string -

hello have troubles in parsing these strings (num of columns fixed) 9/01 down/down 0/ 0 0/ 0 0/ 0 0/ 0 0%/ 0% 9/01 up/ 33172/100014 65/ 111 -106/ 136 33172/100014 100%/100% the final result should matrix like: 9/01 | down/down | 0/ 0 | 0/ 0 | 0/ 0 | 0/ 0 | 0%/ 0% 9/01 | up/ | 33172/100014 | 65/ 111 | -106/ 136 | 33172/100014 | 100%/100% could me in writing regexp single input line? riccardo edit: temp solution: [^/]+/[\s]*[^\s]+ ahh lot better. @ndn proud of, think. :p ([\w\/%\-\s]+?)(?:\b\s|$) regex101 if want captured in line right away separate capture groups can use this: (\d+\/\d+)\s+(\w+\/\s?\w+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-]+\/\s?[\d-]+)\s+([\d-%]+\/\s?[\d%]+) regex101

javascript - sails:Can't able to get textbox value while submitting a form with enctype="multipart/form-data" -

i'm doing file upload in sails.js facing issue while submitting form enctype="multipart/form-data". my file.ejs <form id="uploadform" enctype="multipart/form-data" action="/employee/upload" method="post"> <input type="file" name="uploadfile" /> <input type="text" name="name" /> <input type="submit" value="submit"/> </form> my controller upload: function (req, res) { var username =req.param("name"); console.log(username); var uploadfile = req.file('uploadfile'); console.log(uploadfile); uploadfile.upload(function onuploadcomplete (err, files) { if (err) return res.servererror(err); console.log(files); res.json({status:200,file:files}); }); } i

python - build a suggestions list using fuzzywuzzy -

i building suggestion engine database. i'm using fuzzywuzzy module match user input string existing database shown below. if request.method == "get": display_dict = {} user_input = request.get["user_input"] # user input match_dict = {} food_items_obj = food_items.objects.all() # fetch objects table items in food_items_obj : match = fuzz.ratio(user_input.lower(),items.name.lower()) # try match user input existing names match_dict[match] = items.name # put 1 dictionary matched_dict = ordereddict(sorted(match_dict.items(),reverse = true)) # sort dictionary if max(matched_dict.keys()) == 100: # if exact match put in dict , return display_dict[100] = matched_dict[100] else : # if not found try best matching words.. ###########this part need help! ############# k,v in matched_dict.items(): if user_input in v : display_dict[k]

php - How to Let Facebook Share Recognise Random Background Image -

my problem is, generating background images per css , php on web site http://goo.gl/vdtmbk this: css: background: url(random_img.php) no-repeat top left fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; background-attachment: fixed; php, random_img.php: header("last-modified: " . gmdate("d, d m y h:i:s") . " gmt"); header("cache-control: no-store, no-cache, must-revalidate"); // http/1.1 header("cache-control: post-check=0, pre-check=0", false); header("pragma: no-cache"); // http/1.0 header("expires: sat, 26 jul 1997 05:00:00 gmt"); // date in past header('content-type: image/jpeg'); $vorresult = glob( "../../uploads/*1500x*.jpg" ); $result = array_diff( $vorresult, glob( "../../uploads/*{person,karte}*.jpg", glob_brace ) ); $seed = floor(time()/120); srand($seed); $random_image = $result[rand(0, count($r

java - Getting NullPointerException while skipping login Activity -

i want skip login activity using shared preferences whenever try implement code java.lang.nullpointerexception error occur. java code of launch or login screen. here have no splash screen. public class mainactivity extends activity { button sub; sharedpreferences prefs; edittext useret,pwdet; string is_login = "isloggedin"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); if(this.isloggedin()==true) { checklogin(); } setcontentview(r.layout.activity_main); useret=(edittext) findviewbyid(r.id.etuser); pwdet=(edittext) findviewbyid(r.id.etpwd); sub=(button) findviewbyid(r.id.submit); sub.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { string username=useret.gettext().tostring(); string password=pwdet.gettext().tostring();

cakephp - Download a file from some parent directory -

i download file located in parent directory of application. i want download file : /mydirectory/myfile.ext application located : /www/app/ i've tried things : $this->html->link('test','../../../mydirectory/myfile.ext') doesn't seem work... is want possible ? thanks create symbolic link in app's webroot directory want allow access files on server:- ln -s source_directory link_directory this provide access directory webroot. you can link files:- echo $this->html->link('test', 'link_directory/myfile.ext');

primefaces - show certain data according to logged in webuser in JSF -

i built dynamic web application jsf 2.0 , primefaces 5.2 (community edition). it's running on ibm websphere v8.5. my web application uses p:datatable populate data. each webuser should see own data , can add records it. webuser's name or id can caught facescontext.getcurrentinstance().getexternalcontext().getremoteuser() . login.xhtml mask forbidden, because of constraints. how , filter different webuser's views? there jsf phaselistener, servletcontextlistener, httpsessionlistener or servletrequestlistener or filters. components should use? i hope can me little bit.

locking - C and pthreads: how can a mutex be referred to a particular variable? -

in this code example of use of mutex showed. in particular, mutex first declared before main : pthread_mutex_t mutexsum; the particular variable "protected" mutex dotstr.sum in global structure dotstr : every thread writes on after having acquired lock . correspondant code is: pthread_mutex_lock (&mutexsum); dotstr.sum += mysum; printf("thread %ld did %d %d: mysum=%f global sum=%f\n",offset,start,end,mysum,dotstr.sum); pthread_mutex_unlock (&mutexsum); i have compiled code , works, don't know mutexes well. so, how can program aware "general" mutex mutexsum applied on dotstr.sum variable? there many other global variables can locked. why there not explicit relation in code between mutex mutexsum , variable want lock, dotstr.sum ? a (pthread) mutex isn't explicitly bound particular variable, it's general locking mechanism. it's make sure every action on variable surrounded locks , unlocks. your program h

regex - Change a particular string in url using htaccess -

i want change url from http://intervideo.2watt.net/component/content/article.html?id=65&itemid=479 to http://intervideo.2watt.net/component/content/article.html?id=65&itemid=332 i have tried following code not working rewriterule ^/?itemid=479/(.*)$ itemid=332/$1 [r=301,l] you cannot capture query string rewriterule . use rewritecond instead: rewritecond %{query_string} ^(id=\d+)&itemid=479$ [nc] rewriterule ^component/content/article\.html$ %{request_uri}?%1&itemid=332 [l,nc,r=302]

python - Django mail_admins vs send_mail -

i can django application report server errors email using obvious settings : debug = false admins = (('name','email'),) managers = (('name','email'),) email_host = 'ip address' email_host_user = 'user' email_port = 25 email_host_password = 'pwd' server_email = 'server-email' yet reason, when try use send_email() returns either authentication errors if try without tls, or "you don't have permission send sender" if use tls. can't understand why error reporting works, , send_email doesn't... uses same settings default. any suggestions ? there 2 settings affect 'from' email address different types of emails. server_email - used sending error emails admins , managers. default_from_email - used sending regular emails it looks if have set server_email , make sure have set default_from_email well.

c# - Most popular items in sitecore per language. -

i'm working sitecore 8 update 2 i'm looking way popular items sitecore analytics per language. so far can popular items, it's per language part proving bit harder. in post explained how popular items: https://sitecorecontextitem.wordpress.com/2014/07/08/most-popular-pages-in-sitecore-again/ however current project website 4 languages, , not every item has version in every language. ( intended! ) sql statement retrieve in 1 single go. if don't want read article here's important line: string query = string.format("select top {0} itemid, count(*) cnt pages datetime > dateadd(day, -{1}, getdate()) group itemid order cnt desc", numberofitems, timespan); note in sitecore 8 names have changed little functionality same. if want test in sitecore 8 query becomes follows: string query = string.format("select top {0} itemid, count(*) cnt fact_pageviews date > dateadd(day, -{1}, getdate()) group itemid order cnt desc", numberofitems,

python - How to read gradle build progress from it's output? -

i execute gradle python subprocess: proc = subprocess.popen(["./gradlew", "assemble", stdout=subprocess.pipe, stderr=subprocess.pipe, ) then run 2 threads read stdout , stderr: class mythread(qtcore.qthread): def run(self): while true: line = self.stream.readline() if line not none , len(line) > 0: // process line else: break i read log correct, can't read output like: > building 53% > :project:assemble i tried replace readline read , not helped. if execute: ./gradlew assemble | hd i not see build progress in hd . is solution read progress?

javascript - Send multiple values to the other page using ajax -

i want delete multiple rows using checkbox. have used ajax unable send multiple values. variable chk sends 1 patient id since 2 check box selected database code: <center> <h1><u>patient details</u></h1> <table border="1" style="font-family:georgia;color:#800000;font-style:bold;"> <tr style="font-family:georgia;color:green;font-style:bold;"> <th>#</th> <th>patient id</th> <th>patient name</th> <th>dob</th> <th>gender</th> <th>address</th> <th>phone no.</th> <th>medicare</th> <th>doctor associated</th> </tr> <form method="post" action="delete.php"> <?php while($row=mysqli_fetch_array($result)) { $r=$row['patientid']; ?> <tr> <td><input type='checkbox' name='checkbox[]' id="checkbox[]&quo

javascript - Error Route Not Found on RestAdapter -

i have route configuration on router.js import ember 'ember'; import config './config/environment'; var router = ember.router.extend({ location: config.locationtype }); router.map(function() { this.route('about'); this.resource('posts'); }); export default router; and inside routes folder have posts.js import ember 'ember'; export default ember.route.extend({ model: function() { return this.store.find('post'); } }); and inside model folder have ember-data model import ds 'ember-data'; export default ds.model.extend({ title: ds.attr() }); and here's adapter import ds 'ember-data'; export default ds.restadapter.reopen({ namespace: 'api' }); however whenever access resource(localhost:4200/posts) receive error error while processing route: posts not found ember$data$lib$adapters$rest$adapter$$default<.ajaxerror@http://localhost:4200/assets/vendor.js:60763:35 em

c - Access struct in Python using SWIG -

do have redefine given struct (given in .c file, included in compilation) in interface file make accessible via python? edit: if defined in header file, have include header file in interface file, right? i think don't have to, except want add member functions c structures. /* file : vector.h */ ... typedef struct { double x,y,z; } vector; // file : vector.i %module mymodule %{ #include "vector.h" %} %include "vector.h" // grab original c header file adding member functions c structures /* file : vector.h */ ... typedef struct { double x,y,z; } vector; // file : vector.i %module mymodule %{ #include "vector.h" %} %extend vector { // attach these functions struct vector vector(double x, double y, double z) { vector *v; v = (vector *) malloc(sizeof(vector)); v->x = x; v->y = y; v->z = z; return v; } ~vector() { free

javascript - Why do developers write these type of scripts for embedding when a simple tag would do? -

i wanted ask question practice have seen quite lot regarding jquery/javascript plugins/widgets written other developers. i maintain number of sites , asked add new scripts various things such chat widgets, marketing tools etc etc code sent majority of these looks this. <script type="text/javascript"> (function() { var hm = document.createelement('script'); hm.type ='text/javascript'; hm.async = true; hm.src = ('++www-widget-org+widget-js').replace(/[+]/g,'/').replace(/-/g,'.'); var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(hm, s); })(); </script> now question why go trouble of writing above script when need this? <script src="//www.widget.org/widget.js" type="text/javascript" async></script> i have seen number of times , beginning wonder benefit of approach is? if there one? according steve souders , method used load

css3 - Add HTML markup to materialize.css tooltip -

is there way add html markup tooltip in materialize? i'm trying arrange data definition list inside tooltip. tried add directly data-tooltip attribute doesn't seem recognize tags. in materialize.js, around line 1258 make following change covert tooltips html. // change .text() newtooltip.children('span').text(origin.attr('data-tooltip')); // .html() newtooltip.children('span').html(origin.attr('data-tooltip'));

javascript - Whats the proper way to iterate through an object? -

i've used for( x in object ){} but came accros for( var x in object){} i know var matters in regular for( var i=0;i<10;i++){} statements, bit me once in recursive function, matter when using x in?... re var part: does matter when using x in? yes . always matters declare variables. if don't, , you're using loose mode, fall prey the horror of implicit globals . (in strict mode, it's nice detectable error. use strict mode.) bite in recursive function, , in of large number of other non-recursive situations. you don't have declare within for construct, make sure declare somewhere. re "whats proper way iterate through object?" : there several proper ways. like mathletics , i'm partial using object.keys(...).foreach(...) : var obj = { a: "ay", b: "bee", c: "see" }; object.keys(obj).foreach(function(key) { snippet.log(key + ": " + obj[key]); }); <

excel - VBA Code not working Universally -

i'm trying write universal code can esentially can copy , paste of reports (they're identical reports, need run every day). it's formatting , deleting report of uncessary data. when wrote code worked when paste workbook runs ok. still format , assign special values things won't delete values don't want! know why is? here's code (mind might not efficient method of coding, i'm mere novice :) ) sub newfilter() dim wbi workbook, wb0 workbook dim wsi worksheet, ws0 worksheet dim myrange range dim outputrange range, endorange dim nfrange range dim long, j long 'establish source of info worbooks , worksheet set wbi = thisworkbook set wsi = wbi.sheets("sheet1") 'filters original wb criteria 'selection.autofilter activesheet.range("a1").autofilter field:=5, criteria1:=array( _ "gur insurance plan 1", "gur insurance plan 2", "gur insurance plan 3", _ "gur insurance plan 4", &

excel vba - Check if an Add-in is installed and running VBA -

Image
i trying check if add-in installed , running. using piece of code: on error resume next: set solvernome1 = addins("solver add-in") 'solver may have 2 different names set solvernome2 = addins("solver") msgbox isempty(solvernome1) msgbox isempty(solvernome2) if isempty(solvernome1) , isempty(solvernome2) msgbox "install solver add-in before trying install add-in.", vbexclamation application.myaddinname.installed = false 'uninstall add-in end if the problem solver uninstalled still isempty(solvernome1) = false condition clause doesn't work desired. guess there misunderstanding concept of installed or not. piece of code should using check if solver running? answering on question: necessary access .installed property this: myboolean1 = solvernome1.installed 'will return false because add-in set , not installed myboolean2 = solvernome1.installed 'won't return because add-in not set

c# - WPF mvvm messenger destructor -

i have mainwindow thath holds <contentcontrol ... content="{binding currentviewmodel}" in mainviewmodel switching between 2 view firstview , secondview . firstview contains usercontrol contentfirstview implementing async data sending contentsecondviewmodel . data send's time delay 1000ms. main question why when clicking on 1,2,1,2,1,2 buttons speed of updating label count in contentsecondview increasing? think contentsecondviewmodel not disposing , every time when clicking on button 2, creates new object of messenger.register ... mainmodel.xaml: <grid> <grid.columndefinitions> <columndefinition></columndefinition> <columndefinition></columndefinition> </grid.columndefinitions> <contentcontrol grid.column="1" content="{binding currentviewmodel}" horizontalalignment="stretch" verticalalignment="stretch"/> <button content="1"

invalid literal for int() with base 10: 'pk' Python/Django -

i'm working on project in django , added field 1 of models saves user created it. set default value of 'none'. now, whenever try migrate value error saying "invalid literal int() base 10: 'pk'". here's model looks like: class samplemodel(models.model): created_by = models.foreignkey(user, default=none) # other fields here and here's traceback when try run python manage.py migrate : operations perform: synchronize unmigrated apps: staticfiles, messages apply migrations: admin, contenttypes, posts, auth, sessions synchronizing apps without migrations: creating tables... running deferred sql... installing custom sql... running migrations: rendering model states... done applying posts.0002_post_created_by...traceback (most recent call last): file "manage.py", line 10, in <module> execute_from_command_line(sys.argv) file "/library/python/2.7/site-packages/django/core/management/__init__.py&qu

xml - Wix install : Append new data to files instead of replacing -

our application has user modifiable files(xml files). during upgrade not want files replaced. have marked these files/components neveroverwrite = yes using xslt , heat command. now instead of not replacing these files, need append new data well. best way achieve ? thanks. well, if files installed msi package customized end user, not replaced. thats default windows installer behaviour unless behaviour over-ridden making use of reinstallmode property. also, circumstances under user customized file not cleaned during upgrade depends on standard action:removeexistingproducts has been sequenced. take at: http://blogs.msdn.com/b/astebner/archive/2005/08/30/458295.aspx to better understanding of windows installer replacement logic non versioned files. the various locations removeexistingproducts , effect on installation can found at: http://blogs.msdn.com/b/heaths/archive/2010/04/09/major-upgrades-with-shared-components.aspx to answer question, have explored follo

swing - Java -How to implement code into GUI made in Netbeans gui builder? -

Image
i made gui using netbeans gui builder , looks great! however, i've got no idea how go implementing code change values inside of gui. my program connects database , pulls information such sex, room number, bed number, name , referral source each individual patient. purpose of gui represent changes information every often, want automatically sync database every 60 seconds or so. can write code database sync , i've made gui. question how update information displayed in gui made in netbeans? public class connectmssqlserver { static int bedcount; public static int getbedcount(){ return bedcount; } public void setbedcount(int number){ bedcount = number; } public void dbconnect(string db_connect_string, string db_userid, string db_password) { try { class.forname("com.microsoft.sqlserver.jdbc.sqlserverdriver"); connection conn = drivermanager.getconnection(db_connect_string, db_userid, db_password); system.out.println(&qu

javascript - RequireJS not loading Firebase, undefined -

i'm trying make simple firebase application using requirejs , failing pull in firebase reason. created basic example shows problem. project structure this: /index.html /js/main.js /js/vendor/firebase.js /js/vendor/require.js /js/vendor/jquery.min.js index.html includes: <script src='js/vendor/require.js' data-main="js/main"></script> main.js: require.config({ paths: { 'jquery': "vendor/jquery.min", 'firebase': "vendor/firebase" } }); require(["firebase", "jquery"], function (firebase, $) { "use strict"; console.log(firebase); // undefined console.log($); // function m(a, b) }); why jquery load fine firebase not? figured out. firebase not support amd default, need add shim in require.js config: main.js: require.config({ paths: { 'jquery': "vendor/jquery.min", 'fire

c# - Bind Grid width to ParentGrid.Width - ParentGridBorder.BorderThickness -

Image
i started wpf, please bear me on simple mistakes. as title states, want bind grid's width innerwidth of parentgrid. code example (very stripped down): <grid name="parentgrid" width="300"> <border name="parentgridborder thickness="2" width="{binding width, elementname=parentgrid}" /> <grid name="childgrid" width="{**? parentwidth - parentborderthickness ?**}"> .... </grid> </grid> i'm using visual studio 2012, wpf, , c# code-behind (i assume pretty standard setup). appreciated. addendum: poor , misguided approach due newbishness towards wpf. selected answer pointed out sizing issues trying create workarounds for. i recommend ignore grid.border idea , instead add margin second grid. unless require border other reason, way go. <grid name="parentgrid" width="300"> <grid name="childgrid" margin="1

Python Socket programming: Post sentence - Info not reaching to web server? -

so got web-server , can display info next code #!/usr/bin/env python import socket import sys host = 'www.inf.utfsm.cl' = '/~mvaras/tarea1.php' ua = 'tarea1' port = 80 try: sock = socket.socket(socket.af_inet, socket.sock_stream) except socket.error, msg: sys.stderr.write("[error] %s\n" % msg[1]) sys.exit(1) try: sock.connect((host, port)) except socket.error, msg: sys.stderr.write("[error] %s\n" % msg[1]) sys.exit(2) sock.send("get %s http/1.1\r\nhost: %s\r\n\r\nuser-agent: %s\r\n\r\n" % (get, host, ua)) sock.send("post alexis ahumada 17536441-2http/1.1\r\n\r\nuser-agent: tarea1\r\n\r\n") data = sock.recv(1024) string = "" while len(data): string = string + data data = sock.recv(1024) sock.close() print string sys.exit(0) but thing info send (alexis ahumada 17536441-2) never writes on server log (www.inf.utfsm.cl/~mvaras/tarea1.log) i'd want know i'm doing wrong. appreci

Convert SVG/CSS to SVG/SMIL -

i have spinner: http://codepen.io/fezvrasta/pen/pjxovm i’d convert smil… have never used first attempt , logically doesn’t work: <svg width="65px" height="65px" viewbox="0 0 66 66" xmlns="http://www.w3.org/2000/svg"> <animatetransform attributename="transform" type="rotate" values="0;270" begin="0s" dur="1.4s" fill="freeze" repeatcount="indefinite"/> <circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"> <animatetransform attributename="transform" type="stroke-dashoffset" values="187;46.75;187" begin="0s" dur="1.4s" fill="freeze" repeatcount="indefinite"/> <animatetransform attributename="transform" type="stroke" values="#4285

ColdFusion CFLayout does not wotk with cfif? -

i'm trying seems both of included templates being shown on page. it's cfif cfelse being ignored: <cflayout type="tab" name="grouptab" width="910" height="560"> <cflayoutarea name="issuestab" selected="#isselected#" title="softwareissues" style="height:100%"> <br> <cfif isdefined("url.item")> <cfinclude template ="addnew.cfm> <cfelse> <cfinclude template="issues.cfm"> </cfif> </cflayoutarea> </cflayout> can't cflayout? i'm working within scope of iframe. if cflayout not allow using cfif cfelse there work around? ifelse condition working cflayout you have forgot " @ end of file name your <cfinclude template ="addnew.cfm> correct 1 <cfinclude template ="addnew.cfm">

sql server - SQL Function to assign areacode to phone number -

is possible create function assigns phone areacode(+44) mobile number depending on value of country field. you can steal list of country codes/country abbr here https://countrycode.org/ , assign country id's them using identity column. create new table using data. looks like: country | country_code | country_id then, suspect, have table like: | phone_number | country | country_id make changes existing table add country_id, improve performance: alter table existing_table add country_id int; update e set e. country id = n.country_id existing_table e join new_table n on e.country = n.country you need sql put (not function): select e.something, format(concat(n.country_code,' ', e.phone_number), '###-##-####') completephone existing_table e join new_table n on e.country_id = n.country_id

.net - Get the Node URl from the Umbraco (4.7) Database -

i have batch loads information umbraco (4.7) database. i need extract link document node property... the api in site umbraco.library.niceurl(nodeid) ... have 1 console application not have acces umbraco stuff... 1) can find "nice url" of node in database? 2) if not (or complex), how possible configure umbraco api (4.7) library console application? select cast([xml] xml).query('data(//@urlname[1])').value('.', 'varchar(20)') path cmscontentxml nodeid = 19802 my 2 cents worth

How to access remotely MS SQL Server on linux ubuntu 14.04 -

how access ms sql server ubuntu 14.04. tried using freetds failed understand process , first time learning sqlmap. have tried read several hours in vain. give me clue way proceed. have ip address of database don't know how can read it. dbvisualizer ( https://www.dbvis.com ) should work you. cross platform, easy use , can connect kind of database. you'll need ip address, port, username , password, create new connection , provide connection details. can see tables , run sql against them (you're gonnna need learn sql if don't know it). it know trying migrate. im assuming ubuntu server data is, haven't said platform using or format trying data in. trying clone entire database local mysql process?

Different history depending on where git log is called -

i'm attempting view history of directory in git repo. i'm seeing 2 different histories depending on directory call git log. case 1 (from root of repo): $ git log path/to/files returns 1 commit case 2 (from sub directory): $ cd path/to/files $ git log . returns 13 commits, last commit displayed (earliest commit) same case 1. shouldn't 2 cases return same history? i've tried "--" , "--follow" in case 1 no effect. they different. git log . lists log, git log path/to/files restricts log output changes pertinent files: [\--] <path>… show commits enough explain how files match specified paths came be. see history simplification below details , other simplification modes. paths may need prefixed ‘`-- '’ separate them options or revision range, when confusion arises. see https://git-scm.com/docs/git-log

scala - How to define and use a User-Defined Aggregate Function in Spark SQL? -

i know how write udf in spark sql: def belowthreshold(power: int): boolean = { return power < -40 } sqlcontext.udf.register("belowthreshold", belowthreshold _) can similar define aggregate function? how done? for context, want run following sql query: val aggdf = sqlcontext.sql("""select span, belowthreshold(opticalreceivepower), timestamp ifdf opticalreceivepower not null group span, timestamp order span""") it should return like row(span1, false, t0) i want aggregate function tell me if there's values opticalreceivepower in groups defined span , timestamp below threshold. need write udaf differently udf pasted above? supported methods spark 2.0+ (optionally 1.6+ different api): it possible use aggregators on typed datasets : import org.apache.s

java - Byteman - trace all classes and methods in a given package -

when using byteman, have specify class , method in rule syntax. if want trace program execution using byteman? example: not know methods being executed when executing feature of program. want identify called methods during feature execution. does mean i've add rule each method of each class in given package? or there other way achieve this? yes, need rule every method want trace (although there easy way -- see below). byteman deliberately avoids use of wildcard patterns class , method injecting into. that's because using these sort of rules slow jvm down enormously. why? well, every time class loaded byteman gets asked "do want transform class injecting code it?". currently, byteman indexes loaded rules classname. so, answering question involves hash table lookup (well, actually, 2 -- 1 bare name , package qualified name). means no answers (which right answer) super-quick. if byteman allow patterns classname not rely on simple hash lookup. if, e

Android studio cannot resolve ActionBarActivity -

i have tried invalidating caches , restarting still shows , not compile , run used before. tried renaming class file if remember correctly , must have changed name on made how up. gives me same error findviewbyid, .oncreate, , setcontentview. migh have renamed or tried rename 1 of packages because examplecom , wouldnt allow me upload it. package com.threedeestone.mike.threedeestone; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.widget.edittext; import android.view.view; import android.widget.button; import android.widget.textview; import java.text.decimalformat; public class mainactivity extends actionbaractivity { to use actionbaractivity or appcompatactivity have add appcompat library dependencies. add in build.gradle file last version: dependencies { ... compile "com.android.support:appcompat-v7:23.0.0" } the version 23.0.0 requires compile project api 23. otherwise can use 22.2.1. also pay

java - Caught exception evaluating: h.advertiseHeaders(response) -

i'm getting following error in jenkins: aug 18, 2015 3:34:06 pm hudson.expressionfactory2$jexlexpression evaluate warning: caught exception evaluating: h.advertiseheaders(response) in /adjuncts/2804cc2f/lib/layout/breadcrumbs.js. reason: java.lang.nullpointerexception java.lang.nullpointerexception @ hudson.functions.advertiseheaders(functions.java:1848) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.apache.commons.jexl.util.introspection.uberspectimpl$velmethodimpl.invoke(uberspectimpl.java:258) @ org.apache.commons.jexl.parser.astmethod.execute(astmethod.java:104) @ org.apache.commons.jexl.parser.astreference.execute(astreference.java:83) @ org.apache.commons.jexl.par

c - A program to search for an element in a linked list of characters (insert characters using random number generator) using recursion -

can 1 please me how implement this?? unable create logic this. how insert random characters , how search recursively through it? have done till now... #include<stdio.h> #include<conio.h> #include<alloc.h> //------------------------------------------------- struct node { char data; struct node *next; }*start=null; //------------------------------------------------------------ void create() { char ch; { struct node *new_node,*current; new_node=(struct node *)malloc(sizeof(struct node)); /*i want random characters inserted here*/ new_node->next=null; if(start==null) { start=new_node; current=new_node; } else { current->next=new_node; current=new_node; } printf("ndo want creat : "); ch=getche(); }while(ch!='n'); } void main() { create(); display(); } t

javascript - Adding pop-open JS slider to a menu list - link not working -

i have hamburger icon triggers pop-out js window - , want add list menu. code works: <div class="header-top-first clearfix"> <ul class="social-links clearfix hidden-xs"> <li><img src="../_img/icon_hamburger.png" class="nav-toggler toggle-slide-left"></li> <li class="twitter"><a target="_blank" href="http://www.twitter.com"><i class="fa fa-twitter"></i></a></li> <li class="facebook"><a target="_blank" href="http://www.facebook.com"><i class="fa fa-facebook"></i></a></li> <li class="linkedin"><a target="_blank" href="http://www.linkedin.com"><i class="fa fa-linkedin"></i></a></li> </ul> but want hamburger not ima

css - Divs overlapping - push one up and the other down? -

i have "hamburger" mobile navigation button when clicked brings div titled #navigation. however, due div positioned (it in other divs) div not extend 100% of width of document, 100% of width of container div. not problem there secondary issue because navigation div overlaps both header div , div below it. i'd rather push header , div below down. whilst take div out of container , possibly fix problems placing elsewhere, causes problems navigation on full size version of page #navigation div same both versions of page, different styling. here's code. body { margin: 0; line-height: 1.428; } .wrap { width: 90%; max-width: 71.5em; margin: 0 auto; padding: 0.625em 0.625em; } #header { background: #442869; padding-top: 1em; padding-bottom: 1em; min-height: 6em; } #mobile-navigation-btn { display: none; float: right; } #navigation { display: block; float: right; } #navigation ul { list-style: none; }