Sunday 15 June 2014

c# - making concrete object to type "Object" loses properties -



c# - making concrete object to type "Object" loses properties -

if have next class

person { string firstname {get;set;} string lastname {get;set;} }

and in class next

otherclass { list<person> personlist = new list<person(/*10 people in here*/); list<object> personobjectlist = new list<object>(); foreach (person p in personlist) { personobjectlist.add(p); } }

then seek

personobjectlist[0].firstname;

why not recognized object has firstname property? didn't realize changing type of object makes lose properties.

thank you

you have 2 main choices. in order of suggest.. are:

create view models per view. these objects in ui layer represent specific info individual views. map domain models view models in controller. libraries automapper , valueinjecter can help remove lot of plumbing code in regard. careful not introduce business logic mappings.

this has 2 main benefits:

your view can utilize typed view models instead of casting everywhere your view models , domain models can evolve independently

that sec point very important. when allow views utilize domain models directly, fall lot of big traps. biggest start using html.hiddenfor (<input type="hidden"/>) everywhere persist info between pages - , very becomes nightmare deal with.

also, having separate view models allows models evolve independently. domain model may have properties relating business need - view model can contain properties relate purely ui concerns. things ui level validation, aggregation properties (such fullname in view model instead of firstname + surname). flexibility really nice have.

secondly, against have said above - can place @using directive @ top of view include namespace objects are. allows utilize models in view.

..i suggest investigate first alternative provided though. you'll sense improve later on in project.

c#

intel galileo - windows developer program for IoT can program sketch to run on Arduino Uno? -



intel galileo - windows developer program for IoT can program sketch to run on Arduino Uno? -

i have visual studio installed in machine. installed windows developer programme iot well. can create iot project in visual studio well. question is, since microsoft working intel galileo board, can utilize arduino uno board in combination. write sketch in visual studio install on arduino uno testing?

is possible? planning purchase developer kit , bit confused between 1 should purchase (intel galileo or arduino)? visual studio has usual intellisense back upwards think not nowadays in arduino ide.

maybe can utilize arduino uno board free visual micro plugin, makes microsoft visual studio 2008-2013 total arduino programming environment. there detailed introductions on arduino playground site.

arduino intel-galileo

Android - Selector does not work for text in button -



Android - Selector does not work for text in button -

using android studio. i'm trying utilize selector create text in button turn white dark gray. text, not background of button.

here selector xml:

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@android:color/darker_gray" android:state_pressed="true"></item> <item android:drawable="@android:color/white" android:state_focused="true"></item> <item android:drawable="@android:color/white" android:state_enabled="true" android:state_focused="false" android:state_pressed="false"></item> <item android:drawable="@android:color/white" android:state_enabled="false"></item> </selector>

and here button xml:

<button android:layout_width="match_parent" android:layout_height="45dp" android:text="maps" android:id="@+id/buttonmaps" android:layout_above="@+id/buttonemail" android:layout_marginbottom="5dp" android:layout_centerhorizontal="true" android:textcolor="@drawable/selector" <------- **selector not working** android:background="#7f2f74a0" <------- **but work if stick here** android:textsize="20sp" />

in preview panel, receive rendering error message reads, "failed configure parser /users...src/main/res/drawable/selector.xml"

i've tried number of solutions so, , nil has worked, including cleaning , rebuilding project. interestingly, got curious , applied selector button's background , works - button background defaults white , changes grayness when pressed.

anyone smarter have solution this?

thanks!

put text selector in color folder under resources instead of drawable.

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@android:color/darker_gray" android:state_pressed="true"></item> <item android:color="@android:color/white" android:state_focused="true"></item> <item android:color="@android:color/white" android:state_enabled="true" android:state_focused="false" android:state_pressed="false"></item> <item android:color="@android:color/white" android:state_enabled="false"></item> </selector>

and utilize like,

<button android:layout_width="match_parent" android:layout_height="45dp" android:text="maps" android:id="@+id/buttonmaps" android:layout_above="@+id/buttonemail" android:layout_marginbottom="5dp" android:layout_centerhorizontal="true" android:textcolor="@color/selector" android:textsize="20sp" />

android button textcolor

php - Get a value from a echo json_encode -



php - Get a value from a echo json_encode -

i need echo json_encode($return); in model file using codeigniter

also need 1 value echoing in controller file phone call model.

is possible ? how can done ?

thank´s in advance

try :

echo json_encode(array("name"=>"test"));

http://php.net/manual/en/function.json-encode.php

php json codeigniter

Easy68K IF-ELSE branching -



Easy68K IF-ELSE branching -

writing first assembly language programme class using easy68k.

i'm using if-else branching replicate code:

if (p > 12) p = p * 8 + 3 else p = p - q print p

but think have branches wrong because without first halt in code programme runs through if branch anyway after cmp finds case p < 12. missing here or accepted way of doing this?

here assembly code:

start: org $1000 ; programme starts @ loc $1000 move p, d1 ; [d1] <- p move q, d2 ; [d2] <- q * programme code here cmp #12, d1 ; p > 12? bgt if ; sub d2, d1 ; p = p - q move #3, d0 ; assign read command trap #15 ; simhalt ; halt simulator if asl #3, d1 ; p = p * 8 add together #3, d1 ; p = p + 3 endif move #3, d0 ; assign read command trap #15 ; simhalt ; halt simulator * info , variables org $2000 ; info starts @ loc $2000 p dc.w 5 ; q dc.w 7 ; end start ; lastly line of source

to if..else, need 2 jumps; 1 @ start, , 1 @ end of first block.

while doesn't impact correctness, conventional retain source order, means negating condition.

move p, d1 ; [d1] <- p move q, d2 ; [d2] <- q * programme code here cmp #12, d1 ; p > 12? ble else ; p <= 12 if asl #3, d1 ; p = p * 8 add together #3, d1 ; p = p + 3 bra endif else sub d2, d1 ; p = p - q endif move #3, d0 ; assign read command trap #15 ; simhalt ; halt simulator

easy68k

data binding - Select option value - selectedchoice is not working -



data binding - Select option value - selectedchoice is not working -

i binding select html tag dynamic values using knockout js. additionally, trying set selected selection failing. please suggest going wrong.

self.level1choices.selectedchoice = ko.observable(2); - line not seem work.

the jsfiddle code @ http://jsfiddle.net/oarp7gwj/7/ dropdown not loading in jsfiddle reason. dont think have referenced knockout js correctly. in local environment, able load select box values. however, not able set selected value.

@wayne ellery, @qbm5 - please advise since know :)

you should utilize var declare model object avoid scoping issues

var viewmodel = new datamodel();

the main issue need add together datamodel exposing through variable in datamodel.

var datamodel = function (client) { var self = this; self.level1choices = ko.observablearray(); };

take @ helo world illustration how this:

http://knockoutjs.com/examples/helloworld.html

i've scoped self it's best practice not worry referring else mentioned here: http://knockoutjs.com/documentation/computedobservables.html.

i moved loadallapprovers method within datamodel belongs , has access populate datamodel. added mobile services client constructor can mocked testing model.

var datamodel = function (client) { var self = this; self.level1choices = ko.observablearray(); var loadallapprovers = function () { var allappprovers = client.gettable('table'); var query = allappprovers.select("id", "firstname").read().done(function (approverresults) { self.level1choices(approverresults); }, function (err) { console.log("error: " + err); }); }; loadallapprovers(); };

you missing knockout in jsfiddle.

http://jsfiddle.net/az4rox0q/6/

data-binding knockout.js

grails - How to retrieve the current visited page (controller+action) via spring security -



grails - How to retrieve the current visited page (controller+action) via spring security -

as note , question not " how check if user connected or not ", rather , question explicitly "how check if user connected on specific page "

concretely , how retrieve current controller/action browsed currentuser

i have solution using ajax, , thing there lack of performance :

js(report url): <script> var cname='${controllername}'; var aname='${actionname}'; setinterval(function(){ $.post('user/myurl',{c:cname,a:aname}); },10000) </script> controller: def myurl(){ def u=user.get(springsecurityservice.currentuser.id) u.lasturl=params?.c+'/'+params?.a u.lasturlupdated=new date() u.save() } is there built-in solution via spring security 4 ?

grails spring-security

java - printf and reading text file -



java - printf and reading text file -

i'm having problems getting code sum of salaries of text file. it's supposed sum of them, give me average salary. i'm having troubles getting 1 of lines in output format correctly. please help, i'm still new programmimg! here main.

