Posts

Showing posts from July, 2015

css - Floats affecting other divs? -

i have webpage made here: http://jsfiddle.net/km9hj/ <!doctype html /> <head> <title>home</title> <link href="stylesheet.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="logo"> <img style="width:50; height:50; float:left;" src="content/portal%20layered.png"/> <img style="width:50; height:50; position:relative; left:-50px; z-index:2;" src="content/blank.png"/> <div><h2 id="headerh2">cody shearer</h2></div> </div> <div id="wrapper"> <div style="background-color:#565656"> <div id="links"><a href="home.htm" class="home" id="link">home</a></div> <div id="links"><a href="about%20me.htm" class="aboutme"

archlinux - Cannot get Arch Linux to boot in VirtualBox 5.0 using UEFI -

Image
i have been trying setup arch linux on virtualbox5. after installing, can run reboot command , system reboot fine. if shut system down, system reboot, have hit f12 choose boot manager choose efi hard drive , , boot esp partition. below hard drive printout: also below location of bootx64.efi i use following script install it: https://raw.githubusercontent.com/sittim/configs/master/arch_i i have posted question here: https://bbs.archlinux.org/viewtopic.php?id=211475 . here sequence of startup when f12 pressed: https://raw.githubusercontent.com/sittim/configs/master/arch-2016-04-19t03-26-11-731417000z.webm changing boot order in virtual box did not work me. had eject iso , worked fine.

C++ linked list/polymorphism not running list function -

i have make class shape subclasses specific shapes find volume. have able construct objects , store them in linked list. testing creating 1 object , wondering why not run function cout commands. appreciated. thanks #include <iostream> #include <array> using namespace std; class shape{ public: friend class my_list; shape(double a=0,double b=0 ,double c=0):width(a),height(b),length(c){ } protected: double width; double height; double length; shape *nextptr; }; class rectangle:public shape { public: rectangle(double a, double b,double c):shape(a,b,c){ area = width * length; }; private: double area; }; class circle:public shape { public: circle(double a):shape(a){ area = (radius*radius)*3.14; } protected: double area; double radius; }; class triangle:public shape { public: triangle(double a, double b,double c):shape(a,b,c){ area = .5*width*length; }; protected: double area;

javascript - How can I read ".on()" method arguments in jQuery? -