class="lang-java prettyprint-override">import java.util.*; import java.io.*; public class filein { public static void main(string[] args) { string fname; string lname; string rank; double salary = 0; double newsal = 0; scanner infile = null; employee[] emp = new employee[20]; int numemployee = 0; // open file seek { infile = new scanner(new file("employee.txt")); } grab (filenotfoundexception e) { system.err.println("error: file employee.txt not found "); } while (infile.hasnext()) { fname = infile.next(); lname = infile.next(); rank = infile.next(); newsal = infile.nextdouble(); salary += newsal; emp[numemployee] = new employee(fname, lname, rank, salary); numemployee++; } system.out.println("acme corporation \n"); system.out.printf("number of employees: %5d ", numemployee); system.out.printf("\naverage salary: %13.2f", salary / numemployee); system.out.printf("\nannual total %16.2f", salary ); system.out.printf("\n\n%-8s %15s %10s", "name", "rank", "salary\n"); (int = 0; < numemployee; i++) { system.out.printf("%s, %s \t%7s %11.2f\n", emp[i].getlname(), emp[i].getfname(), emp[i].getrank(), emp[i].getsalary()); } infile.close(); } }

and here sample output:

class="lang-none prettyprint-override">acme corporation number of employees: 9 average salary: 58740.50 annual total 528664.54 name rank salary ------------------ ---- --------- jones, william b2 42500.00 baker, susan a3 107500.00 caine, horatio a1 191268.95 baer, teddy b4 244268.95 gator, allie a2 292268.95 mander, sally a1 354392.84 aspargus, amy a1 454442.84 huckleberry, henry b1 495677.34 rutabaga, ryan b2 528664.54

the average salary , annual total wrong, total should on 2 1000000 , average salary supposed approximately 300k. give thanks you!!

it looks assigning cummulative salary every new employee-input:

emp[numemployee] = new employee(fname, lname, rank, salary);

shouldn't be?

emp[numemployee] = new employee(fname, lname, rank, newsal);

java printf

ios - CLLocationManagerDelegate methods not being called in Swift code -



ios - CLLocationManagerDelegate methods not being called in Swift code -

i'm trying create simple app finds out part in, i'm stuck because none of cllocationmanagerdelegate methods called when app runs , finds locations.

in case it's relevant i'm not seeing dialog asking give app permission utilize location.

here's have far -

import uikit import corelocation class viewcontroller: uiviewcontroller, cllocationmanagerdelegate { @iboutlet weak var locationlabel : uilabel! var locationmanager = cllocationmanager() allow geocoder = clgeocoder () override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. locationmanager.delegate = self locationmanager.desiredaccuracy = kcllocationaccuracybest locationmanager.startupdatinglocation() } override func viewdiddisappear(animated: bool) { locationmanager.stopupdatinglocation() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } func locationmanager(manager: cllocationmanager!, didupdatelocations locations: [anyobject]!) { geocoder.reversegeocodelocation(locations.last cllocation, completionhandler: {(placemark, error) in if (error != nil) { println("error") } else { allow pm = placemark.first clplacemark println(pm) } }) } func locationmanager(manager: cllocationmanager!, didfailwitherror error: nserror!) { println("epic fail") } }

i've set in breakpoints know code never called. have gone in , manually turned on location services app while it's been running too.

try calling

func locationmanager(manager: cllocationmanager!, didupdatetolocation newlocation: cllocation!, fromlocation oldlocation: cllocation!)

instead of delegate phone call making now... had problems with:

func locationmanager(manager: cllocationmanager!, didupdatelocations locations: [anyobject]!)

aswell. using above delegate phone call fixed issue.

edit (didn't read question properly...)

you never inquire permission, why don't popup. phone call following: locationmanager.requestwheninuseauthorization()

this quite of import step, , app won't work if haven't asked user authorization of app

it of import add together nslocationwheninuseusagedescription .plist file if running ios8.

screenshot:

ios swift core-location cllocationmanager

java - How to use Mockito for composite object -



java - How to use Mockito for composite object -

i want mock dao manager this

public class daomanager{ @autowired private service1 service; @autowired private service2 service 2; @autowired private daomanager1 manager 1; public customerdetail getcustomerdetails(){ manager1.getcustomerdetails(); } public class daomanager1{ @autowired private service3 service3; @autowired private service4 service 4; public getcustomerdetails(){ service3.getcustname(); service4.getcustaddress(); }

my question how mock daomanager class? if mock it, need mock each , every manager/service gets called getcustomerdetails method? looks big overhead me. ideas or mebbe getting wrong?

edit:

when run junit , next error.

caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'mockdaomanager': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: private x.y.z.service2 x.y.z.service2; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no matching bean of type [x.y.z.service2] found dependency: expected @ to the lowest degree 1 bean qualifies autowire candidate dependency. dependency annotations: {@org.springframework.beans.factory.annotation.autowired(required=true)}

you have daomanager contract in interface , mock last

interface idaomanager { customerdetail getcustomerdetails(); } public class daomanager implements idaomanager

then follow nsanglar advises

idaomanager daomanagermock = mock(idaomanager.class); [...]

of course of study have inject dao using interface, is, anyway, practice

java unit-testing mocking mockito junit4

GridGain requirements for a cache key where value is to be used with Sql Queries -



GridGain requirements for a cache key where value is to be used with Sql Queries -

i trying execute gridcachequery created createsqlquery() on cache using custom key type for. problem gives me empty collection, when there matching results.

if repeat test non-custom key type, such string or integer, results expect.

if repeat test using createsqlfieldsquery() query, time custom key again, results expect!

is behaviour expected? i have tested 6.5.0-p1, , custom key type overrides hashcode() , equals(), , implements comparable, it's worth.

gridgain

c++ - How to broadcast or send a single value to multiple processes (but not all of them)? -



c++ - How to broadcast or send a single value to multiple processes (but not all of them)? -

what i'm trying broadcast value (my pivot) sub domain of hypercube communicator. illustration process 0 sends process 1,2 & 3 when process 4 sends 4,5 & 6. require create communicators before hand or there way broadcast/send selected processes?

int broadcaster = 0; if(isbroadcaster) { cout << "rank " << mpirank << " currentd:" << currentd << " selecting pivot: " << pivot << endl; pivot = currentvalues[0]; broadcaster = mpirank; } //todo: broadcast processes 0 4 only. //here, mpi_comm_hypercube contains process 0 8 mpi_bcast(&pivot, 1, mpi_int, broadcaster, mpi_comm_hypercube);

the best solution utilize mpi_comm_split break processes sub-communicators. is way of describing communication domains.

the mpi_group object used describing groups, part can't used perform communication.

another alternative utilize mpi_alltoallv. that's pretty nasty though, , lots of overkill.

c++ c mpi broadcast

javascript - Unable to set HTML text into InnerHtml property -



javascript - Unable to set HTML text into InnerHtml property -

my application has built in asp.net mvc 5. now, trying application retrieves text info database , generate html text. so, can set html text specific div element assigning innerhtml property. but, when seek assign html text div doesn't render. shows html text.

this code

<script type="text/javascript"> var elem = document.getelementbyid('discussion'); elem.innerhtml = "@server.htmldecode(@discussiondiv.tostring())"; </script>

is there improve way can utilize set html text dom element?

you should user html.raw

elem.innerhtml = '@html.raw(discussiondiv.tostring())';

since contains lot of double quotes " i've opted utilize single quotes on value.

javascript asp.net-mvc razor

Git bash : go to your current working project directory -



Git bash : go to your current working project directory -

how setup alias in git (.bashrc) jump project working directory.

say directory be-> c:\projects

i think should work

home() { cd /c/projects }

git git-bash

php - How to get deleted orders (trashed) in Woocommerce -



php - How to get deleted orders (trashed) in Woocommerce -

i trying trash order list woocommerce shop order. tried order status publish homecoming needs. in woocommerce version 2.2+ added post status wc-completed something. in case cannot trash post.

i tried like

function gettrashedorderlist() { $args = array('post_type'=>'shop_order','posts_per_page'=>'-1','post_status'=>array('trash')); foreach(get_posts($args) $eachorder) { // goes here } }

with latest version unable trashed order list. tried like

function gettrashedorderlist() { $args = array('post_type'=>'shop_order','posts_per_page'=>'-1','post_status'=>array('wc-completed')); foreach(get_posts($args) $eachorder) { // goes here } }

it working in case serious problem because displays orders including trashed order list. not sure if made wrong or understood wrong.

ideally when trying post status wc-completed instead of listing order including trashed, should show excluding trashed order.

is way accomplish ?

thanks.

you should passing string, not array, 'post_status':

function gettrashedorderlist() { $args = array('post_type'=>'shop_order','posts_per_page'=>'-1','post_status'=>'trash'); foreach(get_posts($args) $eachorder) { // goes here } }

php woocommerce wordpress

ruby - Implementing sort ASC or DESC in Rails -



ruby - Implementing sort ASC or DESC in Rails -

i working open source school management software, fedena , trying sort list of users surnames. software shows users first names. i've found these 2 files responsible showing info intend change.

student_controller.rb

def list_students_by_course @students = student.find_all_by_batch_id(params[:batch_id], :order => 'last_name asc') render(:update) { |page| page.replace_html 'students', :partial => 'students_by_course' } end

when delete above section of file, users names don't show believe section responsible populating table usernames.

_students_by_course.erb

<div class="students-table"> <table align="center" width="100%" cellpadding="1" cellspacing="1"> <tr class="tr-head"> <td><%= t('sl_no') %></td> <td><%= t('name') %></td> <td><%= t('adm_no') %></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> <% @students.each_with_index |r, i| %> <tr class="tr-<%= cycle('odd', 'even') %>"> <td class="col-1"> <%= i+1 %> </td> <td class="col-2"> <%= link_to r.full_name,:controller => "student", :action => "profile", :id => r.id %> </td> <td class="col-1"> <%= r.admission_no %> </td> <td class="col-7"> <%= link_to "#{t('view_profile')}", :controller => "student", :action => "profile", :id => r.id %> </td> </tr> <% end %> </table> </div>

i have tried changing 'last_name asc' 'last_name desc' nil changed. help appreciated.

you've clarified in comments want not sort order (i take you've figured out?) format of full name displayed each instance of model student.

it's not hard if traced source. let's start view, since that's see.

@students.each_with_index |r, i|

we start loop, each iteration of processes entry r index i. since we're looping on collection of students (seems valid assumption), r instance of student. problematic line is:

<%= link_to r.full_name,:controller => "student", :action => "profile", :id => r.id %>

actually, should @ r.full_name since that's link label. it's student's method. here is.

def full_name "#{first_name} #{middle_name} #{last_name}" end

you might wondering sec space, since such implementation implies if middle_name absent, we'd have two. @ source of page , you'll see there two! in order alter how total name looks, you'll have modify method.

ruby-on-rails ruby

javascript - Cannot use MongoDB -



javascript - Cannot use MongoDB -

i have been next tutorial utilize node.js, express, jade , mongodb together. have been having problem using database, starting when seek access info in jade, @ point cannot access via command prompt.

whenever navigate installed location (c:/mongo/bin) , come in command:

mongo

i back:

mongodb shell version 2.6.5 connecting to: test warning: failed connect 127.0.0.1:27017, reason: errno:10061 no connection made because target machine actively refused it.

could please help me figure out how utilize mongodb 1 time again on computer? worked 1 time before when installed it. note, using windows 8.1

mongo shell cli interact mongo server. far know still need start mongo server first.

check in explorer other files in bin directory. there should mongod.exe file. when open command line should open. long open, server running , should able interact through mongo command.

javascript mongodb

Matrix Overload C++ -



Matrix Overload C++ -

in header file suppose add together declaration of functions need overload operators. implement functions added header file.

can 1 help me suppose do? please explain can wrap head around overloading if possible.

i have listed code below. main not suppose edit it.

header file matrix.h

#ifndef matrix_h #define matrix_h class matrix { public: matrix (int sizex, int sizey); ~matrix(); int getsizex() const { homecoming dx; } int getsizey() const { homecoming dy; } long &element(int x, int y); // homecoming reference element void print () const; private: long **p; // pointer pointer long integer int dx, dy; }; #endif /* matrix_h */

matrix.cpp file

#include <iostream> #include <cassert> #include "matrix.h" using namespace std; matrix::matrix (int sizex, int sizey) : dx(sizex), dy(sizey) { assert(sizex > 0 && sizey > 0); p = new long*[dx]; // create array of pointers long integers assert(p != 0); (int = 0; < dx; i++) { // each pointer, create array of long integers p[i] = new long[dy]; assert(p[i] != 0); (int j = 0; j < dy; j++) p[i][j] = 0; } } matrix::~matrix() { (int = 0; < dx; i++) delete [] p[i]; // delete arrays of long integers delete [] p; // delete array of pointers long } long &matrix::element(int x, int y) { assert(x >= 0 && x < dx && y >= 0 && y < dy); homecoming p[x][y]; } void matrix::print () const { cout << endl; (int x = 0; x < dx; x++) { (int y = 0; y < dy; y++) cout << p[x][y] << "\t"; cout << endl; } }

main.cpp

#include <cstdlib> #include <iostream> #include <cassert> #include <ctime> #include "matrix.h" using namespace std; int main(int argc, char** argv) { int size1, size2, size3; const int range = 5; //using generate random number in range[1,6] cout << "please input 3 positive integers: (size)"; cin >> size1 >> size2 >> size3; assert(size1 > 0 && size2 > 0 && size3 > 0); matrix mymatrix1(size1, size2), mymatrix2(size2,size3); matrix yourmatrix1(size1, size2), yourmatrix2(size2, size3); matrix theirmatrix1(size1, size2), theirmatrix2(size1, size3); srand(time(0)); (int = 0; < size1; i++) (int j = 0; j < size2; j++) mymatrix1(i,j) = rand() % range + 1; yourmatrix1 = 2 * mymatrix1; theirmatrix1 = mymatrix1 + yourmatrix1; cout << "mymatrix1: " << endl; cout << mymatrix1 << endl << endl; cout << "yourmatrix1 = 2 * mymatrix " << endl; cout << yourmatrix1 << endl << endl; cout << "mymatrix1 + yourmatrix1: " << endl; cout << theirmatrix1 << endl << endl; (int = 0; < size2; i++) (int j = 0; j < size3; j++) mymatrix2(i,j) = rand() % range + 1; yourmatrix2 = mymatrix2 * 3; theirmatrix2 = mymatrix1 * yourmatrix2; cout << "mymatrix1: " << endl; cout << mymatrix1 << endl << endl; cout << "mymatrix2: " << endl; cout << mymatrix2 << endl << endl; cout << "yourmatrix2 = mymatrix2 * 3 " << endl; cout << yourmatrix2 << endl << endl; cout << "mymatrix1 * yourmatrix2: " << endl; cout << theirmatrix2 << endl << endl; homecoming 0; }

you need main , see operators used matrix objects. have overload operators matrix class given i.e. write fellow member functions class.

refer next link details on operator overloading examples:

http://en.wikibooks.org/wiki/c%2b%2b_programming/operators/operator_overloading

c++ matrix operator-overloading overloading function-overloading

How to put an int back into an array in Java -



How to put an int back into an array in Java -

// code lets computer select first random number array int rn1 = boarduser[new random().nextint(boarduser.length)]; system.out.println("computer's value: " + rn1); // code lets computer select sec random number array int rn2 = boarduser[new random().nextint(boarduser.length)]; while (rn2 == rn1) // code checks value in array if number generated selected { rn2 = boarduser[new random().nextint(boarduser.length)]; } system.out.println("computer's value: " + rn2); // code lets computer select 3rd random number array int rn3 = boarduser[new random().nextint(boarduser.length)]; while (rn3 == rn1 || rn3 == rn2) { rn3 = boarduser[new random().nextint(boarduser.length)]; } system.out.println("computer's value: " + rn3); // turning tokens chosen face downwards on grid (changing values 0) { rn1 = 0; rn2 = 0; rn3 = 0; }

basically i'm trying have rn1 = 0 set random value generated array 0, when print array seems number still stays was. idea? thanks

rn1 = 0 changing rn1's value locally, not in actual array. you'll have assign element @ index got rn1 0 instead.

int rn1index = new random().nextint(boarduser.length); int rn1 = boarduser[rn1index]; // ... boarduser[rn1index] = 0;

java arrays random

css3 - Generating classes with a loop -



css3 - Generating classes with a loop -

i have list of colors , want generate classes using these colors:

css

@color1: #b37974; @color2: #ffa385; @color3: #ff5500; @color4: #b2682e;

this code i'm using:

less

.loopingclass(@index) when (@index > 0) { @ctype: "color@{index}"; .setclass(@color,@cindex) { .btn-color-@{cindex} { background-color:@{color} ; } } .setclass(e(@@ctype),@index); .loopingclass(@index - 1); }; .loopingclass(2);

when seek compile code gulp, receive "unrecognised input" error. when remove background-color: @{color} error goes away. error in code?

update:

the right code is:

.loopingclass(@index) when (@index > 0) { @ctype: "color@{index}"; .setclass(@color,@cindex) { .btn-color-@{cindex} { background-color:@color ; } } .setclass(@@ctype,@index); .loopingclass(@index - 1); }; .loopingclass(2);

as mentioned in comments above error there in e function (which not create sense there). right code this:

@color1: #b37974; @color2: #ffa385; @color3: #ff5500; @color4: #b2682e; .loopingclass(@index) when (@index > 0) { @ctype: "color@{index}"; .setclass(@color, @cindex) { .btn-color-@{cindex} { background-color: @color; } } .setclass(@@ctype, @index); .loopingclass(@index - 1); } .loopingclass(2);

in fact can simplified just:

@color1: #b37974; @color2: #ffa385; @color3: #ff5500; @color4: #b2682e; .loopingclass(@index) when (@index > 0) { .btn-color-@{index} { @color: "color@{index}"; background-color: @@color; } .loopingclass(@index - 1); } .loopingclass(2);

more on whole thing more simple since don't need emulate arrays via "indexed variable names" because can utilize array straight (unless need refer vars separately elsewhere):

@colors: #b37974, #ffa385, #ff5500, #b2682e; .loopingclass(2); .loopingclass(@index) when (@index > 0) { .loopingclass(@index - 1); .btn-color-@{index} { background-color: extract(@colors, @index); } }

and (since entered "optimizations never end" mode anyway), same thing bit of syntactic sugar:

@import "for"; @colors: #b37974 #ffa385 #ff5500 #b2682e; .btn-color- { .for(@colors); .-each(@color) { &@{i} {background-color: @color} } }

where imported for thefor.

css3 less

html - How to calculate the total sum of items in array element using AngularJS -



html - How to calculate the total sum of items in array element using AngularJS -

i have table has column named priced,what want calculate total cost of items.what tried doesn't add together total cost displays same values in table row.i have included link jsbin.

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> <html> <div ng-app> <div ng-controller="shoppingcartctrl"> <br /> <table border="1"> <thead> <tr> <td>name</td> <td>price</td> <td>quantity</td> <td>remove item</td> </tr> </thead> <tbody> <tr ng-repeat="item in items"> <td>{{item.name}}</td> <td>{{item.price}}</td> <td>{{item.quantity}}</td> <td><input type="button" value="remove" ng-click="removeitem($index)" /></td> </tr> </tbody> </table> <br /> <div>total price: {{totalprice()}}</div> <br /> <table> <tr> <td>name: </td> <td><input type="text" ng-model="item.name" /></td> </tr> <tr> <td>price: </td> <td><input type="text" ng-model="item.price" /></td> </tr> <tr> <td>quantity: </td> <td><input type="text" ng-model="item.quantity" /></td> </tr> <tr> <td colspan="2"><input type="button" value="add" ng-click="additem(item)" /> </td> </tr> </table> </div> </div> </html> function shoppingcartctrl($scope) { $scope.items = [ {name: "soap", price: "25", quantity: "10"}, {name: "shaving cream", price: "50", quantity: "15"}, {name: "shampoo", price: "100", quantity: "5"} ]; $scope.additem = function(item) { $scope.items.push(item); $scope.item = {}; }; $scope.totalprice = function(){ var total = 0; for(count=0;count<$scope.items.length;count++){ total +=$scope.items[count].price + $scope.items[count].price; } homecoming total; }; $scope.removeitem = function(index){ $scope.items.splice(index,1); }; }

http://jsbin.com/mapigagawa/1/edit?html,js,output

your problem defined cost , quantity string , not numbers. have 2 choices

define cost , quantity numbers , not strings, improve solution

use parseint or parsefloat during calculation

function shoppingcartctrl($scope) { $scope.items = [ {name: "soap", price: 25, quantity: 10}, {name: "shaving cream", price: 50, quantity: 15}, {name: "shampoo", price: 100, quantity: 5} ]; $scope.additem = function(item) { $scope.items.push(item); $scope.item = {}; }; $scope.totalprice = function(){ var total = 0; for(count=0;count<$scope.items.length;count++){ total += $scope.items[count].price + $scope.items[count].price; } homecoming total; }; $scope.removeitem = function(index){ $scope.items.splice(index,1); }; }

html angularjs

Updating Code - Python Automation -



Updating Code - Python Automation -

i'm new site , new python--as in few days course. @ work, have inherited sized project involves matching 9 digit zip codes in excel file congressional districts (from website). i've noticed through investigation of code (what little know) author might using website allows 5 digit zip codes, not 9 digits. since districts share zip codes, 9 digit codes more precise. here's code i'm working with:

import urllib import re import csv import datetime print datetime.datetime.now() input_file_name = 'zip1.csv' output_file_name = 'legislator_output_%s-%0*d%0*d.csv' % ((datetime.date.today(), 2, datetime.datetime.now().hour, 2, datetime.datetime.now().minute)) print 'file name:', output_file_name input_file_handler = open(input_file_name, 'rb') input_reader = csv.reader(input_file_handler) output_file_handler = open(output_file_name, 'wb', 1) output_writer = csv.writer(output_file_handler) output_writer.writerow(['unique id', 'zip', 'plus 4', 'member url', 'member name', 'member district']) fail_list = [] counter = 0 input_line in input_reader: zip_entry = '%s-%s' % (input_line[1], input_line[2]) unique_id = input_line[0] counter += 1 #if counter > 25: go on zip_part = zip_entry.split('-')[0] plus_four_part = zip_entry.split('-')[1] params = urllib.urlencode({'zip':zip_part, '%2b4':plus_four_part}) f = urllib.urlopen('http://www.house.gov/htbin/zipfind', params) page_source = f.read() #print page_source relevant_section = re.findall(r'templatelanding(.*?)contentmain', page_source, re.dotall) rep_info = re.findall('<a href="(.*?)">(.*?)</a>', relevant_section[0]) rep_district_info = re.findall('is located in (.*?)\.', relevant_section[0]) try: member_url = rep_info[0][0] member_name = rep_info[0][1] member_district = rep_district_info[0] #member_district = rep_info[0][2] except: fail_list += [zip_entry] member_url = '' member_name = '' member_district = '' row_to_write = [unique_id, zip_part, plus_four_part, member_url, member_name, member_district, datetime.datetime.now()] output_writer.writerow(row_to_write) if counter % 50 == 0: print counter, row_to_write output_file_handler.close() print output_file_name, 'closed at', datetime.datetime.now() print len(fail_list), 'entries failed lookup' print counter, 'rows done at', datetime.datetime.now()

so, author used site allows 5 digits (the code couple of years old site). have no thought how replace correctly on new site.

if knows of solution or can point me in direction of resources might help, much appreciate it. @ moment i'm lost!

for can see, can query, example, http://www.house.gov/htbin/findrep?zip=63333-1211 replace urllib phone call for

urllib.urlopen('http://www.house.gov/htbin/findrep', zip_entry)

python automation

How to get a DataGrid column name when the header is clicked, WPF MVVM -



How to get a DataGrid column name when the header is clicked, WPF MVVM -

my info grid using different style can't utilize below code.is there other way of getting column name in mvvm environment without changing existing style? please allow me know.

<datagrid.columnheaderstyle> <style targettype="datagridcolumnheader"> <eventsetter event="click" handler="columnheader_click" /> </style> </datagrid.columnheaderstyle>

the handler of click event i.e. columnheader_click have sender parameter can cast datagridcolumnheader , access content property

wpf mvvm

websocket - Live notification/chat in django -



websocket - Live notification/chat in django -

i making website django , want implement live notification feature 1 on facebook or se.

i did research , seems although there's 2 options: ajax long polling , websockets, latter way go.

however, know go plugin websocket 'socket.io' turns out node.js plugin , django port seems back upwards python 2 , project seems pretty much dead. using python 2.7 project interpreter want future proof myself if upgrade python3 later, don't find myself not beingness able utilize functionality.

so question this: there straight forwards , future ready way implement websocket used send live notifications , chats in django env?

django build in blocking manner, i.e. synchronous approach. so, cannot open persistent websocket django app, block entire django thread.

if want enable notification/chat within django project environment, recommend utilize centrifuge. written in python, async (non-blocking) framework used: tornado.

but, don't need know how works, provides simple rest api communicate it.

simplified workflow, check docs more details:

start centrifuge @ same server, django project (or on low latency between them) your front-end open websocket centrifuge, not django project. when need send notification, send centrifuge django via rest api, , centrifuge deliver needed clients!

i've tried , works!

django websocket

asp.net mvc - MVC Checkbox value not working -



asp.net mvc - MVC Checkbox value not working -

hi have check box checklist programme making, type bool? can pass null value if reply not applicable (they should leave yes , no blank), otherwise should tick yes or no..my problem how can save reply answer property.

view:

yes @html.checkbox("chkyes", model.questionnaires[itemindex].answer.hasvalue ? bool.parse(model.questionnaires[itemindex].answer.tostring()):false) no @html.checkbox("chkno", model.questionnaires[itemindex].answer.hasvalue ? !bool.parse(model.questionnaires[itemindex].answer.tostring()) : false)

model:

public bool? reply { get; set; }

changed view checkbox radiobutton:

yes @html.radiobuttonfor(modelitem => modelitem.questionnaires[itemindex].answer,true, new { id = "rbyes"}) no @html.radiobuttonfor(modelitem => modelitem.questionnaires[itemindex].answer,false, new { id = "rbno"}) not applicable @html.radiobuttonfor(modelitem => modelitem.questionnaires[itemindex].answer,null, new { id = "rbnotapp"})

my problem how pass null value when not applicable?

you 2 checkboxes (and associated hidden inputs) rendered as

<input type="checkbox" name="chkyes" ...> <input type="hidden" name="chkyes" ...> <input type="checkbox" name="chkno" ...> <input type="hidden" name="chkno" ...>

which post properties named chkyes , chkno (which don't exist) property name answer. can utilize @html.editorfor(m => m.questionnaires[itemindex].answer) render dropdown 3 values (true/false/not set) or utilize 3 radio button indicate state.

note cannot utilize checkbox nullable bool. checkbox has 2 states (checked = true or unchecked = false) whereas nullable bool has 3 states (true, false , null). in add-on checkbox not post value if unchecked

if utilize radio buttons, then

yes @html.radiobuttonfor(modelitem => modelitem.questionnaires[itemindex].answer, true, new { id = "rbyes"}) no @html.radiobuttonfor(modelitem => modelitem.questionnaires[itemindex].answer, false, new { id = "rbno"}) not applicable @html.radiobuttonfor(modelitem => modelitem.questionnaires[itemindex].answer, string.empty, model.questionnaires[itemindex].answer.hasvalue ? (object)new { id = "rbnotapp" } : (object)new { id = "rbnotapp", @checked = "checked" })

asp.net-mvc razor checkbox

forms - How to change a XML tag in an OpenERP7 view? -



forms - How to change a XML tag in an OpenERP7 view? -

i created form inherits other form. added , changed several fields , attributes, now, need modify tag not field. line in original form:

<a type="open"><field name="name"/></a>

and want next one:

<a type="object" name="my_function"><field name="name"/></a>

anyone knows how manage this? way, field within page (you can check it, activate debug mode on openerp interface, go standard view of partner company, , click editformview -debug mode-, control+f , type line, there 1 that).

use xpath position="attributes" rather before/after etc.

just search source tree "attributes" in xml , find examples. memory faulty may position="attribute" find examples.

xml forms view openerp openerp-7

c# - Pass Model to controller using Html.HiddenFor -



c# - Pass Model to controller using Html.HiddenFor -

at form submission, using @html.hiddenfor(a => a.modelparameter) hold of values makes way controller. question is, models have many parameters (25+) there improve way pass of parameters using @html.hiddenfor?

for example,

foreach(var parameter in model) { @html.hiddenfor(modelitem => modelitem.parameter) }

or along these lines avoid having individual @html.hiddenfor every single parameter.

you set attribute on properties supposed hidden.

is there way utilize @html.hiddenfor finish model?

c# .net model-view-controller

ethernet - How to set eth0 MAC address in Vagrant with the VMware provisioner? -



ethernet - How to set eth0 MAC address in Vagrant with the VMware provisioner? -

vagrant relies on vmware (workstation , fusion) generate mac address of eth0 (the first , default ethernet interface) on invitee beingness deployed box.

i prepare mac address static , not regenerated each time vm recreated vmware dhcp service can assign same ip address each time.

first create sure vmware dhcp service assign ip address specified mac address editing vmnetdhcp.conf has different locations depending on os. place entry @ end of file replacing hostname, mac , ip desired values:

host hostname { hardware ethernet 00:0a:aa:aa:aa:aa; fixed-address 192.168.1.1; }

restart vmware dhcp service load these changes.

in vagrantfile utilize next settings configure default network interface:

vagrant.configure("2") |config| config.vm.define 'hostname' |hostname| hotname.vm.box = box hostname.ssh.host = '192.168.1.1' puppet.vm.provider :vmware_fusion |v, override| v.vmx['ethernet0.addresstype'] = 'static' v.vmx['ethernet0.address'] = '00:0a:aa:aa:aa:aa' end puppet.vm.provider :vmware_workstation |v, override| v.vmx['ethernet0.addresstype'] = 'static' v.vmx['ethernet0.address'] = '00:0a:aa:aa:aa:aa' end end end

next time virtual machine brought vagrant up assigned static mac , recieve same ip address dhcp.

other vmx keys manipulated ethernet0 using method.

vagrant ethernet mac-address vmware-workstation vmware-fusion

c++ - Are there 127-33 printable chars in char type? -



c++ - Are there 127-33 printable chars in char type? -

i see ascii table 127 chars. , extended 1 128 - 255. yet cout << (char)200; other output of programme dissapears (link before after. char has 127 - 32 lex-graph printable chars , onters not characters?

c++ c printing char

openlayers - ImageMagick cropping large image into xyz tiles -



openlayers - ImageMagick cropping large image into xyz tiles -

i'm having big jpg, has resolution of x * 256 / x * 256. want cutting image 256x256 tiles naming convention {zoom}-{x}-{y}.jpg. in past i've used zoomifyexpress converter cutting , zooming. want 6 different zoom levels. i've started far command:

convert example.jpg -crop 256x256 +gravity -set filename:tile ./tiles/%[fx:page.x/256]-%[fx:page.y/256] %[filename:tile].jpg

this produces lot of x-y.jpg tiles.i don't know how can add together different zoomlevels. i'm relativly new imagemagick , feels basic thing do. can help me out. in advance.

i found solution:

i resize image appropriate size , crop it. first number in filename zoom level.

convert example.jpg -resize 256x256 -crop 256x256 -set filename:tile ./tiles/0-%[fx:page.x/256]-%[fx:page.y/256] %[filename:tile].jpg

convert example.jpg -resize 512x512 -crop 256x256 -set filename:tile ./tiles/1-%[fx:page.x/(256)]-%[fx:page.y/(256)] %[filename:tile].jpg

.. , on until reach highest resolution.

imagemagick openlayers openstreetmap zoomify

ruby - Rails engine doesn't eagerly load app files while seeding db -



ruby - Rails engine doesn't eagerly load app files while seeding db -

i'm trying add together install task mountable engine units.

the task loads seed, , within clears table:

# lib/tasks/units_tasks.rake namespace :units task :install units::engine.load_seed end end # db/seeds.rb units::item.delete_all ...

when phone call task command line

$ bundle exec rake units:install # => nameerror: uninitialized constant units::item

the engine required usual (and gem works fine dependencies except case above).

# lib/units.rb require 'units/engine' module units end # lib/units/engine.rb module units class engine < ::rails::engine isolate_namespace units end end

obviously loaded without files, should eagerly loaded. why?

in seed method, need

require_relative '../lib/units'

or potentially

require_relative '../lib/units/engine'

then should able namespace have been previously.

i believe has threadsafe nature of rails, more technical reason beyond me.

ruby-on-rails ruby load rails-engines seed

c++ - Buffering wave files / sample management -



c++ - Buffering wave files / sample management -

in short: buffer whole sound file (wave) in heap. basically, utilize 1 arrays each channel, containing max 10 min * 60 sec * 44100 samples. (i limit length 10min , converting 44100 samples/sec if necessary.)

so have utilize 2 arrays length of 26460000 elements @ max. regarding size, arrays contain 16bit integers, adding ~100mbyte per file. (the applications should allowed open 4 files @ once, memory used add together ~400mbytes)

the question is, if work on windows (32bit) scheme or if should utilize more dynamic sample management instead? guess help cutting buffer int chunks of (for example) 1024 samples, wouldn't have utilize huge array bunch of smaller arrays.

if wouldn't idea, how implement sample management handle sudden jumps specific position in file or repeating samples. (so "simple" circle buffer overwrites old / used samples wouldn't help really...)

no big deal on win32. utilize std::vector::reserve, know front end how many samples there are.

c++ arrays audio buffer

regex - I need a Regular Expression to find whitespaces and replace with a dash? -



regex - I need a Regular Expression to find whitespaces and replace with a dash? -

i thought might work: ^['\s+', '-', "this should connected"\w\s]{1,}$

but wrong it. no of regex place dashes between words while @ same time not placing dashes in front end of first word or behind lastly word? and, have 1 word no dashes required.

the tool using www.import.io allows me turn website table of info or api in seconds – no coding required. uses regex , xapath help refine , reformat info captures.

i don't know www.import.io, in plain javascript

" test string ".replace(/(\w+)\s+(?=\w)/g, "$1-")

has result:

" this-is-my-test-string "

the regex replaces every whitespace characters dashes between words, not @ origin or end of string.

(to more precise replaces every grouping of word characters , whitespaces followed word character same word characters without whitespaces , dash instead.)

regex

ubuntu - Running selenium tests from different environments produce different results -



ubuntu - Running selenium tests from different environments produce different results -

i running tests 2 environments:

jenkins - ubuntu - no x`s - same tests fail. windows 8 (from localhost) - tests doing fine.

tests send , executed on different (from 2 above) remote selenium server seton win 2k8 serv. ideas why test fail when running ubuntu , not windows ?

using testng, parallel - false, max-thread - tried 1 many in suite cfg. tests running on chrome (most stable imho).

actually no unusual situation. since in our team utilize jenkins + testng , such cases not impossible. used rebuild vcs (jenkins config) each run , environment. prefer utilize first of continuous delivery's best practices

only build binaries once

the concept strongly recommend usage of binary files instead of version command system. more - it's antipattern promote @ source-code level rather @ binary level. binaries deployed different environments should same went out dev stage, checked storing hashes of binaries @ time created , verifying binary identical @ every subsequent stage in process. forces separate code, remains same between environments,and configuration, differs between environments. should aim utilize same application binaries throughout deployment process. avoid rebuilding source or processing binaries in way, if believe safe so.

ubuntu selenium jenkins webdriver selenium-server

Matlab animation loop -



Matlab animation loop -

i have next loop produce animation:

for ii=1:5:length(coors)-5 jj=1:6 plot(coors(ii,1),coors(ii,2),'o','color',cc(ii,:),'markersize',jj) plot(coors(ii+1,1),coors(ii+1,2),'o','color',cc(ii+1,:),'markersize',jj) plot(coors(ii+2,1),coors(ii+2,2),'o','color',cc(ii+2,:),'markersize',jj) plot(coors(ii+3,1),coors(ii+3,2),'o','color',cc(ii+3,:),'markersize',jj) plot(coors(ii+4,1),coors(ii+4,2),'o','color',cc(ii+4,:),'markersize',jj) drawnow frame = getframe; writevideo(writerobj,frame); end end

this plots batch of 5 points (ii in steps of 5) simultaneously marking them growing circles (jj 1 6) , works well.

what want have whole thing growing 1 point @ time, 1 size time until reach dessired size, is:

frame one: point 1->size 1

frame two: point 1->size 2, point 2->size 1

...

frame five: point 1->size 5, point 2->size 4, point 3-> size 3 ...

frame six: point 6->size 1, point 2->size 5,...

can think of elegant way without many many loops , ifs?

here comes simplified solutions draws 6 points , stores plot handle each point. handles used adjust markersize of points 1 in each iteration. can adapt code case.

coors = rand(6,2); % random coordinates figure axis([0, 1, 0, 1]) hold on handles = []; % vector store plot handles in ii=1:6 handle = plot(coors(ii,1),coors(ii,2),'ko','markerfacecolor', 'black', 'markersize',1); % adjust handles h = 1:length(handles) set(handles(h), 'markersize', get(handles(h), 'markersize') + 1); % increment markersize 1 end % add together new handle handles vector handles = [handles, handle]; % draw pause(1) end

reading markersize property in end yields desired markersizes

get(handles, 'markersize') ans = [6] [5] [4] [3] [2] [1]

matlab loops animation

How often does a PHP session ID change per user? -



How often does a PHP session ID change per user? -

just basic question, if open session when user visits main page , store session id. when user homecoming day/time , id different?

this depends on how php configured. these settings command how php session id "erased" garbage collector:

http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime

session.gc_maxlifetime specifies number of seconds after info seen 'garbage' , potentially cleaned up. garbage collection may occur during session start (depending on session.gc_probability , session.gc_divisor).

http://php.net/manual/en/session.configuration.php#ini.session.gc-divisor

session.gc_divisor coupled session.gc_probability defines probability gc (garbage collection) process started on every session initialization. probability calculated using gc_probability/gc_divisor, e.g. 1/100 means there 1% chance gc process starts on each request. session.gc_divisor defaults 100.

http://php.net/manual/en/session.configuration.php#ini.session.gc-probability

session.gc_probability in conjunction session.gc_divisor used manage probability gc (garbage collection) routine started. defaults 1. see session.gc_divisor details.

as far know default php session.gc_maxlifetime 1440 seconds (24 minutes). more visits have in site "accurate" these statistics since algorithm run more often.

a tricky edge case: if start session , never other visit site, garbage collector algorithm never run, hence session never expire! if can understand this, think have understood answer.

php session

windows phone - Chose alternate certificate on visual studio CTP -



windows phone - Chose alternate certificate on visual studio CTP -

i using multi-device hybrid apps extension visual studio 2013. how can take certificate utilize when signing.

i found solution after posted.

windows 8: custom package.appxmanifest file can placed in res/cert/windows8 folder override number of settings. can grab generated version in bld/debug/platforms/windows8 folder after building debug windows local, simulator, or device target

http://www.visualstudio.com/en-us/explore/cordova-faq-vs.aspx

visual-studio-2013 windows-phone certificate multi-device-hybrid-apps

android - Show MediaPlayer Buffering in Seek bar as Secondary Progress -



android - Show MediaPlayer Buffering in Seek bar as Secondary Progress -

i'm using video view stream hls stream wowza media server. want show overall buffering in youtube player, did , i'm able access seek-bar object , debugged code it's not null

videoview.setonpreparedlistener(new onpreparedlistener() { @override public void onprepared(mediaplayer mp) { int topcontainerid = getresources().getidentifier("mediacontroller_progress", "id", "android"); seekbar = (seekbar) mediacontroller.findviewbyid(topcontainerid); mp.setonbufferingupdatelistener(new onbufferingupdatelistener() { @override public void onbufferingupdate(mediaplayer mp, int percent) { if (percent<seekbar.getmax()) { seekbar.setsecondaryprogress(percent); } } }); } });

the problem can't see secondary progress in media controller seekbar. if clarification required required please write in comments. help appreciated.

use below code , you're goog go

videoview.setonpreparedlistener(new onpreparedlistener() { @override public void onprepared(mediaplayer mp) { int topcontainerid = getresources().getidentifier("mediacontroller_progress", "id", "android"); seekbar = (seekbar) mediacontroller.findviewbyid(topcontainerid); mp.setonbufferingupdatelistener(new onbufferingupdatelistener() { @override public void onbufferingupdate(mediaplayer mp, int percent) { if (percent<seekbar.getmax()) { seekbar.setsecondaryprogress(percent); seekbar.setsecondaryprogress(percent/100); } } }); } });

android android-mediaplayer

php - WordPress remove_filter() to remove theme JS hook via plugin -



php - WordPress remove_filter() to remove theme JS hook via plugin -

i have theme adding custom, full-screen background image via jquery. theme doing via class object called td_background. within class function called wp_head_hook(), , within hook, filter beingness added custom bg. looks this:

class td_background { // ..some stuff function __construct() { add_action('wp_head', array($this, 'wp_head_hook'), 10); } function wp_head_hook() { add_filter( 'td_js_buffer_footer_render', array($this, 'add_js_hook')); } function add_js_hook($js) { // custom js added here background image homecoming $js } } new td_background();

i'm trying de-register add_js_hook in custom plugin i'm writing, having problem wrapping mind around how nesting. i've tried few things, such as:

<?php // this... remove_filter( 'wp_footer', array($td_background, 'td_js_buffer_footer_render')); // ...and remove_filter( 'wp_footer', 'td_js_buffer_footer_render'); // ...and remove_filter( 'wp_footer', 'add_js_hook', 100); ?>

i've tried changing above wp_head.

thoughts? end goal de-register javascript in footer, can add together own in place of it.

as it's beingness instantiated anonymously, have utilize handy function remove_anonymous_object_filter() wpse, like:

// run plugin add_action( 'template_redirect', 'kill_anonymous_example', 0 ); function kill_anonymous_example() { remove_anonymous_object_filter( 'wp_head', 'td_background', 'wp_head_hook' ); }

i tested killing wp_head don't have td_js_buffer_footer_render running.

php wordpress oop

events - jquery toggleClass on nav is not seeing child link in a div -



events - jquery toggleClass on nav is not seeing child link in a div -

i'm revealing simple nav display: block; , display: none. i'm using jquery toggleclass. that's working fine. click isn't getting link within divs within nav.

how forcefulness it? (this meteor syntax, shouldn't matter, right?)

'tap .navbuttons': function(e) { $('nav').toggleclass('shownav'); }

here's sample div nav area:

<div id="search" class="navbuttons"><a href="{{pathfor 'startpage'}}">search</a></div>

i'm expecting see click on link, route page (pathfor 'startpage' iron-router) , display: none; on nav. shouldn't have set jquery click in function, should i? won't link it's job?

i figure i've got bubbling or propagation issue, haven't been able work out.

my classes working fine, no need show css.

jquery events hyperlink click

Like Operator is not working in oracle view -



Like Operator is not working in oracle view -

i have created view in oracle. fetch info view. have written sql query. query not working not having specific condition. if give status query executes. problem not occurring if joined same number of tables (that used create view) instead of using view. in next giving oracle query.

select * "920_search_report" lm_culture = '7aacb509-271d-4aca-e040-e00adea40aae' , hand_person_info_guid = 'eebd4257-7856-4c6e-b6b8-9b886e89e397' , ( lower(handicap_type) lower('%dq871j%') or lower(skskodenr) lower('%dq871j%') );

the above query executes , returns 1 record if omit or comment 3rd line query not homecoming records, should homecoming 1 or two. query given below:

select * "920_search_report" lm_culture = '7aacb509-271d-4aca-e040-e00adea40aae' --and hand_person_info_guid='eebd4257-7856-4c6e-b6b8-9b886e89e397' , ( lower(handicap_type) lower('%dq871j%') or lower(skskodenr) lower('%dq871j%') );

can help me solve problem.

oracle view

android - ListView Scrolls so slow -



android - ListView Scrolls so slow -

my listview scrolls slow iam using horizontallistview

iam trying accomplish horizontallistview footer in other listview

or header , working slow , not working correctly.

so custome adapter

public class horizntallmedialist extends arrayadapter<itemsmediasuggestion> { string imageurl; context context; int table = 0; list<itemsmediasuggestion> objects; itemsmediasuggestion related; public horizntallmedialist(context context, int textviewresourceid, list<itemsmediasuggestion> objects, int table) { super(context, textviewresourceid, objects); this.context = context; this.objects = objects; this.table = table; } viewholder holder = new viewholder(); private class viewholder { private relativelayout relativelayout; private imageview userimage, addimage; private textview username; } @override public long getitemid(int position) { homecoming super.getitemid(position); } @override public int getcount() { homecoming super.getcount(); } @override public itemsmediasuggestion getitem(int position) { homecoming super.getitem(position); } @override public view getview(final int position, view convertview, viewgroup parent) { try{ related = getitem(position); } grab (indexoutofboundsexception e) { } layoutinflater inflater = (layoutinflater) context .getsystemservice(activity.layout_inflater_service); if (convertview == null) { convertview = inflater.inflate(r.layout.items_wall_horizntal, parent, false); holder = new viewholder(); holder.relativelayout = (relativelayout) convertview .findviewbyid(r.id.horrelative); holder.userimage = (imageview) convertview .findviewbyid(r.id.horuserimage); holder.username = (textview) convertview.findviewbyid(r.id.horname); holder.addimage = (imageview) convertview.findviewbyid(r.id.horadd); holder.addimage.setvisibility(view.gone); convertview.settag(holder); } else { holder = (viewholder) convertview.gettag(); } holder.relativelayout .setbackgroundcolor(globalconstants.colorpicker_int); if (table == 5) { imageurl = globalconstants.server_file + table + "/m/" + related.getstorage() + "." + related.getstoragerand() + ".jpg"; holder.username.settext(publicmethods.readable(related .getdescribtion())); } else if (table == 6) { if (related.getstorage().equals("0")) { holder.username.settext(publicmethods.readable(related .gettitle())); imageurl = "https://img.youtube.com/vi/" + related.getstoragerand() + "/1" + ".jpg"; } else { imageurl = globalconstants.server_file + table + "/m/" + related.getstorage() + "." + related.getstoragerand() + ".jpg"; holder.username.settext(publicmethods.readable(related .gettitle())); } } else { imageurl = globalconstants.server_file + 5 + "/m/" + related.getstorage() + "." + related.getstoragerand() + ".jpg"; holder.username.settext(publicmethods.readable(related.gettitle())); } picasso.with(context).load(imageurl).fit().into(holder.userimage); homecoming convertview; } }

this item xml :

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/background_with_shadow" android:orientation="vertical" > <relativelayout android:layout_width="200dp" android:layout_height="200dp" > <imageview android:id="@+id/horuserimage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_alignparenttop="true" /> <relativelayout android:id="@+id/horrelative" android:layout_width="match_parent" android:layout_height="40dp" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" > <textview android:id="@+id/horname" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_centervertical="true" android:layout_marginleft="20dp" android:layout_marginright="5dp" android:layout_toleftof="@+id/horadd" android:gravity="right" android:maxlines="1" android:text="name" android:textcolor="@color/whitecolor" android:textsize="18sp" /> <imageview android:id="@+id/horadd" android:layout_width="40dp" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_centervertical="true" android:src="@drawable/plus" /> </relativelayout> </relativelayout>

the listview xml:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <linearlayout android:id="@+id/horizntalllin" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margintop="20dp" android:background="@android:color/transparent" android:orientation="vertical" android:visibility="visible" > <relativelayout android:layout_width="match_parent" android:layout_height="250dp" > <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginleft="3dp" android:layout_marginright="3dp" android:background="@drawable/background_with_shadow" > </relativelayout> <textview android:id="@+id/horizntalladvertisetext" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="10dp" android:paddingleft="15dp" android:paddingright="15dp" android:text="@string/relatedtopics_st" android:textappearance="?android:attr/textappearancemedium" android:textstyle="bold" /> <utilityfunction.horizontallistview android:id="@+id/hotrizantellistviewmedia" android:layout_width="fill_parent" android:layout_height="200dp" android:layout_below="@+id/horizntalladvertisetext" android:listselector="@android:color/white" android:saveenabled="true" android:smoothscrollbar="true" > </utilityfunction.horizontallistview> </relativelayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginleft="3dp" android:layout_marginright="3dp" android:orientation="vertical" > <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" " android:visibility="invisible" /> </linearlayout> </linearlayout>

try :

<listview ... android:smoothscrollbar="true"/>

android listview

in Unix, how to wildcard match files whose name is a number greater than x -



in Unix, how to wildcard match files whose name is a number greater than x -

i have bunch of files named this:

0468.xml 0474.xml 0475.xml 0481.xml

i want match whatever files there in directory name (without .xml extension) number greater than, allow say, 0474. in other words, want match lastly 2 files.

one option:

ls | awk -f. '$1>474'

unix numbers wildcard

javascript - Regex for Password Strength -



javascript - Regex for Password Strength -

this question has reply here:

regex password strength 2 answers

could pleas help me , need look password fulfill next criteria:

at to the lowest degree 8 characters length maximum of 15 characters. at to the lowest degree 1 letter in upper case. at to the lowest degree 1 letter in lower case. at to the lowest degree 1 special character. at to the lowest degree 1 numeral.

these must acceptable in order if possible.

this effort found doesn't fulfill criteria above,i have tried modification problem rests in having these in order , @ to the lowest degree 1 of of characters specified ,i have tried reducing each look below suit :

^(?=.*[a-z].*[a-z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{8}$ ^ start anchor (?=.*[a-z].*[a-z]) ensure string has 2 uppercase letters. (?=.*[!@#$&*]) ensure string has 1 special case letter. (?=.*[0-9].*[0-9]) ensure string has 2 digits. (?=.*[a-z].*[a-z].*[a-z]) ensure string has 3 lowercase letters. .{8} ensure string of length 8. $ end anchor.

there no duplicate ,please review marking unless sure duplicate

try regex helps

/^(?=.*\d)(?=.*[a-z])(?=.*[a-z])(?=.*[\w\_])[a-za-z0-9\w\_]{8,15}$/

javascript jquery regex password-protection

ios - UINavigationBar is off center? -



ios - UINavigationBar is off center? -

so set app navigation bar except it's refusing remain in middle of screen. title moved right , right-most button hidden off screen. i've tried resizing, deleting , re adding it, cleaning, etc... , nil works. thought why might be? :\

this looks when run on simulator vs storyboard

the title centered, uinavigationbar 600px wide. screen not wide. need add together layout constraints resize toolbar appropriately containing view.

you need add together layout constraints. ctrl+drag uinavigationbar parent view (in left hierarchical tree-view tool window):

and add together next constraints (hold alt , shift while selecting):

leading space container trailing space container top space top layout guide

ios xcode uinavigationbar

visual studio 2012 - ATL COM DLL REGISTER ERROR 0x80070716 -



visual studio 2012 - ATL COM DLL REGISTER ERROR 0x80070716 -

i getting error 0x80070716 when regsvr32 done atl dll x64, under win7 x64.

i made search before putting question, , verfying threads in other web sites 1 http://www.tek-tips.com/viewthread.cfm?qid=1085835 , other 1 here http://forums.codeguru.com/printthread.php?t=366207. threads have not solve problem.

please allow me know if help me.

i share solution, maybe help 1 in future:

1) select "resourceview" tab in workspace menu bar.

2) right click on resource folder component failing register.

3) select "resource symboles..." menu option.

4) remove unused symboles , close.

when build project error error c2065: idr_<mywrongidregistryclass> : undeclared identifier; in declare_registry_resourceid :

5) replace idr_<mywrongclass> idr_<mycorrectidregistryclass>.

these steps create atl com dll registred after made build.

hope help faces same problem.

visual-studio-2012 com atl regsvr32

scala - How can I create an empty java.util.UUID object? -



scala - How can I create an empty java.util.UUID object? -

i don't know why can't find reply this, need pass blank uuid object in 1 of functions represent lack of uuid. uuid analagous form of

val x: ""

, empty string. i'm trying empty uuid. tried

uuid.fromstring("")

but received error, need valid uuid string.

edit: implementing in scala.

let me preface saying me much improve utilize option[uuid] instead, none representing empty uuid.

you can't utilize empty string, not conform uuid format, described here.

you could use

uuid.fromstring("00000000-0000-0000-0000-000000000000")

which same as

new uuid(0l, 0l)

but usage of arbitrary, , much improve signify absence or lack of uuid option.

java scala uuid

javascript - Jquery input value not showing up correctly -



javascript - Jquery input value not showing up correctly -

i have simple input value.

the code looks this:

var $a = $('.custom-amount').val(); $('.custom-amount').on('change', function() { alert($a) })

and input:

<div class='custom-amount'> <input placeholder='custom amount' type='text-area'>

for reason, alerts empty. see whats going wrong?

change selector $('.custom-amount input'), , value after alter event fired, e.g.

$('.custom-amount input').on('change', function() { var = $(this).val(); alert(a); });

right now, trying value of div, won't work. need value of input.

edit: also, looks trying display textarea. seek replacing this...

<input placeholder='custom amount' type='text-area'>

with this...

<textarea placeholder='custom amount'></textarea>

this may help:

http://jsfiddle.net/d648wxry/

javascript jquery html

if statement - PHP If referrer exists show div... How? -



if statement - PHP If referrer exists show div... How? -

i show div table referrer title, when referrer exists, if doesn't exist - don't show it. need set "if exists" status after function. i'm beginner. far have function:

function getsitetitle(){ $refurl = (is_null($_server['http_referer'])) ? 'un know' : $_server['http_referer']; if($refurl != 'un know'){ $con = file_get_contents($refurl) or die (" can't open url referer "); $pattern = "/<title>(.+)<\/title>/i"; preg_match($pattern,$con,$match); $result = array($match[1],$refurl); homecoming $result; } else{ homecoming false; } } $info = getsitetitle(); echo "". $info[0];

i want show div table referrer title when referrer exists. if not exists don't show div.

$info = getsitetitle(); if ($info !== false) { echo "<div>ref title: {$info[0]}</div>"; }

php if-statement referrer

pdf generation - XSLT: Adding an XML Hyperlink to Another XML Value -



pdf generation - XSLT: Adding an XML Hyperlink to Another XML Value -

i trying hyperlink value. hyperlink stored in xml well. used output pdf's line items.

this current code:

<fo:block font-size="8pt"> <fo:inline> <xsl:value-of select="substring-before(_preload_product_id, &quot; - &quot;)" /> </fo:inline> </fo:block>

i want able add together hyperlink substring. actual url link, mentioned, comes xml looks xsl:

<xsl:value-of select="cf_customer_quotation_line_item_product_url" />

i have been looking around find code more geared websites, doing pdf. know if possible add together same hyperlink image below:

<fo:block> <fo:external-graphic src="url()" content-height="2cm"> <xsl:attribute name="src"> <xsl:value-of select="cf_customer_quotation_line_item_image_url"/> </xsl:attribute> </fo:external-graphic> </fo:block>

wrap image (or whatever else want become link) in fo:basic-link

for example:

<fo:block> <fo:basic-link external-link="url(--url link destination--)"> <fo:external-graphic src="url(--url image--)" content-height="2cm" /> </fo:basic-link> </fo:block>

to utilize concrete values example. have image on hard drive d:\images\smiley.jpg. url of hyperlink's destination in element accessible xsl named cf_customer_quotation_line_item_product_url (as in example), above becomes:

<fo:block> <fo:basic-link external-link="url({cf_customer_quotation_line_item_product_url})"> <fo:external-graphic src="url(d:\images\smiley.jpg)" content-height="2cm" /> </fo:basic-link> </fo:block>

the curly brackets in external-links url() value cause evaluation kind of value-of within attribute.

further edit (based on reply):

change this

<fo:block> <fo:basic-link> <xsl:attribute name="external-destination"> <xsl:value-of select="cf_customer_quotation_line_item_product_url"/> </xsl:attribute> <fo:external-graphic src="url()" content-height="2cm"> <xsl:attribute name="src"> <xsl:value-of select="cf_customer_quotation_line_item_image_url"/> </xsl:attribute> </fo:external-graphic> </fo:basic-link> </fo:block>

to this

<fo:block> <fo:basic-link external-destination="url({cf_customer_quotation_line_item_product_url})" text-altitude="2cm"> <fo:external-graphic src="url({cf_customer_quotation_line_item_image_url})" content-height="2cm" /> </fo:basic-link> </fo:block>

if find still doesn't work, seek clicking @ bottom of image - may hypertext part "text high". if happening you, add together text-altitude fo:basic-link same height image (i've updated illustration above).

xml pdf-generation xsl-fo

html - Unexpected behavior on elements with transitions in their css -



html - Unexpected behavior on elements with transitions in their css -

i have written css elements, , causing unexpected behaviour. using:

transition: 0.2s;

when refreshing page, element css property, unexpectedly start off in area of page, , move set positions (set in other parts of css). the,

position: absolute

property used position elements, causing unexpected behaviour?

here css link:

.sublinks_links { position: relative; width: 100%; height: 50px; line-height: 50px; text-align: left; border-top: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb; font-size: 13px; color: #999; margin-bottom: -1px; cursor: pointer; text-transform: uppercase; } .sublinks_links > span { margin-left: 30px; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s;

}

.sublinks_links:hover > span { margin-left: 40px; }

and relevant html css:

<div id="sublinks"> <div class="sublinks_links_selected"><span>link text</span></div> <div class="sublinks_links"><span>link text</span></div> </div>

i have found positioning issue. using text-align , margin-left position elements. there no dead positioning, caused unwanted behaviour.

html css positioning transitions

http - wreq not compiling with cabal sandbox -



http - wreq not compiling with cabal sandbox -

i'm using cabal sandbox , got error when compiling wreq library:

network/wreq/lens/machinery.hs:20:58: couldn't match type `[name]' `name' expected type: name -> [name] -> name -> [defname] actual type: [name] -> name -> [defname] in homecoming type of phone call of `fieldname' probable cause: `fieldname' applied many arguments in sec argument of `(.~)', namely `fieldname id' in sec argument of `(&)', namely `lensfield .~ fieldname id' failed install wreq-0.2.0.0

i'm using these libraries in cabal file:

base of operations >=4.6 && <4.7, bytestring >=0.10 && <0.11, aeson >=0.7 && <0.8, yaml-config >= 0.2.0 && < 0.3, http >= 4000.0.7 &&< 4001, base64-string >= 0.2 && < 0.3, wreq >= 0.2.0.0 && < 0.3

any ideas how solve compilation error?

it looks lens-4.5 culprit.

add lens >= 4.4 && < 4.5 cabal file , compile (it did me.)

http haskell lens

outlook vba - ms 2010 vb to move email to a different mailbox and subfolder -



outlook vba - ms 2010 vb to move email to a different mailbox and subfolder -

i looking move emails folder deleted folder of below mailbox. "compile error: variable not defined" message, have gone wrong?

sub movetofolder(foldername) mailboxnamestring = "mailbox - david beach" dim olapp new outlook.application dim olnamespace outlook.namespace dim olcurrexplorer outlook.explorer dim olcurrselection outlook.selection dim oldestfolder outlook.mapifolder dim olcurrmailitem mailitem dim m integer set olnamespace = olapp.getnamespace("mapi") set olcurrexplorer = olapp.activeexplorer set olcurrselection = olcurrexplorer.selection set oldestfolder = olnamespace.folders(mailboxnamestring).folders(foldername) m = 1 olcurrselection.count set olcurrmailitem = olcurrselection.item(m) debug.print "[" & date & " " & time & "] moving #" & m & _ ": folder = " & foldername & _ "; subject = " & olcurrmailitem.subject & "..." olcurrmailitem.move oldestfolder next m end sub sub delete() movetofolder ("deleted items") end sub

this line outlook 2003. mailboxnamestring = "mailbox - david beach"

take @ 2010 mailbox , utilize name.

outlook-vba

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -



apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

the client requested download compressed log file, using ext.js form submission on embedded iframe. request sent server, has apache , jboss 6. servlet compresses log files, database operation , returns compressed file.

exactly after 2 min, 504 gateway time-out server didn't respond in time message seen @ browser net panel. how prepare error?

the servlet taking long time compress log files, , apache's timeout set 2min.

the error fixed increasing timeout directive on httpd.conf file:

# # timeout: number of seconds before receives , sends time out. # ##timeout 120 timeout 600

apache servlets extjs jboss http-status-code-504

c# - Get client side HTML changes on postback -



c# - Get client side HTML changes on postback -

i want add together rows table javascript, want able find out rows on postback. there way that?

i want able populate original rows in table server (i'm thinking repeater). still possible that?

that's not much of description think covers it...

the code looks this

<table id="mytable"> <tr> <td> static row </td> </tr> <asp:repeater id="rpttest" runat="server"> <headertemplate> <tr class="dgheader"> <th> head1 </th> <th> head2 </th> <th></th> </tr> </headertemplate> <itemtemplate> <tr class="<%# (container.itemindex%2 == 0) ? "dgitem" : "dgalternatingitem" %>"> <td><%# eval("val1") %> </td> <td><%# eval("val2") %> </td> <td><a class="dgdeletebutton" href="javascript:delete(this)"></a></td> </tr> </itemtemplate> </asp:repeater> </table>

at moment i'm wondering how, server side, can version of table has whatever changes made client side.

in order info client in manner describe, need include field in form submit.

you want hidden(s) field. time add together row, either add together hidden field each value want capture (such val1 , val2) or have 1 hidden field, , when add together row, append info want existing row.

i warn against posting straight html, need values not total markup, , don't want sanitize html , parse info want.

so head start can add together hidden inputs:

<tr class="<%# (container.itemindex%2 == 0) ? "dgitem" : "dgalternatingitem" %>"> <input type="hidden" name="row[1].val1" value="myvalue" /> <td><%# eval("val1") %> </td> <input type="hidden" name="row[1].val2" value="myvalue" /> <td><%# eval("val2") %> </td> <td><a class="dgdeletebutton" href="javascript:delete(this)"></a></td> </tr>

you can submitted values on backend:

httpcontext.current.request.form["row[1].val1"]

this memory, line above might not correct.

c# asp.net .net

php - Display multiple variables in an image -



php - Display multiple variables in an image -

i'm trying utilize multiple variables string within image generated in php, maintain getting next error:

parse error: syntax error, unexpected '' - '' (t_constant_encapsed_string) in c:\xampp\htdocs\projects\scrobbl.in\image.php on line 36

what doing wrong?

here's code:

<?php $img_number = imagecreate(275,25); $backcolor = imagecolorallocate($img_number,102,102,153); $textcolor = imagecolorallocate($img_number,255,255,255); imagefill($img_number,0,0,$backcolor); imagestring($img_number,10,5,5,$currenttrack' - '$artist,$textcolor); header("content-type: image/jpeg"); imagejpeg($img_number); ?>

this should work you:

imagestring($img_number,10,5,5,"$currenttrack" . " - " . "$artist",$textcolor);

php gd2

Java connection to access database fails? -



Java connection to access database fails? -

iam using windows 8.1 (64 bit) microsoft office 32bit version. iam trying connect access file retrieve username , password connection access database cannot made, have searched alot on net can't seem find solution problem. downloaded office 64bit microsoft access database engine 2010 redistributable still same error. should overcome issue?

java method:

dbcon() { try{ class.forname("sun.jdbc.odbc.jdbcodbcdriver"); con=drivermanager.getconnection("jdbc:odbc:db5"); }catch(exception e){ system.out.println(e); } }

error:

java.sql.sqlexception: [microsoft][odbc driver manager] info source name not found , no default driver specified java.lang.nullpointerexception null

this may fact odbc driver 32 bit, can not recognized 64 bit java. either create 64 bit odbc driver or run java in 32 bit mode (-d32 switch).

java database connection odbc

sharepoint 2013 - MS Access Web App: corrupted table, cannot open in Access anymore -



sharepoint 2013 - MS Access Web App: corrupted table, cannot open in Access anymore -

tldr: how can delete corrupted table prevents me opening web app in access?

i used access desktop client create new table approx 20 lookup fields. when tried saving table, received error message many indices. set index alternative "no" lookup fields , tried close "edit table view". however, not able close edit table view anymore. after trying while, used task manager terminate access. now, when seek open app in access clicking "customize in access" button on web, receive several error messages:

operation failed: table xxx contains many indices. delete indices , seek again. (this error message appears 5 times) microsoft access can not create table a problem occurred when trying access property or method of ole object. next, i'm @ access start screen. application not open.

so, there other way can delete corrupted table without opening through access client? maybe straight accessing sql server? database configured allow read/write connections, becasue connected tables access desktop database, i'm not sure if can delete table or fields way. help appreciated!

[i translated error messages german, might different in english language version]

i work access product team , asked them specific issue. particular issue, can solved need open back upwards service request via office 365 service request channel. if using office 365, there should admin entry point can open service request. our engineers work unblocked can open access 2013 web app 1 time again within client design surface.

sharepoint-2013 ms-access-2013

alloy ui - Is AlloyUI Form Builder Works For Liferay 6.0.5 -



alloy ui - Is AlloyUI Form Builder Works For Liferay 6.0.5 -

is alloyui form builder works liferay 6.0.5. because our site works on liferay 6.0.5 , can't update latest version. have placed code mentioned in alloyui.com. can drag , drop fields can't submit form. there script error in firebug m.loaded[n], didn't understand do.

suggest on this. using below code in liferay 6.0.5 jsp pages

<script src="http://cdn.alloyui.com/3.0.0/aui/aui-min.js"> <link href="http://cdn.alloyui.com/3.0.0/aui-css/css/bootstrap.min.css" rel="stylesheet"></link> <div id="myformbuilder"></div> <script> yui().use( 'aui-form-builder', function(y) { new y.formbuilder( { availablefields: [ { iconclass: 'form-builder-field-icon-text', id: 'firstname1', label: 'first name', readonlyattributes: ['name'], type: 'text', //unique: true, width: 75 }, { iconclass: 'form-builder-field-icon-text', id: 'lastname', label: 'last name', readonlyattributes: ['name'], type: 'text', //unique: true, width: 75 }, { iconclass: 'form-builder-field-icon-text', id: 'preferredname', label: 'preferred name', readonlyattributes: ['name'], type: 'text', //unique: true, width: 75 }, { iconclass: 'form-builder-field-icon-text', id: 'emailaddress', label: 'email address', readonlyattributes: ['name'], type: 'text', //unique: true, width: 75 }, { iconclass: 'form-builder-field-icon-radio', label: 'gender', options: [ { label: 'male', value: 'male' }, { label: 'female', value: 'female' } ], type: 'radio' }, { iconclass: 'form-builder-field-icon-button', label: 'button', type: 'button' }, ], boundingbox: '#myformbuilder', fields: [ { label: 'city', options: [ { label: 'ney york', value: 'new york' }, { label: 'chicago', value: 'chicago' } ], predefinedvalue: 'chicago', type: 'select' }, { label: 'colors', options: [ { label: 'red', value: 'red' }, { label: 'green', value: 'green' }, { label: 'blue', value: 'blue' } ], type: 'radio' } ] } ).render(); } ); </script>

it not possible utilize aui-form-builder in liferay 6.0.

according liferay integration wiki article, liferay 6.0 uses alloyui 1.0.3. after searching source in alloyui 1.0.3 tag, seems aui-form-builder did not exist in version. far can tell api docs, aui-form-builder added in 2.0.x version.

note: not possible upgrade new major version of alloyui in liferay either.

liferay-6 alloy-ui