i have no idea how bite problem. below 2 examples working great want avoid dry problem. parentelement.on('focusout', '.foo-class', function () { // console.log('hello foo') }); and: parentelement.on('focusout', '.bar-class', function () { // console.log('hello bar') }); i make more universal. have deal 2 classes while parent stays same. assuming first step: parentelement.on('focusout', classvalue, function () { // how display class can call different stuff depending on class value? // console.log('hello ' + classvalue) }); may along these line, refined guardio's solution. fiddle: https://jsfiddle.net/pvorhknv/2/ what doing here element been called handler , accessing attributes. can use element "this" such use. $(document).on('focusout', 'input', callme); function callme(){ console.log('hello ' + $(this).attr('class').split(&#

java - One plus One ADB drives not getting installed -

i not able install adb drivers/oem drivers 1 plus one. i have tried following 3 methods given link , restarted system http://www.technobuzz.net/install-oneplus-one-usb-drivers-windows/ please help i should have posted earlier this bug in opo android lollipop. many devices(not on ) not able connect windows using drivers. fixed in marshmallow. for more details refer: http://www.idigitaltimes.com/downgrade-oneplus-one-cm12-cm11-fix-lollipop-bugs-manual-process-guide-437875

python - write the output of a function to an Excel cell -

i'm trying write output of user defined function cell in excel this works. writes value cell: wb = openpyxl.load_workbook('example.xlsx') sheet = wb.get_sheet_by_name('sheet1') sheet.cell(row=(lastrow+1),column=2).value = random.randint(1,100) wb.save('example.xlsx') but not. cell remains empty: def reader1(): random.randint(1,100) wb = openpyxl.load_workbook('example.xlsx') sheet = wb.get_sheet_by_name('sheet1') sheet.cell(row=(lastrow+1),column=2).value = reader1() wb.save('example.xlsx') i not receive error message in either case. i've tried various ways, cannot work. appreciated, including feedback on formatting of post (my first). thanks you're not returning function, need return value of random.randint have column update it's value. default function returns none def reader1(): return random.randint(1,100)

Access Nuget Packages hosted in private Nuget server in Azure Functions -

how can access nuget packages hosted in private nuget server in azure functions?. there way can specify private nuget server info? thanks! krishh, this possible using nuget.config file would: <?xml version="1.0" encoding="utf-8"?> <configuration> <packagesources> <add key="myprivatefeed" value="http://myhost/myfeed" /> ... other feeds ... </packagesources> <activepackagesource> <add key="all" value="(aggregate source)" /> </activepackagesource> </configuration> using kudu, or deployment method outlined here , copy file either function folder or wwwroot (that apply functions) , config used.

php - Woocommerce product api not accept images in some urls -

i creating products external in woocommerce site. code bellow: if($_post["type"] == "create"){ $data = array( 'product' => array( 'title' => $_post["title"], 'type' => 'simple', 'regular_price' => $_post["regular_price"], 'description' => $_post["description"], 'short_description' => $_post["short_description"], 'categories' => array( $_post['categoryname'] ), 'images' => array( array( 'src' => $_post["image_url"], 'position' => 0 ), array( 'src' => $_post["image_url"],

c++ - Ensure safety while using CRTP -

consider following snippet of code making using of crtp #include <iostream> struct alone { alone() { std::cout << "alone constructor called" << std::endl; } int me {10}; }; struct dependant { explicit dependant(const alone& alone) : ref_alone(alone) { std::cout << "dependant called alone's me = " << alone.me << std::endl; } const alone& ref_alone; void print() { std::cout << ref_alone.me << std::endl; } }; template <typename d> struct base { base() { std::cout << "base constructor called" << std::endl; } d* getderived() { return static_cast<d*>(this); } dependant f { getderived()->alone }; void print() { f.print(); } }; struct derived : base <derived> { derived() { std::cout << "derived constructor called " << std::endl; } alone alone {}; void print() { base::print(); }; }

java - How to combine codes from two android studio -

currently trying combine android studio codes , cannot combine , have lots of errors , example imports . there way many errors decide share few . please me out --------> import android.support.design.widget.snackbar; import android.support.v7.widget.appcompatbutton; what snackbar , appcompatbutton . import retrofit2.call; import retrofit2.callback; import retrofit2.retrofit; import retrofit2.converter.gson.gsonconverterfactory; retrofit2 i trying combine code did on wamp server storing datas the l in base_url problem. no top level domain called 1l try numbers: public static final string base_url = "http://127.0.0.1/"; if andrioid code on different machine 'wampmode' server, use different ip. use lan ip of server, ie: type cmd /k ipconfig in run. try ones beginning 192.168. or 10.

mysql - show data from table php oop -

i have error warning show data database have code in folder classes/comment.php <?php class comment { protected $database; public function fetch($table, $rows = '*', $where = null, $order = null) { $result = "select {$rows} {$table}"; if ($where != null) { $result += " {$where}"; } if ($order != null) { $result += " order {$order}"; } return $result; } in index.php wrote: <?php $comment = new comment(); $results = $comment->fetch('', '$tablename', 'id_comment desc'); $comments = array(); while ($comment = mysql_fetch_array($results)) { $comments[] = $comment; } ?> <?php foreach ($comments $comment) : ?> <div class="box-comment"> <div class="content"> <?php echo h($comment['content']) ?> </div> <div class="date-time"> <?php echo $comment['posted_at'] ?> <

Operating Opscenter on amazon EC2 -

i have installed cassandra dse 4.7 on amazonec2 m3.large instance.cassandra working normally, have installed opscenter 5.2 on same node satisfies hardware requirements. after installation tried reach ops-center through web browser. used procedure in link1 . i getting connection timed out.tried using both public , private ip's error image - 2 . do need install datastax agents again link- 3 . do need change configuration settings. but have started datastax agent when started cassandra link- 4 . have create ec2 security group setting in link security , couple of node restarts, helped me connect opscenter.

sql - Break keyword vs Variable in WHILE loop -

we using while loop in sql server 2008 instead of cursor. want find method best write while loop in procedure. method 1 (using break keyword): declare @v_counter int = 1; while (1 = 1) begin print @v_counter; set @v_counter = @v_counter + 1; if @v_counter = 4 begin break; end end method 2 (using bool variable): declare @v_counter int = 1, @v_closeloop tinyint = 1; while (@v_closeloop = 1) begin print @v_counter; set @v_counter = @v_counter + 1; if @v_counter = 4 begin set @v_closeloop = 0; end end my questions are: which method have use or both same? is there other method can use? thanks in advance... which method have use or both same? no, both not same. setting variable 0 still execute lines after that, nothing else in loop executed after break. declare @v_counter int = 1; while (1 = 1) begin print @v_counter; set @v_counter = @v_counter + 1; if @v_counter = 4 be

sql server - How can I a pivoted procedure be called as a sql query? -

i have procedure generates pivot below (see output) based on parameters passed it. i want able insert columns in between years show in expected output add 100 pivoted values in new column. is there way call pivot proc query can add calculations via select query? or there easier way? create table t1 ( date int, unita int, unitb int, unitc int ) insert t1 values (2010, 335, 52, 540) insert t1 values (2011, 384, 70, 556) insert t1 values (2012, 145, 54, 345) select * ( select date, value, unit ( select * t1 ) x unpivot ([value] unit in ([unita], [unitb], [unitc])) u ) pivot ( sum(value) date in ([2010], [2011], [2012]) ) p output: unit 2010 2011 2012 ---------------------- unita 335 384 145 unitb 52 70 54 unitc 540 556 345 expected output: unit 2010 2010a 2011 2011a 2012 ----------------------------------- unita 335 435 384 485 145 unitb 52 150 70 170 54 unitc 540

sql server - Update in multiples rows -

Image
how can write update when have sub query? take look: update people set name = dbo.formatt_name((select name people idinstitute = 12)) idinstitute = 12 i've created function formatt_name(str) returns formatted string. i update names on table using function, knows how can ? i error message: msg 512, level 16, state 1. i know, 1 result set update. but, have no idea how solve this. as per comments, have update records of table peoples belongs institute =12 , add condition name not null . update people set name = dbo.formatt_name(name) idinstitute=12 , name not null edited: from understanding have format names in each record. idinstitute name 12 antony | jhon | cris | peter 12 kevin| jhon | antony | pcris here no need of subquery. find sample function formatted string. create function [dbo].[formatt_name] (@inputstring varchar(max) ) returns varchar(m

javascript - AngularJS - Strategy Design Pattern? -

is there clean way implement strategy design pattern or in angularjs? building dashboard, there different user levels in system. have different dashboards, require different functions , whatnot. what looking swap out controller based on user's access level. have basedashboardctrl common things, using angular.extend() , create respective "extended" dashboard controllers different data , functions. suppose i'll create different partials too, know how that. i'd go route don't fill single controller code, when it's not going needed access levels.

memory - TLB vs Page Table -

the page table associate each virtual page associated physical frame. tlb same except contains subset of page table. what purpose of tlb if page table same thing , has more data? speed. the tlb cache holds (likely) used pages. principles of locality , temporality (sp) pages referenced in tlb used again soon. underlying idea caching. when these pages needed again, takes minimal time find address of page in tlb. page table can enormous, walking find address of needed page can expensive. see https://en.wikipedia.org/wiki/translation_lookaside_buffer

uinavigationcontroller - iOS UIBarButtonItem CustomView -

i made custom view leftbarbuttonitem , not left justified, find uinavigationbarbackindicatorview on debugger not visible, want alignment left uinavigationbarbackindicatorview . uiview *view = [[uiview alloc] initwithframe:cgrectmake(0, 0, 50, 30)]; view.backgroundcolor = [uicolor redcolor]; uibarbuttonitem *leftitem = [[uibarbuttonitem alloc] initwithcustomview:view]; self.navigationitem.leftbarbuttonitem = leftitem; self.navigationitem.rightbarbuttonitem = [[uibarbuttonitem alloc] initwithtitle:@"close" style:uibarbuttonitemstyleplain target:self action:@selector(cancel)]; debuger view: i wish i hope might achieve looking for. uibutton *abtn = [[uibutton alloc]initwithframe:cgrectmake(0, 0, 50, 30)]; abtn.backgroundcolor = [uicolor redco

vba - Copy row to a new sheet - button macro -

i wanting move selected row of data new sheet when button pressed. have below code working, overwrites existing row above last row in destination sheet, insert new row in destination sheet. in advance sub move_row() 'declare variables dim sht1 worksheet dim sht2 worksheet dim sht3 worksheet dim lastrow long 'set variables set sht1 = sheets("incremental opps") set sht2 = sheets("forecast data") 'select entire row selection.entirerow.select 'move row destination sheet & delete source row lastrow = sht2.range("a" & sht2.rows.count).end(xlup).row selection .copy destination:=sht2.range("a" & lastrow - 1) .entirerow.delete end end sub try without new line sub move_row() activecell.entirerow.copy worksheets("forecast data").range("a" & worksheets("forecast data").range("a" & rows.count).end(xlup).row - 1) activecell.entirerow.de

css - Rails Bootstrap glyphicons -

so have been having lot of issues getting bootstraps glyphicons working. have been able them show on site. problem having, following errors in dom: get http://localhost:3000/fonts/glyphicons-halflings-regular.woff2 jquery.self-660adc5….js?body=1:3734 http://localhost:3000/fonts/glyphicons-halflings-regular.woff localhost/:1 http://localhost:3000/fonts/glyphicons-halflings-regular.ttf 404 (not found) localhost/:1 just aware, when select jquery.self-660adc5...js?body=1:3734 taken following line of code: support.inlineblockneedslayout = val = div.offsetwidth === 3; in terminal following: started "/fonts/glyphicons-halflings-regular.woff2" ::1 @ 2016-04-18 21:57:17 -0600 actioncontroller::routingerror (no route matches [get] "/fonts/glyphicons-halflings-regular.woff2") i have bootstrap glyphicon files in vendor/assets/fonts/ glyphicons-halflings-regular.eot glyphicons-halflings-regular.woff glyphicon

css3 - How to prevent CSS code duplication inside media queries? -

i trying develop own grid system. first attempt maybe missing something. here css: .column-1 { width: 6.86666666667%; } .column-2 { width: 15.3333333333%; } // more such columns @media screen , (max-width: 768px) { .column-s-1 { width: 6.86666666667%; } .column-s-2 { width: 15.3333333333%; } } as can see values duplicated class names different. there way can avoid duplication because become more , more complex each additional class. you can avoid of duplication grouping selectors: .column-1, .column-s-1 { width: 6.86666666667%; } .column-2, .column-s-2 { width: 15.3333333333%; } // more such columns @media screen , (max-width: 768px) { .column-s-1 { /* properties characteristic width*/ } } another option use less or sass

erlang - How do I start yaws to run in embedded mode? -

i've spent several hours trying troubleshoot issue using yaws documentation , web searches. existing threads here haven't helped me. i new erlang , trying run yaws in embedded mode using sample code provided on http://yaws.hyber.org/embed.yaws . missing because cannot work. have 4 files: ybed.app {application, ybed_app, [ {description, "yaws embedded application test"}, {vsn, "0.1.0"}, {registered, []}, {applications, [kernel, stdlib, yaws]}, {mod, {ybed_app, []}}, {env, []} ]}. ybed_app.erl -module(ybed_app). -behaviour(application). %% application callbacks -export([start/2, stop/1]). start(_starttype, _startargs) -> case ybed_sup:start_link() of {ok, pid} -> {ok, pid}; other -> {error, other} end. stop(_state) -> ok. ybed_sup.erl -module(ybed_sup). -behaviour(supervisor). %% api -export([start_link/0]). %% supervisor callbacks -export([init/1]).

c - Getting a segfault- trying to retrieve data from my struct -

i'm having trouble understanding why i'm getting segfault in code. i'm trying store data in array of nodes , wanted see if data getting stored properly. #define block_size 256 #define max_name_length 128 #define data_size 254 #define index_size 127 #include <stdlib.h> #include <time.h> #include <string.h> #include <stdio.h> typedef enum { dir, file, index, data } node_type; char *bitvector; // allocate space managing 2^16 blocks (in init) (size 8192) typedef struct data_t { int size; void *data; } data_t; typedef struct fs_node { char name[max_name_length]; time_t creat_t; // creation time time_t access_t; // last access time_t mod_t; // last modification mode_t access; // access rights file unsigned short owner; // owner id unsigned short size; unsigned short block_ref; // reference data or index block } fs_node; typedef struct node { node_type type; union { fs_node fd;

ruby on rails - Recurly Webhook ID -

i trying prevent recurly webhooks being executed multiple times if retried incorrectly (i.e.: when builds go out , servers time out occasionally). see in dashboard webhooks have unique ids, these don't seem accessible in message hash, missing something? i'm using rails it's worth. <?xml version="1.0" encoding="utf-8"?> <updated_subscription_notification> <account> <account_code>1</account_code> <username nil="true"></username> <email>verena@example.com</email> <first_name>verena</first_name> <last_name>example</last_name> <company_name nil="true"></company_name> </account> <subscription> <plan> <plan_code>1dpt</plan_code> <name>subscription one</name> </plan> <uuid>292332928954ca62fa48048be5ac98ec</uuid> <state>activ

objective c - iOS - Core data : Fetch and delete , one row at a time -

i have objects stored in core data. want fetch objects 1 row @ time , after finish operation on it, want delete row/object core data. , again fetch next row , delete row, , on until core data empty. (with approach) code store objects in core data : -(bool)saveproduct:(addproduct *)addproduct withimagensdata:(nsdata *)imagensdata error:(nserror *)error{ nsmanagedobject *object = [nsentitydescription insertnewobjectforentityforname:@"device" inmanagedobjectcontext:self.managedobjectcontext]; device *device = (device *)object; [device setvalue:addproduct.currencytype forkey:@"currencytype"]; [device setvalue:[nsnumber numberwithdouble:addproduct.latitude] forkey:@"latitude"]; [device setvalue:[nsnumber numberwithdouble:addproduct.longitude] forkey:@"longitude"]; [device setvalue:[nsnumber numberwithdouble:addproduct.price] forkey:@"price"]; return [self.managedobjectcontext save:&error]; } thi

Custom adapter refresh in gridview android -

i have grid view 6 cells loading in adapter. when click each cell,i going add image either taking photos or choosing images gallery.after selecting images, grid view showing empty only. though set image in 1 cell,when go cell,the previous selection gone. how make done?.. plea me. if wrong , please guide me. if (convertview == null) { grid = new view(mcontext); grid = inflater.inflate(r.layout.fpc_document_view, null); textview textview = (textview) grid.findviewbyid(r.id.grid_text); imageview = (imageview) grid.findviewbyid(r.id.grid_image); if (filelist.size() == 0) { textview.settext(document_name_list[position].tostring()); (int = 0; <= 6; i++) { imageview.setimageresource(r.mipmap.ic_add_document); } } else { bitmap bitmapresized = null; (int = 0; < filelist.size(); i++) { if (!filelist.get(i).equals("")) {

c++ - A probem with using static libraries in cmake project -

i have 2 c++ projects , b. project b depends on project a. project has structure split subdirectories: project |-\inc | |-a1.h | |-a2.h |-\src |-cmakelists.txt |-\subdir_a1 | |-cmakelists.txt | |-a1.cpp | |-\subdir_a2 |-cmakelists.txt |-a2.cpp project b |-\lib |-a1.h |-a2.h |-lib_projecta.a |-\src |-cmakelists.txt |-b.cpp the problem project b can't resolve project's definitions. although i've added target_link_libraries cmakelists.txt in project b, have error this: undefined reference `project_a::a1::func1()" upd1 i managed compile project b copping libraries subdirectories (liba1.a, liba2.a) , linking them project. wonder if it's possible tune project a, can 1 file lib_projecta.a upd2 code: project a add_library (adapter adapter.cpp ) target_link_libraries (adapter public net # project's subdirectory utils # project's subdirectory ) project b add_library (anthi

ios - How to avoid #ifdef __x86_64__ -

i importing 3rd party library dynamic ios framework creating. however, library has following in 1 of headers: #ifdef __x86_64__ #import <cocoa/cocoa.h> #else #import <uikit/uikit.h> #endif this causes problems because supported platform ios, compiling devices fails error cocoa/cocoa.h file not found . if change generic ios device , build, works, don't understand why. i tried setting build active architecture only no still gives same error. is there can compile 64 bit iphone devices? reason library's creator thought 64 bit means should osx app. the conditional statement in third party library makes no sense: __x86_64 specifies target cpu, not corresponding os of target. in order conditional compile mac os vs [ios, watchos, tvos] , possibly simulator: #if target_os_iphone || target_os_simulator #import <uikit/uikit.h> #else /* assuming mac os */ #import <cocoa/cocoa.h> #endif these macros defined in header ta

php - codeigniter : inserting data/record into 2 tables -

Image
i have 2 tables 'pengguna' , 'mahasiswa' , 1 have form 1 form inserting 2 tables, far manage insert data when has "primary key" , "foreign key" has problem, u can see code below id_pengguna table pengguna primary key , id_pengguna table mahasiswa foreign key problem when inserting data, id_pengguna pengguna has value while in table mahasiswa has no value, below code, there simple way or doing wrong? pengguna table mahasiswa table controller public function insertmahasiswa(){ $username = $this->input->post('username'); $password = md5($this->input->post('password')); $data1 = array( 'username'=>$username, 'password'=>$password, 'level'=>3, ); $nim = $this->input->post('nim'); $nama = $this->input->post('nama'); $email = $this->input->post('email'); $tele

Delegating access in Google API / Python -

so i've got python app running uses service account in our domain. working fine, , service account has been granted access correct scope. i'm using following lifted 1 of google examples: from __future__ import print_function import httplib2 import os import pprint import sys apiclient.discovery import build oauth2client.service_account import serviceaccountcredentials """email of service account""" service_account_email = 'service_account_email@google' """path service account's private key file""" service_account_client_file_path = 'my project-xxxxxx.json' def main(): scopes = ['https://www.googleapis.com/auth/drive.metadata.readonly'] credentials = serviceaccountcredentials.from_json_keyfile_name( service_account_client_file_path, scopes=scopes ) http = httplib2.http() http = credentials.authorize(http) service = build('drive'

Python Twisted multiple clients error in factory/protocol -

i getting error "exceptions.attributeerror: myserverfactory instance has no attribute 'isleaf'" my code below, working single client connection, tried making changes multiple clients fails. #!/usr/bin/python import sys ###### autogeneration please not write new imports above line ######### twisted.web import xmlrpc, server import twisted twisted.internet.protocol import protocol, factory twisted.internet import reactor port = 2222 server_info = 'testing concurrency' class twiestedserver(xmlrpc.xmlrpc, protocol): """ example of using own policy fetch handler """ """ ======================================================= function name : __init__ purpose : initialize libraries , add functions inputs : self args kwargs outputs : none ======================================================= """

c++ - Type trait: Check if reference member variable is static or not -

i check if member variable of class static or not. using std::is_member_pointer works fine types except reference members. #include <type_traits> struct { int foo; }; struct b : {}; struct c { static int foo; }; struct d : c { }; struct e { int &foo; }; struct f { static int &foo; }; static_assert(std::is_member_pointer<decltype(&a::foo)>::value, "no"); static_assert(std::is_member_pointer<decltype(&b::foo)>::value, "no"); static_assert(!std::is_member_pointer<decltype(&c::foo)>::value, "no"); static_assert(!std::is_member_pointer<decltype(&d::foo)>::value, "no"); // fail compile: static_assert(std::is_member_pointer<decltype(&e::foo)>::value, "no"); static_assert(!std::is_member_pointer<decltype(&f::foo)>::value, "no"); live example. i understand error, pointer cannot point reference member. how avoid , still distinguish if s

angular - What is the Correct Syntax for navigate to a Child Route using "this._router.navigate(['Results'])" -

i found lot of answers used [routerlink] navigation child components, not using "this._router.navigate(['result'])" here code, app.component.ts import {component} 'angular2/core'; import {router, routeconfig, router_directives, routeroutlet} 'angular2/router'; import {searchcomponent} './search/search' import {attractioncomponent} './attraction/attraction' import {profilecomponent} './profile/profile' @component({ selector: 'interest-app', templateurl: 'views/home.html', directives: [router_directives, routeroutlet] }) @routeconfig([ { path: '/search/...', name: 'searchhotel', component: searchcomponent, useasdefault: true search.ts import {component} 'angular2/core'; import {router,routeconfig,router_directives} 'angular2/router'; import {resultscomponent} '../results/results'; @component({ templateurl: 'views/search.html',

angularjs - $state.href with absolute: true doesn't return the right url -

i'm using angular , ui router. i'm trying link shown on page user can copy , share. this thread has shown me $state.href function i'm looking for, isn't generating correct link. an important detail here root of application not root of domain. in case, domain localhost , root of angular app in localhost/dev/app/ . here's command i'm using inside controller. $scope.url = $state.href('survey', { survey: "asd" }, {absolute: true}); in app.js, following route declared: .state('survey', { url: "/:survey/survey?ao", templateurl: "views/survey/survey.html", controller: "surveycontroller", }, data: { requirelogin: false, requireadmin: false }}) this should return http://localhost/dev/app/#/asd/survey , instead returns http://localhost/#/asd/survey . (the remarkable thing ui-sref="survey({survey: "asd"}) translate correct link.) is there w

javascript - What does "<" isolate binding mean -

i've come across following "<" isolate binding in source code: switch (mode) { case '@': ... case '=': ... case '&': ... case '<': if (!hasownproperty.call(attrs, attrname)) { if (optional) break; attrs[attrname] = void 0; } if (optional && !attrs[attrname]) break; parentget = $parse(attrs[attrname]); destination[scopename] = parentget(scope); initialchanges[scopename] = new simplechange(_uninitialized_value, destination[scopename]); removewatch = scope.$watch(parentget, function parentvaluewatchaction(newvalue, oldvalue) { if (newvalue === oldvalue) { // if new , old values identical first time watch has been triggered // instead use current value on destination old value oldvalue = destination[scopename]; } recordchanges(scopename, newvalue, oldvalue); destination[scopename] = newvalue; }, parentget.literal); remov

angular material - Pagination with server side data in angularjs -

how simple pagination in angularjs,i getting data in controller db , want show data pagination in angular? maybe you, filter, allows paginate data on controller. https://github.com/svileng/ng-simplepagination

security - hash_pbkdf2 vs password_hash PHP functions -

as php 5.5.0 out now, which 1 better use (security, portability, future proof)? it says password_hash() password_default may change in each full release (+1.0 or +0.1) how can use default method hashed password new default? mean php 5.5 scripts hashed passwords in database not work on php 5.6 until users change passwords? cost change (i'm trying know if servers can updated php v5.6, or website admin may change hosting provider (and change cost weaker/stronger servers), without problem current users) should wait updates or safe use in 5.5.0 should still use phpass etc frameworks or these new php 5.5 functions enough and/or more future proof? the password hashing functions (such password_hash ) preferred, automate more of process, such picking salt, verifying passwords, , rehashing. the password_verify function automatically detect algorithm used generate hash, there's no compatibility issue. these functions in released version of php, should fine use.

go - Rendering template in golang -

i using echo framework in go create web app. have directory called templates inside have 2 directories layouts , users . directory tree follows: layouts |--------default.tmpl |--------footer.tmpl |--------header.tmpl |--------sidebar.tmpl users |--------index.tmpl the code header, footer, , sidebar similar with: {{define "header"}} <!-- html here --> {{ end }} .... default.tmpl follows: {{ define "default" }} {{ template "header" }} {{ template "sidebar" }} <div class="content-wrapper"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <h2 class="page-title">dashboard</h2> {{ template "content" .}} </div> </div> </div> </div> {{ template "footer" }} {{ end }} and users\index.tmpl {{defi

linux - Change date format in a file with awk -

var1= date -d "19521029 1010" +"%y-%m-%d %h:%m" echo$var1 its working date -d inside awk not working file kod19|kad37748|del37728|vidya|19521029 1010|201209111625 sasi19|nas38228|del37728|karthika|19521029 0000|201308071912 radha94|vas37748|del37728|lalinka|19521029 0000|201407061815 first method awk 'begin {fs=ofs="|"} $5=date -d "$5"+"%y-%m-%d %h:%m" {print}' file second method awk -f '|' '{$5=date -d $5+"%y-%m-%d %h:%m"; {ofs="|"}; print}' file desired output kod19|kad37748|del37728|vidya|1952-10-29 10:10|201209111625 sasi19|nas38228|del37728|karthika|1952-10-29 10:10|201308071912 radha94|vas37748|del37728|lalinka|1952-10-29 10:10|201407061815 i want convert fifth column of "file" user input date format. column number , date formats dynamic ie dt="%y-%m-%d %h:%m" , num=$5 depends on user requirement. just use match() catch data in 5t

mysql - Golang gorm how to use `where in` with slice of ints -

from http://jinzhu.me/gorm/advanced.html#sql-builder , should able update multiple rows using in single (?) , passing slice single ? opposed where in (?,?,?,?) . example jinzhu.me follows: db.exec("update orders set shipped_at=? id in (?)", time.now, []int64{11,22,33}) . here example of gorm's tests showing working. https://github.com/jinzhu/gorm/blob/021d7b33143de37b743d1cf660974e9c8d3f80ea/main_test.go#l449 this doesnt work me however: var availableids []int _, p := range v.products { availableids = append(availableids, p.id) } log.println(availableids) db.exec("update product_supplier set deleted_at=? supplier_id = ? , sku not in (?)", time.now(), 3, availableids) output: 2016/04/19 07:48:44 [336 338 337 306 329 94 79 43 57 313 108 122 126 127 124 125 123 221 93 330 335 333 312] (sql: expected 2 arguments, got 25) when try hardcoding, same issue: db.exec("update product_supplier set deleted_at=? supplier_id = ? , sku not in (?)

java - Hibernate 3 - MappingException - AnnotationConfiguration instance is required to use <mapping class="xxxxclass"/> -

i tried hand @ writing simple hibernate 3 java program - fetch data db, works fine when try configure hbm.xml file when use model class configure same, face issues below. ie <mapping class="example.pojo_stock"/> instead of <mapping resource="pojo_stock.hbm.xml" /> although tried related queries on stackoverflow (many marked duplicate) unable find solution. kindly help public class mainapp { private static sessionfactory factory; public static void main(string[] args) { try{ system.out.println("in main method of mainapp..."); configuration configure=new configuration(); configure.configure("hibernate.cfg.xml"); factory = configure.buildsessionfactory(); mainapp mainapp = new mainapp(); mainapp.listdetails_stock(); } catch(throwable ex){ system.err.println("failed create sessionfactory object.

php - What is a good approach to save relations in repository pattern? -

i'm confused using repository pattern when comes saving data. i've written discussion board when user creates new thread need save many objects (relations). need to: create new record in topics table create new record in posts table assign post's attachments add user id subscribers table (so he/she can recieve notifications new replies) it might this: $topic = $topicrepository->create($request->all()); // $topic instance of eloquent model $post = $postrepository->create($request->all() + ['topic_id' => $topic->id]); // ... save attachments etc $url = route('topic', [$topic->id, $post->id]) . '#post' . $post->id; // build url new post // have topic , post model: creating notification ... but have feeling i'm doing wrong . shouldn't create new method in repository can create new thread (add new records topics , posts tables) , keep controller clean? maybe this? // topicrepository.php: pub

ios - Assigning UIImage to Collection View Cell -

i have collectionview inside tableviewcontroller. collection view cells there displaying photos of users. however, fetching database url path. i planning manipulate more on images data, chose store them in array profileimages (but not sure if should use array of nsurl).. (i using firebase backend lively listens changes, that's why setup isindexvalid check part) class tableviewcontroller: uitableviewcontroller, uicollectionviewdatasource { @iboutlet weak var collectionview: uicollectionview! var profileimages = [nsurl]() // database checks hits `retrievephotos()` func retrieveuserphotos(user: anyobject) { if let profilepiclink = user["firstimage"]! { let firstimagepath = profilepiclink as! string if let fileurl = nsurl(string: firstimagepath) { print(fileurl) let isindexvalid = profileimages.indices.contains(0) if (!isindexvalid) { profileimages.append(fileurl)