Wednesday, 15 January 2014

javascript - Transforming api json responses for NodeJS -



javascript - Transforming api json responses for NodeJS -

i'm ending having hacks convert 'true' true , it's creating code smell.

is there library https://github.com/thephpleague/fractal allows me transform response types need?

in cases it's improve prepare api homecoming info in usable format rather trying post-process result on client.

in case there several routes take:

store list json string straight in database.

this means don't have processing on server , can homecoming 'as is'. lose ability queries on info straight , need resort things like , string operations.

store info relationally, , process on server turn json

here retain ability queries on data, may need several queries info need , connect on server. (eg. 1 select on user table user, , need select on friends table userid matches first user. need merge these results create json.) best way it.

you can turn result json straight within database engine using user defined function. illustration using https://github.com/mysqludf/lib_mysqludf_json#readme

this similar 2, ties stored procs json format.

javascript json node.js

jquery - Hide a filter by default and show on clicking toggle button -



jquery - Hide a filter by default and show on clicking toggle button -

i using drupal 7 in windows. have created view displays results dynamically populated anding 4 exposed filters (by default set any).

in view, hide filter , show results default. on clicking toggle button, show filter. changing filter parameter trigger query database , reload page results based on new filter parameters. when reloading show filter.

i have filter wrapped in container div (.view-filters) , form (#views-exposed-form-blog-styles-page-2). seek toggle display on clicking div(#toggle-faculty-filter) styled button.

when clicked on filter results button, toggle display property. filter wrapped in form , every time filter values change, form gets submitted triggering query database. page reloads , filtered results displayed. div stays hidden.

either: observe form submit event , set display property block. way when page reloads new values, can see filter.

or:i set display:none div in ready event using jquery. utilize button toggle display. in page, observe if coming page first time or reload after triggering of form submit event. in case of latter, set display property of div block.

the problem can't see filter on reload despite first method. don't know how observe how have reached current page (via form submit/reload or redirected other page)

css:.page-faculty .view-filters { display: none; }

i have hidden container div of filter default.

jquery:

$(document).ready(function () { $("#toggle-faculty-filter").click(function () { $(".page-faculty .view-filters").toggle(); }); $('#views-exposed-form-blog-styles-page-2').submit(function () { $('#view-filters').show(); }); });

please help...

jquery forms filter toggle

asp.net - FileLoadException when uploading a file to azure blob storage -



asp.net - FileLoadException when uploading a file to azure blob storage -

i want upload image emulator azure blob storage business relationship (devstoreaccount1). index.html code:

<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>app</title> </head> <body> <div id="body"> <form name="form1" method="post" action="api/photo" enctype="multipart/form-data"> <div> <label> browse file </label> <input name="myfile" type="file" /> </div> <div> <input type="submit" value="upload" /> </div> </form> </div> </body> </html>

and post method of web api controller

public httpresponsemessage post() { // retrieve storage business relationship connection-string cloudstorageaccount storageaccount = cloudstorageaccount.parse( cloudconfigurationmanager.getsetting("cloudstorageconnectionstring")); // create blob client cloudblobclient blobclient = storageaccount.createcloudblobclient(); // retrieve reference container // container name must utilize lower case cloudblobcontainer container = blobclient.getcontainerreference("mycontainer"); // create container if doesn't exist container.createifnotexists(); // enable public access blob var permissions = container.getpermissions(); if (permissions.publicaccess == blobcontainerpublicaccesstype.off) { permissions.publicaccess = blobcontainerpublicaccesstype.blob; container.setpermissions(permissions); } // check if request contains multipart/form-data. if (!request.content.ismimemultipartcontent()) { throw new httpresponseexception(httpstatuscode.unsupportedmediatype); } httpresponsemessage result = null; var httprequest = httpcontext.current.request; if (httprequest.files.count > 0) { var docfiles = new list<string>(); foreach (string file in httprequest.files) { var postedfile = httprequest.files[file]; var filename = postedfile.filename; var blob = container.getblockblobreference(filename); var filepath = httpcontext.current.server.mappath("~/" + filename); postedfile.saveas(filepath); docfiles.add(filepath); using (var filestream = file.openread(filepath)) { blob.uploadfromstream(filestream); } file.delete(filename); } result = request.createresponse(httpstatuscode.created, docfiles); } else { result = request.createresponse(httpstatuscode.badrequest); } homecoming result; }

so when run server , seek upload image stored in file system, application throws exception:

eccezione di tipo 'system.io.fileloadexception' in microsoft.windowsazure.storage.dll non gestita nel codice utente

ulteriori informazioni: impossibile caricare il file o l'assembly 'microsoft.data.services.client, version=5.6.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' o una delle relative dipendenze. la definizione di manifesto dell'assembly specificato non corrisponde al riferimento all'assembly. (eccezione da hresult: 0x80131040)

at point:

container.createifnotexists();

please help me prepare or find method upload image blob storage using rest api.

instead of using:

container.createifnotexists();

try using:

if (!container.exists()) container.create();

asp.net azure-storage-blobs

Create empty file with android init script -



Create empty file with android init script -

is possible create empty file in android source code init rc script create folder. mkdir /tmp creates folder touch /tmp/test doesn't anything.

pls help

the 'write' or 'copy' command works.

but please create ensure commands added after filesystems mounted, example, @ end of "on post-fs-data"

on post-fs-data ... write /data/non-empty-file 0 ... re-create /dev/null /data/empty-file

android android-source init

sql - Adding Character to All Rows Returned from a SELECT -



sql - Adding Character to All Rows Returned from a SELECT -

i insert hyphen in middle of column rows of table. i'm pretty sure there built-in function this.

how can specify want hyphen placed within column?

test data declare @table table (mmdd_int int, mmdd_char varchar(4)) insert @table values (1201, '1201'), (1110, '1110'), (910 , '0910'), (101, '0101') query select left(right('0'+cast(mmdd_int varchar(4)), 4),2) + '-' + right(cast(mmdd_int varchar(4)),2) int_column ,left(mmdd_char, 2) + '-'+ right(mmdd_char, 2) char_column @table result ╔════════════╦═════════════╗ ║ int_column ║ char_column ║ ╠════════════╬═════════════╣ ║ 12-01 ║ 12-01 ║ ║ 11-10 ║ 11-10 ║ ║ 09-10 ║ 09-10 ║ ║ 01-01 ║ 01-01 ║ ╚════════════╩═════════════╝

sql sql-server

javascript - How to read command line output -



javascript - How to read command line output -

i want open batch file in nodejs , read output, while printing (not @ 1 time when batch finished).

for example, jenkins / hudson.

i'm aware work on windows. finish illustration of how helpful, i'm pretty new nodejs.

i believe you'll fine using node's kid process run command , monitor it's output prints. not have restrictions on windows though, may missing in you're asking. allow me explain in hopes answers question.

imagine have file outputs text, on time , not @ once. let's name file print-something.js. (i realize you've spoken batch file, know child_process can execute executable file. here i'll running javascript file via node, execute batch file in same way.)

print-something.js

var maxruns = 5, numruns = 0; function printsomething() { console.log('some output'); settimeout(function() { numruns++; if (numruns < maxruns) { printsomething(); } }, 1000); } printsomething();

it's not of import file does, if study you'll see prints "some output" 5 times, prints each statement 1 sec gap in-between. running command line (via node print-something.js) result in:

some output output output output output

so have file outputs text in delayed manner. turning our attending file reads output, have this:

monitor-output.js

var spawn = require('child_process').spawn, command = spawn('node', ['print-something.js']); command.stdout.on('data', function(data) { console.log('stdout: ' + data); }); command.on('close', function (code) { console.log('child process exited code ' + code); });

this file spawns process node print-something.js, , begins inspect standard output. each time gets data, prints console. finally, when execution has completed, outputs exit code. running node monitor-output.js results in:

stdout: output

stdout: output

stdout: output

stdout: output

stdout: output

child process exited code 0

most won't printing output of file console, that's we're doing here illustration. gives thought on how monitor output of file while runs, , within child_process.

javascript node.js

javascript - What is the correct way of passing a Mongoose object into the MongoDB underlying connection insert() method -



javascript - What is the correct way of passing a Mongoose object into the MongoDB underlying connection insert() method -

i need insert many thousands of documents mongodb. want utilize mongoose casting properties, etc. cannot figure out how pass generated instances mongodb connection. have tried this:

var fs = require('fs'); var mongoose = require('mongoose'); var config = json.parse(fs.readfilesync("./config.json")); mongoose.connect(config.mongodburl); db = mongoose.connection; db.once('open', function () { var testschema = new mongoose.schema({ teststr : string }); var model = mongoose.model('test_schema_2', testschema); var inst = new model(); inst.teststr = "ewafwefaw"; // works. db.collection('test_schema_2').insert({ teststr : 'my test str'}, {}, function (err) { if (err) { console.log(err); } else { console.log('written.'); db.close(); } }); // doesn't. db.collection('test_schema_2').insert(inst, {}, function (err) { if (err) { console.log(err); } else { console.log('written.'); db.close(); } }); });

in sec case, get: "[rangeerror: maximum phone call stack size exceeded]"

what mongoose breaking behind scenes stops working, , how can create work?

to save instance of model have do

inst.save(function(err) { //do here });

javascript mongodb mongoose

sql - How to pass a list of Ints to a stored procedure -



sql - How to pass a list of Ints to a stored procedure -

i created stored proc in sql server 2012 using following:

create type dbo.enctypefilter table ( enctypefilterid int ); go set ansi_nulls on go set quoted_identifier on go create procedure getexplorerdata @enctypefilterlist dbo.enctypefilter readonly begin ... end

i error "operand type clash: varchar incompatible enctypefilter" when phone call procedure next command:

exec getexplorerdata @enctypefilterlist='(1,2,3,4)'

so, how pass list of ints param procedure?

you can't auto-cast varchar table contents. utilize this:

declare @enctypefilterlist dbo.enctypefilter insert @enctypefilterlist values (1), (2), (3), (4); exec getexplorerdata @enctypefilterlist

sql stored-procedures

c# - Is copying a file while writing to it thread safe? -



c# - Is copying a file while writing to it thread safe? -

is using filestream class write file , .net file.copy method re-create file @ same time thread safe? seems operating scheme should safely handle concurrent access file, cannot find documentation on this. i've written simple application test , seeing weird results. re-create of file showing 2mb, when inspect file content notepad++ it's empty inside. original file contains data.

using system; using system.threading.tasks; using system.threading; using system.io; namespace consoleapplication { class programme { static void main(string[] args) { string filepath = environment.currentdirectory + @"\test.txt"; using (filestream filestream = new filestream(filepath, filemode.create, fileaccess.readwrite)) { task filewritetask = task.run(() => { (int = 0; < 10000000; i++) { filestream.writebyte((byte)i); } }); thread.sleep(50); file.copy(filepath, filepath + ".copy", true); filewritetask.wait(); } } } }

thanks help!

it depends.

depends mean when "thread safe".

first of all, @ constructor:

public filestream(string path, filemode mode, fileaccess access, fileshare share )

notice lastly parameter, states allow other threads , processes file. default applies constructors don't have fileshare.read, means allow others view file read-only. of course of study unwise if writing it.

that's did, opened file writing, while allowing others read , , "read" includes copying.

also please note, without this: filewritetask.wait(); @ end of code, entire function isn't thread safe, because filestream might closed before start writing.

windows create file access thread safe, in pretty non trivial manner. illustration if have opened file fileshare.none, have crashed file.copy , best of knowledge there isn't elegant way .net. general approach windows uses synchronize file access called optimistic concurrency, meaning assume action possible, , fail if isn't.

this question discusses waiting file lock in .net

sharing files between process mutual issue , 1 of ways , inter-process comunication memory mapped files , the msdn documentation

if brave , willing play around winapi , overlapped io, if remember correctly lockfileex allows nice file locking...

also, 1 time there magical thing called transactional ntfs has moved on in realm of microsoft deprecated technologies

c# .net multithreading

objective c - URL scheme to launch blackberry messenger in iOS -



objective c - URL scheme to launch blackberry messenger in iOS -

if need check whether facebook installed on ios device, can check :

if([[uiapplication sharedapplication] canopenurl:[nsurl urlwithstring:@"fb://"]])

is there url scheme bbm ?

i have tried bbm://, didn't work.

any help appreciated. in advance.

i don't think there is. if want know certain, can open ipa (it's zip file), , find plist. within plist, can check if registers schemes.

objective-c ios7 url-scheme bb-messenger

html - Rotate and preserve 3d not working -



html - Rotate and preserve 3d not working -

the animation working #sun rotate not preserve 3d if stop animation rotate , preserve 3d work. how create work animation , rotations ?

html:

<div class="holder"> <div class="system"> <img src="image/sun.png"class="objects" id="sun"> </div></div>

css:

.holder{width:40%;height:50%;margin-left:10%;margin-top:10%;position:relative; -ms-transform:rotatex(75deg); -moz-transform:rotatex(75deg); -webkit-transform:rotatex(75deg); -webkit-transform-style: preserve-3d; -ms-transform-style: preserve-3d; transform-style: preserve-3d; } .system{ position:relative;height:100%;width:100%; -webkit-animation: orbit 5s linear infinite; -moz-animation: orbit 5s linear infinite; animation: orbit 5s linear infinite; } #sun{transform:rotatex(75deg);width:8%;height:10%;position:relative; -ms-transform:rotatex(75deg); -moz-transform:rotatex(75deg); -webkit-transform:rotatex(75deg); } @-webkit-keyframes orbit { { -webkit-transform: rotatez(0deg); } { -webkit-transform: rotatez(360deg); } }

usually when work transformation thse, think need have perspective on main div.

like:

body{ -webkit-perspective: 500px; /* chrome, safari, opera */ perspective: 500px; }

html css css3 css-animations css-transforms

ruby - DateTime to Time conversion -



ruby - DateTime to Time conversion -

i have 2 datetimes , need determine seconds between them. created like:

date_time1 = datetime.strptime("01-15-2014 01:11:12 pm", '%m-%d-%y %l:%m:%s') date_time2 = datetime.now

so this:

date_time1: 2014-01-15t01:11:12+00:00 date_time2: 2014-01-16t00:11:12+10:00

how find seconds between 2 datetimes? have tried converting time .to_time function not working me because timezone apparently not set.

any help appreciated.

thanks

to_time does work. converts both times local timezone, makes no difference when subtracting them. works:

date_time2.to_time - date_time1.to_time

your real problem you're not parsing pm, why difference ends off 12 hours! @ example

date_time1 = datetime.strptime("01-15-2014 01:11:12 pm", '%m-%d-%y %l:%m:%s') # date_time1: 2014-01-15t01:11:12+00:00

you asking 1:11 pm utc, telling date_time1 1:11 am. need add together format string

'%m-%d-%y %l:%m:%s %p'

here's illustration timezone if you're still skeptical.

d1 = datetime.now #<datetime: 2014-06-18t11:47:22-04:00 ((2456827j,56842s,704352659n),-14400s,2299161j)> d1.to_time - datetime.strptime("06-18-2014 03:47:00 pm", '%m-%d-%y %l:%m:%s %p').to_time # 22.704352659

note 3:47 pm utc 11:47 in utc-4 (the timezone of d1), ~22 seconds right answer.

edit

if, however, want alter them in same timezone before calculating offset, can following:

date_time2.to_time - (date_time1 - date_time2.offset).to_time

ruby datetime time

Java instanceof on interface -



Java instanceof on interface -

i have next code dealing command line options:

i have these classes:

public enum dwelltimeoptions implements idwelltimeoptions{ public dwelltimeoptions findoption(string s){ homecoming null; } } public interface idwelltimeoptions extends ioptions{ public void compare(recontoolcompare rtc) throws recontoolexception; } public interface ioptions { public ioptions findoption(string s); }

the problem firstoption variable below doesn't appear instanceof ioptions, though believe should be.

object firstoption = null; seek { firstoption = class.forname("com.nim.tools.options." + capitalize(args.get(0)) + "options"); } grab (classnotfoundexception e) { // todo auto-generated grab block e.printstacktrace(); } if(firstoption instanceof ioptions){ secondoption = ((ioptions) firstoption).findoption(args.get(1).substring(1)); } else{ recontool.logerror("unrecognized option: \"" + args.get(0) + "\""); recontool.printoutoptions(); system.exit(0); }

firstoption variable "class com.nim.tools.options.dwelltimeoptions" , dwelltimeoptions class implements idwelltimeoptions extends ioptions...so dwelltimeoptions should instance of ioptions.

actually, think realized problem. firstoption variable class object , can't used in instanceof context , can't compared interface such ioptions?

class#forname returns instance of class<?>, in code:

firstoption = class.forname("com.nim.tools.options." + capitalize(args.get(0)) + "options");

if argument pass in args.get(0) i , have ioptions, firstoption same class<ioption> , not instance of object implements ioption interface.

firstoption variable class object , can't used in instanceof context , can't compared interface such ioptions

yes, assumption right.

java interface

html - Using @font-face to implement custom fonts multiple times in web page -



html - Using @font-face to implement custom fonts multiple times in web page -

i using @font-face utilize custom fonts

@font-face { font-family: 'simpletext'; src: url('myriadpro-regular.woff') format('woff'); }

now when want utilize doing

<p style="font-family:simpletext ;">lorem ipsum dummy text </p> <span style="font-family:simpletext ;">lorem ipsum dummy text</span>

now instead of repeating guide me how can define class rule , reuse

<p class="simpletext"></p>

this regular css. please check tutorial or similar. not apply @font-face

<style> .your-class { font-family:"simpletext"; } </style> <p class="your-class">lorem ipsum dummy text </p> <span class="your-class">lorem ipsum dummy text</span>

html css fonts

java - Variable is null at super call -



java - Variable is null at super call -

i'm using java 7 , got 3 classes:

testsuper.java

public abstract class testsuper { public testsuper() { testmethod(); } protected abstract void testmethod(); }

testnull.java

public class testnull extends testsuper { private string test = "test"; public testnull() { super(); system.out.println(test); } @override protected void testmethod() { system.out.println(test); } }

testmain.java

public class testmain { public static void main(string[] args) { new testnull(); } }

output:

null test

why happen , there workaround it?

when phone call new testnull(); you're calling constructor of class testnull, calls super() constructor: contains phone call method implemented in testnull, print string field, @ time fields of sub-class testnull not yet initialized, i.e. null.

after super constructor call, fields initialized, , hence sec print show new value of (initialized) string.

the key point here fields of sub-class initialized after instantiation of super-classes.

a workaround? depends on exact behaviour desire: maybe makes sense not phone call abstract method in super constructor (i.e. in constructor of testsuper class).

java nullpointerexception null superclass super

jquery - my add function chage in counter value but it's not reflecting on ui , when calling it from index view button add why ? angularjs -



jquery - my add function chage in counter value but it's not reflecting on ui , when calling it from index view button add why ? angularjs -

firstcontroller.js

function firstcontroller($scope) { $scope.$apply(function () { $scope.add = function (amount) { $scope.counter += amount; } });}

its view **addtion.html**

<div ng-controller="firstcontroller"> <h4>the simplest add</h4> <button ng-click="add(1)" class="button">add</button> <h4>current count: {{ counter }}</h4> </div>

its working when calling above view

button link on index view outside view following

index view index.html

<button ng-controller="firstcontroller" ng-click=" add(1);">add</button>

this above button on main view.. alter in counter not reflecting in ui why??

every time declare ng-controller creates new scope. separate instances of same controller type.

if want them share counter utilize $rootscope, shared service or emit/broadcast events, example.

you can read more here: using same controller on different elements refer same object

jquery angularjs

android - Disabling children of framelayout that contains a scrollView -



android - Disabling children of framelayout that contains a scrollView -

i have custom framelayout contains scroll view 1 of elements. want disable children of scrollview , doesnt seem working

i calling method in onlayout of framelayout

private void disabledescendants(viewgroup v) { (int = 0; < v.getchildcount(); i++) { if (v.getchildat(i) instanceof viewgroup) { disabledescendants((viewgroup) v.getchildat(i)); } v.setenabled(false); v.setfocusable(false); v.setfocusableintouchmode(false); } }

yet edittextss in scrollview , , scrollview don't seem disabled. can click on them bring keyboard up.

how can create them disabled?

why getchildcount() might not work : android: difference between getcount() , getchildcount() in listview

try :

scrollview scrollview = (scrollview) findviewbyid(r.id.scrollview); ( int = 0; < scrollview.getchildcount(); i++ ){ view view = scrollview.getchildat(i); view.setenabled(false); }

android scrollview

c# - Trying to get the first record for each MemID in this LINQ Query -



c# - Trying to get the first record for each MemID in this LINQ Query -

i have linq query, working, below. problem repeating memids. how can first memid query in single database trip? using sql server 2008 r2 backend database, , c# programming language.

var query = (from m in e.memberships m.memid != null && (sqlfunctions.stringconvert((double)m.memid).contains(memidorname) || m.name.contains(memidorname)) select new { m.memid, name = m.name.trimend(), m.city, m.state, m.systemid, systemname = m.systemname.trimend() }) .distinct() .orderby(s => s.name) .thenby(s => s.companyid) .thenby(s => s.city) .thenby(s => s.memid); var = query.skip(startrowindex).take(maximumrows).tolist();

group on value , select out 1 item group. if don't care which, can grab first. if want particular one, can re-order them before taking first item.

so replace distinct with;

//everything before `distinct` .groupby(s => s.memid) .select(group => group.firstordefault())//or other query 1 item in grouping //rest of query

c# sql-server linq

android - Resizing Bitmap after Loading it with Universal Image Loader -



android - Resizing Bitmap after Loading it with Universal Image Loader -

i loading image universal image loader, , i'd scale width width of screen , height scaled accordingly, meaning before load image know width want, not height. when load image want height , width of image , utilize scale according width of screen. code utilize this:

try { display.getsize(size); scaledwidth = size.x; } grab (java.lang.nosuchmethoderror ignore) { scaledwidth = display.getwidth(); } string filepath = "file://" + getbasecontext().getfilesdir().getpath().tostring() + "/" + imagepath + ".png"; bitmap bitmap = imageloader.loadimagesync(filepath); int height = bitmap.getheight(); int width = bitmap.getwidth(); scaledheight = (int) (((scaledwidth * 1.0) / width) * height); //code resize bitmap using scaledwidth , scaledheight

what's best way resize bitmap using universal image loader, or better, there way can specify width , bitmap scaled based on it's proportions?

you needn't yourself. consider using imagescaletype.exactly

new displayimageoptions.builder().imagescaletype(imagescaletype.exactly)

https://github.com/nostra13/android-universal-image-loader/blob/master/library/src/com/nostra13/universalimageloader/core/assist/imagescaletype.java

android bitmap universal-image-loader

Download Artifacts from Bamboo Ondemand -



Download Artifacts from Bamboo Ondemand -

i trying build , deploy .net web application using bamboo ondemand. built struggling find way deploy artifacts 1 of our internal server. , cant open firewall.

i tried bamboo cli's getartifact command download specified file, not entire package. not find way zip artifacts ondemand utilize above command.

if has overcome similar situation, please help. clue/advise appreciated. thanks.

there few ways accomplish this, here couple. both options require have zip tool available on server zipping. utilize 7za.exe (command line version of 7zip)

this file checked repository bamboo downloads sources , can access scripts or msbuild

1 - add together script task after build task. run powershell inline script similar this:

start-process -filepath "bamboo.build.working.directory\7za.exe" -argumentlist "a","pathtoyourarchive.zip", "foldertozip\*" -nonewwindow -wait

add script task zips build output, , drops in location configure build artifact.

2 - customize release build configuration in msbuild zipping

modify .csproj file, , uncomment afterbuild target. utilize exec task launch 7za, or utilize custom task such msbuild extension pack

1 faster option, best practice set scripting ps1 file source controlled, , modify script phone call ps1 file. way can version build code.

bamboo jira-ondemand

javascript - Syntax for changing FancyBox close button into submit button -



javascript - Syntax for changing FancyBox close button into submit button -

what syntax adding helper function fancybox’s fancyapps2 close button turn submit button?

i need add together following:

input type="submit" name="whereto" value=""

current fancybox function

$(function () { $(".fancybox_iframe").fancybox({ type: 'iframe', padding: 0, scrolling: 'no', width: 840, minheight: 150, height: 615, closebtn: true, helpers: { overlay: { closeclick: false, opacity: .5} }, aftershow: function () { $("a.fancybox-close").attr("title", null); }, afterclose: function () { parent.close_field('notice'); parent.closeiframe_redirect('index.php'); } }); });

you can create utilize of aftershow method of it:

aftershow: function () { var input = $('<input />', { type : "submit", name : "whereto", value : "" }); $("a.fancybox-close").replacewith(input); },

javascript jquery fancybox-2 submit-button

sql - Multirow return Query MSACCESS -



sql - Multirow return Query MSACCESS -

i need run query returns events has electrophysiology study don't have %ablation% in case should receive events 608 , 612. table has 2 columns ss_event_ep_id , studyprocedure

screenshot of tables https://plus.google.com/photos/105880715521229058253/albums/6026235567691005409/6026235568072337762

i saw tables. yes correct, need subquery.

what need exists operator well.

select ep.ss_event_ep_id, ep.studyprocedure, event_ep.eventdate event_ep inner bring together ep_procedure ep on event_ep.ss_event_ep_id = ep.ss_event_ep_id ep.studyprocedure = "electrophysiology study" , (event_ep.eventdate between #1/1/2004# , #12/31/2012#) , not exists ( select ss_event_ep_id ep_procedure ep_i ep_i.ss_event_ep_id = ep.ss_event_ep_id , ep_i.studyprocedure "%blation%" )

sql multirow

file - How to display pictures from all subdirectories within a parent directory? (Java & Netbeans) -



file - How to display pictures from all subdirectories within a parent directory? (Java & Netbeans) -

i'm writing slideshow allows pictures shows deleted, edited or ignored displayed. it's working fine except when directory it's been pointed contains subfolders. in case code search through subfolders , display images within them. @ moment subfolders ignored , null pointer exception thrown, though images in main directory read , displayed. relevant section of code:

string files; file folder = new file(path); //loads folder file[] listoffiles = folder.listfiles(); //assigns filenames array (int = 0; < listoffiles.length; i++) { //some code here deals graphics random randomgenerator = new random(); //initiates random generator int randomint = randomgenerator.nextint(listoffiles.length); //limits max random lenth of folder array files = listoffiles[randomint].getname(); //chooses filename based on random number final string fileid = "file:///" + path + "\\" + files; //creates path display currentfile = path + "\\" + files; //assigns filename variable ready deletion later }

i need treat these more discrete images rather printing out list of them. i've excluded code here snippet deals painting screen (g.drawimage).

if suggests apache commons io fileutils, kind plenty explain how go downloading, installing , importing right libraries, i've been having problem achieving (if works). prefer solution doesn't require non-standard libraries. have read do-able in java 8 (which i'm using) i've not been able find relevant examples.

i apologise if turns out duplicate question, i've been unable find similar illustration quite matches these requirements. other examples seem content list files, rather perform action them.

many in advance.

java file netbeans graphics folders

c# - Data at the root level is invalid RSS feed with web api and wpf xmldataprovider -



c# - Data at the root level is invalid RSS feed with web api and wpf xmldataprovider -

i'm trying set rss feed using syndicate feed object homecoming wpf application uses xmldataprovider. maintain getting

data @ root level invalid>

here's current code rss feed. shows fine in browser xml.

[route("test")] public rss20feedformatter get() { var feed = new syndicationfeed("test feed", "this test feed", new uri("http://google.com")); feed.categories.add(new syndicationcategory("test")); feed.description = new textsyndicationcontent("this test feed see how easy is"); var test = new syndicationitem("blah.blah@test.com", "this note", new uri("http://google.com"), "blah.blah@test.com", datetime.now); test.categories.add(new syndicationcategory("person")); test.authors.add(new syndicationperson("test@test.com")); var items = new list<syndicationitem> {test}; feed.items = items; homecoming new rss20feedformatter(feed, false); }

and xaml code:

<window x:class="rssreader.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <window.resources> <xmldataprovider source="http://localhost:8080/api/test/" x:key="xdata" xpath="//item"></xmldataprovider> </window.resources> <grid> <listbox itemssource="{binding source={staticresource xdata}}"> </listbox> </grid>

i've tried microsoft feeds: http://www.microsoft.com/en-us/news/rss/rssfeed.aspx?contenttype=pressreleases , works mine error

edit here's xml returned api

<rss version="2.0"> <channel> <title>test feed</title> <link>http://google.com/</link> <description>this test feed see how easy is</description> <category>test</category> <item> <guid ispermalink="false">blah.blah@test.com</guid> <link>http://google.com/</link> <author>test@test.com</author> <category>person</category> <title>blah.blah@test.com</title> <description>this note</description> </item> </channel> </rss>

so turns out rss20feedformatter doesn't set xml tags @ top of rss stream, dataprovider fails read it.

instead, going write formatter xmlwriter , add together tags in way

edit i've added code below how achieved. bit of mess around utf encoding correct.

[route("test")] public httpresponsemessage get() { var feed = new syndicationfeed("test feed", "this test feed", new uri("http://google.com")); feed.categories.add(new syndicationcategory("test")); feed.description = new textsyndicationcontent("this test feed see how easy is"); var test = new syndicationitem("blah.blah@test.com", "this note", new uri("http://google.com"), "blah.blah@test.com", datetime.now); test.categories.add(new syndicationcategory("person")); test.authors.add(new syndicationperson("blah@blah.com")); var test2 = new syndicationitem("blah.blah@test2.com", "this note", new uri("http://google.com"), "blah.blah@test2.com", datetime.now); test2.categories.add(new syndicationcategory("person")); test2.authors.add(new syndicationperson("blah@blah.com")); var items = new list<syndicationitem> { test, test2 }; feed.items = items; var formatter = new rss20feedformatter(feed); var output = new memorystream(); var xws = new xmlwritersettings {encoding = encoding.utf8}; using (var xmlwriter = xmlwriter.create(output, xws)) { formatter.writeto(xmlwriter); xmlwriter.flush(); } string xml; using (var sr = new streamreader(output)) { output.position = 0; xml = sr.readtoend(); sr.close(); } var response = new httpresponsemessage(httpstatuscode.ok) { content = new stringcontent(xml, encoding.utf8, "application/xml")}; homecoming response; }

c# wpf xaml rss web-api

python - unexpected TypeError: unsupported operand type(s) for +=: 'int' and 'str' -



python - unexpected TypeError: unsupported operand type(s) for +=: 'int' and 'str' -

the task write programme asks user come in total rainfall each of 12 months. inputs stored in list. programme should calculate , display total rainfall year, average monthly rainfall, , months highest , lowest amounts.

i supposed using loop loops 20 times , appends each score list after entered. please maintain in mind beginner. here's code far:

def main(): months = [0] * 12 name_months = ['jan','feb','mar','apr','may','jun', \ 'jul','aug','sep','oct','nov','dec'] def total(months): total = 0 num in months: total += num homecoming total index in range(12): print('please come in amount of rain in') months[index] = input(name_months[index] + ': ') print('the total is'), total(months),'mm.' avarage = total(months) / 12.0 print('the avarage rainfall is'), avarage,'mm.' main()

this must python 3. have convert user input numbers instead of strings:

# sets months[index] string months[index] = input(name_months[index] + ': ')

should be:

# sets months[index] (floating-point) number months[index] = float(input(name_months[index] + ': '))

python loops python-3.x

sql server - Several cursors at once -



sql server - Several cursors at once -

there table #costs (id,tree_id,date,value) holds info calling sp exec sp @tree_id,@date,@value output in order calculate complex service routine identified tree_id. in order set @value cursor used. how create several cursors working same #costs table? many rows in costs -> cursor sp runs long. cannot turn inline function or simplify sp logic has many internal sp callings, temporary inserts/updates etc. way parallel cursors? can avoid using agent jobs or service broker?

since have given question without (imo) plenty detail, sick give general solution have used in past similar problem. divided workload 'buckets', called several stored procedures run workload against given bucket. in case used separate powershell instances execute sps because moving lot of log files around, agent jobs job. create sure of course of study each 'bucket' can processed independently.

performance did increase, maintain eye out lock , latch activity , other bottlenecks, in case found there point of diminishing returns, 1 core per bucket seemed work me.

if willing work .net option, if dont want set jobs in agent: sqlcommand.beginexecutenonquery http://msdn.microsoft.com/en-us/library/7b6f9k7k%28v=vs.110%29.aspx

sql-server multithreading stored-procedures sql-server-2008-r2 cursor

Android - ProgressBar setVisibility to GONE not working -



Android - ProgressBar setVisibility to GONE not working -

i've been adding progressbar fragments in app. i've set 2 main fragments (used tabs) follows:

progressbar in activity_main.xml:

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/fragment_container" android:layout_width="match_parent" android:layout_height="match_parent"> <progressbar android:id="@+id/progressbar1" style="?android:attr/progressbarstylelarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_centervertical="true" /> </relativelayout>

setting progressbar visible , gone:

spinner = (progressbar)getactivity().findviewbyid(r.id.progressbar1); spinner.setvisibility(view.visible); spinner.setvisibility(view.gone);

this works without problems. i've tried add together progressbar fragment has webview:

progressbar in fragment_article.xml:

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="info.androidhive.slidingmenu.articlefragment$placeholderfragment" > <webview android:id="@+id/webpage" android:layout_height="wrap_content" android:layout_width="wrap_content"/> <progressbar android:id="@+id/progressbar1" style="?android:attr/progressbarstylelarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_centervertical="true" /> </relativelayout>

setting visibility:

spinner = (progressbar)getactivity().findviewbyid(r.id.progressbar1); spinner.setvisibility(view.visible); spinner.setvisibility(view.gone);

setting visibility same way previous code reason not setting progressbar gone. not sure what's wrong.

i've tried using clearanimation suggested here android, setvisbility gone not working in relativelayout still nothing.

spinner.clearanimation(); spinner.setvisibility(view.gone);

check code:

spinner = (progressbar)getactivity().findviewbyid(r.id.progressbar1);

if using fragments should this:

spinner = (progressbar)viewiinflated.findviewbyid(r.id.progressbar1);//same case dialogs

if using activity then:

spinner = (progressbar)findviewbyid(r.id.progressbar1);

android android-fragments progress-bar android-spinner

visual studio - how to extend Expiration date for test certificate -



visual studio - how to extend Expiration date for test certificate -

in visual studio click 1 time publishing utilize test certificate sign mainfest expire after 1 year.

how can extent expiration date?

if you're after quick solution, can "renew" existing certificate , give longer expiry date.

cliff stanford has cleaned microsoft "workaround" , made available simple command line exe - available here: http://may.be/renewcert/ - nice work cliff !

how can renew expired clickonce certificate?

visual-studio clickonce publishing

java - Is it better to specify HashMap's initial capacity when it is not a power of 2 than to not specify at all? -



java - Is it better to specify HashMap's initial capacity when it is not a power of 2 than to not specify at all? -

suppose know exact number of key-value pairs go in hashmap , know not powerfulness of 2. in these cases, should specify initial capacity or not ? nearest powerfulness of 2 , specify still i'd know improve thing in such cases (when don't want calculate nearest powerfulness of 2).

thanks!

you should consider initial capacity hint hashmap of approximately info expect. providing right initial capacity, minimize number of times map has rebuilt in order scale up. if, instance, knew planning insert 1000000 records, constructing map 1,000,000 initial capacity, ensure, @ construction time, allocate plenty memory handle many inserts. after point, future inserts map may require big o(n) operation during map.put() phone call in order resize.

thinking of initial capacity hint, rather instruction expect hashmap follow, may help see optimization you're describing unnecessary. hashmap designed behave in normal circumstances, , while providing initial capacity can help marginally, it's not going have huge impacts on code unless building many new big maps time. in such case specifying capacity avoid intermediate table resizing, that's all.

as documented, introduce unnecessary slowdowns if specified too big of initial capacity:

iteration on collection views requires time proportional "capacity" of hashmap instance

however in practice wasted memory of allocating such big maps cause problems sooner slower iteration speed.

be sure read why hashmap require initial capacity powerfulness of two? well.

one thing might consider switching guava's immutablemap implementation; if know in advance contents of map, , don't expect alter them, immutable collections prove easier work , use less memory mutable counterparts.

here's quick inspections did using scala's repl (and personal utility functions) inspect what's going on within hashmap (java 1.7):

// initialize capacity=7 scala> new hashmap[string,string](7) res0: java.util.hashmap[string,string] = {} scala> getprivate(res0, "table").length res1: int = 8 scala> ... set 7 values // still internally using same array scala> getprivate(res0, "table").length res9: int = 8 // specifying capacity 9 allocates 16-lenth array scala> getprivate(new hashmap[string,string](9), "table").length res10: int = 16 // copying our first map new map interestingly // allocates default 16 slots, rather 8 scala> getprivate(new hashmap[string,string](res0), "table").length res11: int = 16 scala> ... set 10 more values in our map scala> getprivate(res0,"table").length res22: int = 32 // copying 1 time again jumps 32 capacity scala> getprivate(new hashmap[string,string](res0),"table").length res23: int = 32

java hashmap java-6

javascript - adding item to attribute with checkbox -



javascript - adding item to attribute with checkbox -

i have got list of div predefined data-groups. add together data-groups item called "my" jquery means of check sign in checkbox (and remove uncheck).

<div class="item yellow" data-kpi="one" data-res="9" data-ref="3" data-groups='["all", "numbers", "red", "square"]'><input type="checkbox" name="add" value="my" /></div> <div class="item yellow" data-kpi="two" data-res="9" data-ref="3" data-groups='["all", "numbers", "green", "circel"]'><input type="checkbox" name="add" value="my" /></div>

try this. see fiddle demo , watch console

$("input[type=checkbox]").click(function() { if($(this).is(":checked")){ $(this).parent().data("groups").push("my"); console.log($(this).parent().data("groups")) } else{ $(this).parent().data("groups").pop(); console.log($(this).parent().data("groups")) } });

demo

javascript jquery html5

python - Simplejson django dict giving me an error -



python - Simplejson django dict giving me an error -

i have next django dictionary --

titles_to_update = title.objects.exclude( error_message__startswith="no" ).filter( is_successful=false, updatebatch__is_completed=false ).values( 'id', 'apple_id', 'promotion_start_date', 'promotion_end_date', 'sd_price_tier', 'hd_price_tier' ) # {'hd_price_tier': 101, 'sd_price_tier': 2, 'apple_id': 270201401l, 'promotion_start_date': datetime.date(2014, 6, 27), 'id': 25332l, 'promotion_end_date': datetime.date(2014, 6, 30)}...] homecoming httpresponse(simplejson.dumps(titles_to_update))

this gives me error:

[my object] not json serializable

what need here encode dict in json?

here simple function wrote convert datetime objects work simplejson:

def make_query_dict_jsonable(query_dict): list_of_objects = [] item in query_dict: info = {} field_name in title.keys(): data[field_name] = str(item[field_name]) list_of_objects.append(data) homecoming list_of_objects

python json django

exception - org.hibernate.QueryException: could not resolve property: date of: -



exception - org.hibernate.QueryException: could not resolve property: date of: -

i got exception :

org.springframework.web.util.nestedservletexception: request processing failed; nested exception org.springframework.dao.invaliddataaccessapiusageexception: org.hibernate.queryexception: not resolve property: date of:

i have next query con spring data:

@query("select c.message conversationentity c , user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid"+ " , c.message.id = um.message.id") public list<messageentity> getallmessagesbyuser (@param("userid") long userid, pageable page);

conversationentity:

@id @generatedvalue(strategy=generationtype.auto) private long id; private string text; private date createdate; /**mensaje leído o no**/ private integer isread; @manytoone(fetch=fetchtype.eager) private messageentity message;

/* @manytoone(fetch=fetchtype.eager) private userentity usersender;*/

@manytoone(fetch=fetchtype.eager) private userentity userowner;

messageentity:

@id @generatedvalue(strategy=generationtype.auto) private long id; private date createdate; @manytoone(fetch=fetchtype.eager) private messageentity message; @manytoone(fetch=fetchtype.eager) private userentity usersender;

paramater page is:

sort sort = new sort(sort.direction.desc, "createdate"); pageable page = new pagerequest(0, 10, sort);

what error?

estado http 500 - request processing failed; nested exception org.springframework.dao.invaliddataaccessapiusageexception: org.hibernate.queryexception: not resolve property: date of: com.itripping.entity.conversationentity [select c.message com.itripping.entity.conversationentity c , com.itripping.entity.user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid , c.message.id = um.message.id order c.date desc]; nested exception java.lang.illegalargumentexception: org.hibernate.queryexception: not resolve property: date of: com.itripping.entity.conversationentity [select c.message com.itripping.entity.conversationentity c , com.itripping.entity.user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid , c.message.id = um.message.id order c.date desc] type informe de excepción mensaje request processing failed; nested exception org.springframework.dao.invaliddataaccessapiusageexception: org.hibernate.queryexception: not resolve property: date of: com.itripping.entity.conversationentity [select c.message com.itripping.entity.conversationentity c , com.itripping.entity.user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid , c.message.id = um.message.id order c.date desc]; nested exception java.lang.illegalargumentexception: org.hibernate.queryexception: not resolve property: date of: com.itripping.entity.conversationentity [select c.message com.itripping.entity.conversationentity c , com.itripping.entity.user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid , c.message.id = um.message.id order c.date desc] descripción el servidor encontró united nations error interno que hizo que no pudiera rellenar este requerimiento. excepción org.springframework.web.util.nestedservletexception: request processing failed; nested exception org.springframework.dao.invaliddataaccessapiusageexception: org.hibernate.queryexception: not resolve property: date of: com.itripping.entity.conversationentity [select c.message com.itripping.entity.conversationentity c , com.itripping.entity.user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid , c.message.id = um.message.id order c.date desc]; nested exception java.lang.illegalargumentexception: org.hibernate.queryexception: not resolve property: date of: com.itripping.entity.conversationentity [select c.message com.itripping.entity.conversationentity c , com.itripping.entity.user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid , c.message.id = um.message.id order c.date desc] org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:894) org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:778) javax.servlet.http.httpservlet.service(httpservlet.java:620) javax.servlet.http.httpservlet.service(httpservlet.java:727) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:311) org.springframework.security.web.access.intercept.filtersecurityinterceptor.invoke(filtersecurityinterceptor.java:116) org.springframework.security.web.access.intercept.filtersecurityinterceptor.dofilter(filtersecurityinterceptor.java:83) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.access.exceptiontranslationfilter.dofilter(exceptiontranslationfilter.java:113) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.anonymousauthenticationfilter.dofilter(anonymousauthenticationfilter.java:113) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.servletapi.securitycontextholderawarerequestfilter.dofilter(securitycontextholderawarerequestfilter.java:54) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.savedrequest.requestcacheawarefilter.dofilter(requestcacheawarefilter.java:45) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.www.basicauthenticationfilter.dofilter(basicauthenticationfilter.java:150) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:182) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.logout.logoutfilter.dofilter(logoutfilter.java:105) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.context.securitycontextpersistencefilter.dofilter(securitycontextpersistencefilter.java:87) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.filterchainproxy.dofilter(filterchainproxy.java:173) org.springframework.web.filter.delegatingfilterproxy.invokedelegate(delegatingfilterproxy.java:346) org.springframework.web.filter.delegatingfilterproxy.dofilter(delegatingfilterproxy.java:259) org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:88) org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76) causa raíz org.springframework.dao.invaliddataaccessapiusageexception: org.hibernate.queryexception: not resolve property: date of: com.itripping.entity.conversationentity [select c.message com.itripping.entity.conversationentity c , com.itripping.entity.user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid , c.message.id = um.message.id order c.date desc]; nested exception java.lang.illegalargumentexception: org.hibernate.queryexception: not resolve property: date of: com.itripping.entity.conversationentity [select c.message com.itripping.entity.conversationentity c , com.itripping.entity.user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid , c.message.id = um.message.id order c.date desc] org.springframework.orm.jpa.entitymanagerfactoryutils.convertjpaaccessexceptionifpossible(entitymanagerfactoryutils.java:301) org.springframework.orm.jpa.vendor.hibernatejpadialect.translateexceptionifpossible(hibernatejpadialect.java:106) org.springframework.orm.jpa.abstractentitymanagerfactorybean.translateexceptionifpossible(abstractentitymanagerfactorybean.java:403) org.springframework.dao.support.chainedpersistenceexceptiontranslator.translateexceptionifpossible(chainedpersistenceexceptiontranslator.java:58) org.springframework.dao.support.dataaccessutils.translateifnecessary(dataaccessutils.java:213) org.springframework.dao.support.persistenceexceptiontranslationinterceptor.invoke(persistenceexceptiontranslationinterceptor.java:163) org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) org.springframework.data.jpa.repository.support.lockmoderepositorypostprocessor$lockmodepopulatingmethodintercceptor.invoke(lockmoderepositorypostprocessor.java:91) org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) org.springframework.aop.interceptor.exposeinvocationinterceptor.invoke(exposeinvocationinterceptor.java:90) org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:202) com.sun.proxy.$proxy40.getallmessagesbyuser(unknown source) com.itripping.service.impl.messageserviceimpl.getallmessagesbyuser(messageserviceimpl.java:85) com.itripping.web.controller.messagecontroller.getmessages(messagecontroller.java:86) sun.reflect.nativemethodaccessorimpl.invoke0(native method) sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) java.lang.reflect.method.invoke(method.java:606) org.springframework.web.method.support.invocablehandlermethod.invoke(invocablehandlermethod.java:219) org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:132) org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:100) org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlermethod(requestmappinghandleradapter.java:604) org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:565) org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:80) org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:923) org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:852) org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:882) org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:778) javax.servlet.http.httpservlet.service(httpservlet.java:620) javax.servlet.http.httpservlet.service(httpservlet.java:727) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:311) org.springframework.security.web.access.intercept.filtersecurityinterceptor.invoke(filtersecurityinterceptor.java:116) org.springframework.security.web.access.intercept.filtersecurityinterceptor.dofilter(filtersecurityinterceptor.java:83) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.access.exceptiontranslationfilter.dofilter(exceptiontranslationfilter.java:113) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.anonymousauthenticationfilter.dofilter(anonymousauthenticationfilter.java:113) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.servletapi.securitycontextholderawarerequestfilter.dofilter(securitycontextholderawarerequestfilter.java:54) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.savedrequest.requestcacheawarefilter.dofilter(requestcacheawarefilter.java:45) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.www.basicauthenticationfilter.dofilter(basicauthenticationfilter.java:150) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:182) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.logout.logoutfilter.dofilter(logoutfilter.java:105) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.context.securitycontextpersistencefilter.dofilter(securitycontextpersistencefilter.java:87) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.filterchainproxy.dofilter(filterchainproxy.java:173) org.springframework.web.filter.delegatingfilterproxy.invokedelegate(delegatingfilterproxy.java:346) org.springframework.web.filter.delegatingfilterproxy.dofilter(delegatingfilterproxy.java:259) org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:88) org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76) causa raíz java.lang.illegalargumentexception: org.hibernate.queryexception: not resolve property: date of: com.itripping.entity.conversationentity [select c.message com.itripping.entity.conversationentity c , com.itripping.entity.user_messageentity um c.userowner.id = :userid , um.usersender.id= :userid , c.message.id = um.message.id order c.date desc] org.hibernate.ejb.abstractentitymanagerimpl.convert(abstractentitymanagerimpl.java:1347) org.hibernate.ejb.abstractentitymanagerimpl.convert(abstractentitymanagerimpl.java:1288) org.hibernate.ejb.abstractentitymanagerimpl.createquery(abstractentitymanagerimpl.java:289) sun.reflect.generatedmethodaccessor25.invoke(unknown source) sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) java.lang.reflect.method.invoke(method.java:606) org.springframework.orm.jpa.extendedentitymanagercreator$extendedentitymanagerinvocationhandler.invoke(extendedentitymanagercreator.java:365) com.sun.proxy.$proxy27.createquery(unknown source) sun.reflect.generatedmethodaccessor25.invoke(unknown source) sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) java.lang.reflect.method.invoke(method.java:606) org.springframework.orm.jpa.sharedentitymanagercreator$sharedentitymanagerinvocationhandler.invoke(sharedentitymanagercreator.java:240) com.sun.proxy.$proxy27.createquery(unknown source) org.springframework.data.jpa.repository.query.simplejpaquery.docreatequery(simplejpaquery.java:102) org.springframework.data.jpa.repository.query.abstractjpaquery.createquery(abstractjpaquery.java:144) org.springframework.data.jpa.repository.query.jpaqueryexecution$collectionexecution.doexecute(jpaqueryexecution.java:77) org.springframework.data.jpa.repository.query.jpaqueryexecution.execute(jpaqueryexecution.java:55) org.springframework.data.jpa.repository.query.abstractjpaquery.doexecute(abstractjpaquery.java:95) org.springframework.data.jpa.repository.query.abstractjpaquery.execute(abstractjpaquery.java:85) org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.invoke(repositoryfactorysupport.java:313) org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) org.springframework.transaction.interceptor.transactioninterceptor.invoke(transactioninterceptor.java:110) org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) org.springframework.dao.support.persistenceexceptiontranslationinterceptor.invoke(persistenceexceptiontranslationinterceptor.java:155) org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) org.springframework.data.jpa.repository.support.lockmoderepositorypostprocessor$lockmodepopulatingmethodintercceptor.invoke(lockmoderepositorypostprocessor.java:91) org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) org.springframework.aop.interceptor.exposeinvocationinterceptor.invoke(exposeinvocationinterceptor.java:90) org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:172) org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:202) com.sun.proxy.$proxy40.getallmessagesbyuser(unknown source) com.itripping.service.impl.messageserviceimpl.getallmessagesbyuser(messageserviceimpl.java:85) com.itripping.web.controller.messagecontroller.getmessages(messagecontroller.java:86) sun.reflect.nativemethodaccessorimpl.invoke0(native method) sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) java.lang.reflect.method.invoke(method.java:606) org.springframework.web.method.support.invocablehandlermethod.invoke(invocablehandlermethod.java:219) org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:132) org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:100) org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlermethod(requestmappinghandleradapter.java:604) org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:565) org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:80) org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:923) org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:852) org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:882) org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:778) javax.servlet.http.httpservlet.service(httpservlet.java:620) javax.servlet.http.httpservlet.service(httpservlet.java:727) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:311) org.springframework.security.web.access.intercept.filtersecurityinterceptor.invoke(filtersecurityinterceptor.java:116) org.springframework.security.web.access.intercept.filtersecurityinterceptor.dofilter(filtersecurityinterceptor.java:83) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.access.exceptiontranslationfilter.dofilter(exceptiontranslationfilter.java:113) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.anonymousauthenticationfilter.dofilter(anonymousauthenticationfilter.java:113) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.servletapi.securitycontextholderawarerequestfilter.dofilter(securitycontextholderawarerequestfilter.java:54) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.savedrequest.requestcacheawarefilter.dofilter(requestcacheawarefilter.java:45) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.www.basicauthenticationfilter.dofilter(basicauthenticationfilter.java:150) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:182) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.authentication.logout.logoutfilter.dofilter(logoutfilter.java:105) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.context.securitycontextpersistencefilter.dofilter(securitycontextpersistencefilter.java:87) org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:323) org.springframework.security.web.filterchainproxy.dofilter(filterchainproxy.java:173) org.springframework.web.filter.delegatingfilterproxy.invokedelegate(delegatingfilterproxy.java:346) org.springframework.web.filter.delegatingfilterproxy.dofilter(delegatingfilterproxy.java:259) org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:88) org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:76) causa raíz

hibernate exception

iphone - UIViewcontroller is not presented in correct orientation -



iphone - UIViewcontroller is not presented in correct orientation -

i presenting view controller view controller using presentviewcontroller.

the presenting view controller (the "sourceviewcontroller") creates new view controller , assigns navigation controller before presentation (because "nextviewcontroller" wants navigation bar , navigation controller).

// source view controller @implementation sourceviewcontroller -(void)shownextviewcontroller { nextviewcontroller *viewcontroller = [[nextviewcontroller alloc] init]; uinavigationcontroller *navcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:viewcontroller]; [self presentviewcontroller:viewcontroller animated:yes]; } @end @implementation nextviewcontroller // in nextviewcontroller - (nsuinteger)supportedinterfaceorientations { homecoming uiinterfaceorientationportrait; } - (uiinterfaceorientation)preferredinterfaceorientationforpresentation { homecoming uiinterfaceorientationportrait; } @end

but when nowadays view controller when originating view controller in landscape "nextviewcontroller" isn't presented in portrait rather in landscape source view controller.

i've tried many combinations of rotation methods haven't been able nowadays in right orientation.

i assume possible because many apple components uiimagepickercontroller presented in portrait , how forcefulness orientation?

thanks

edit:

i've created uinavigationcontroller sub class:

portraitnavigationcontroller : uinavigationcontroller @implementation -(bool)shouldautorotate { homecoming no; } - (uiinterfaceorientation)preferredinterfaceorientationforpresentation { homecoming uiinterfaceorientationportrait; } @end

and when presenting nextviewcontroller

portraitnavigationcontroller *nav = [portraitnavigationcontroller initwithrootviewcontroller:nextviewcontroller]; [self presentviewcontroller:nav animated:yes];

and nextviewcontroller indeed in portrait - when rotate device utilize view controller , dismiss - underlying source view controller looks messed up.

the underlying view controller custom container view controller embedded in uinavigationcontroller

the containers uses display kid view controllers not in right places

i don't want container view controller rotate @ nextviewcontroller displayed , dismissed.

when rotate device presented view controller asked rotations , orientations supports - in case it's uinavigationcontroller , not instance of nextviewcontroller. 1 way prepare subclass uinavigationcontroller , override rotation methods , forwards calls onto it's root view.

as side not uiimagepickercontroller subclass of uinavigationcontroller. might create more sense create nexviewcontroller subclass of uinavigationcontroller , within subclass initialize right root view controller.

another alternative alloc , init uinavigationbar within of nextviewcontroller , add together subview if don't need utilize navigation controller anything. in case autolayout comes in handy because can pin top, left, , right , allow figure out right size , location it.

iphone objective-c uiviewcontroller uinavigationcontroller uiinterfaceorientation

z index - Prevent box shadow from showing on top of another element -



z index - Prevent box shadow from showing on top of another element -

i have been trying create section , article appears article sitting on top of section using box shadows. problem blur of section spreading onto article (when want box shadow of article spreading onto section). i've been trying utilize z-index position article higher section i've seen working in many other answered questions nil seems working , can't life of me, figure out why. avoid white box shadow method because more effect within article method works great. here jsfiddle play around with. help much obliged. thanks.

basic html setup:

<article>article<br />article<br />article<br />article<br />i dont want box shadow of section overlapping box here \/</article> <section>section<br />section<br />section<br />section<br />section<br />section<br />section<br />section<br />section</section>

css:

article { position: relative; z-index: 0; width: 600px; margin: 100px auto 0; padding: 20px; border: orange 1px solid; box-shadow: 0 0 100px 1px orange; } section { position: relative; z-index: -1; width: 400px; margin: 0 auto; padding: 20px; border: orange 1px solid; box-shadow: 0 0 100px 1px orange; border-top: none; }

demo

z-index's have effect on positioned elements. give article , section position position: relative.

you still see box-shadow through article thought because it's background transparent. give article background colour background: #fff

article { width: 600px; border: orange 1px solid; box-shadow: 0 0 100px 1px orange; padding: 20px; margin: 100px auto 0; z-index: 0; position: relative; background: #fff; } section { width: 400px; border: orange 1px solid; box-shadow: 0 0 100px 1px orange; border-top: none; padding: 20px; margin: 0 auto; z-index: -1; position: relative; }

z-index css3

ios - Error: implementing a method which will also be implemented by its primary class -



ios - Error: implementing a method which will also be implemented by its primary class -

this coding error part app

- (id)initwithdata:(nsdata *)data <-------- options:(nsuinteger)options error:(nserror **)error { homecoming [self initwithdata:data content:xmldocument options:options error:error

but on first line comes 'category implementing method implemented primary class'. mean , how prepare it.

category in obj-c supposed add together methods base of operations class. not replace existing functionality. can't declare there methods same signature exist.

if want override existing method (initwithdata:...), should utilize inheritance, don't need category. if not - alter method name, allow instance:

- (id)initwithxmldata:(nsdata *)data options:(nsuinteger)options error:(nserror **)error

ios objective-c

google analytics - Is there an API to retrieve Sites usage quota -



google analytics - Is there an API to retrieve Sites usage quota -

i found adminreports.customerusagereports.get(date) function can homecoming usage reports such gmail, drive , g+. there api can retrieve sites usage?

it's not in admin sdk. first, collect sites usage, setup google analytics https://support.google.com/sites/answer/97459?hl=en on site(s). utilize google analytics via ui or api https://developers.google.com/analytics/ or apps script https://developers.google.com/apps-script/advanced/analytics retrieve usage data.

google-analytics google-analytics-api google-admin-sdk

wcf - Continuous Deployment multiple projects from one solution c# -



wcf - Continuous Deployment multiple projects from one solution c# -

i have 1 solution multiple projects inside:

project1 - class library project2 - mvc project3 - class library project4 - wcf

i want tfs build projects automatically deploy mvc project http://somehost/mvc , wcf http://somehost/wcf.

i have tried alter build definition mvc gets deployed.

by way: gated check-in enabled on tfs.

i had exact issue, , solved manually editing project files.

this way tfs deploy both projects on build. note build configuration names - i've created these tfs build definitions point @ (i have 2 build definitions: dev & qa). applying propery grouping these definitions mean projects don't deployed every time build projects in dev environment when running debug config. means can deploy different locations depending on whether i'm running qa or dev build.

example:

<propertygroup condition="'$(configuration)|$(platform)' == 'dev-build-|anycpu'"> <debugsymbols>true</debugsymbols> <debugtype>full</debugtype> <optimize>false</optimize> <outputpath>bin\</outputpath> <defineconstants>debug;trace</defineconstants> <errorreport>prompt</errorreport> <warninglevel>4</warninglevel> <deployonbuild>true</deployonbuild> <deploytarget>msdeploypublish</deploytarget> <msdeploypublishmethod>remoteagent</msdeploypublishmethod> <msdeployserviceurl>http://dev-server-address</msdeployserviceurl> <deployiisapppath>projectminder.api-maintenance</deployiisapppath> <username><machine-name>\builduser</username> <password>*****</password> <authtype>basic</authtype> <allowuntrustedcertificate>true</allowuntrustedcertificate> </propertygroup> <propertygroup condition="'$(configuration)|$(platform)' == 'qa-build|anycpu'"> <debugtype>pdbonly</debugtype> <optimize>true</optimize> <outputpath>bin\</outputpath> <defineconstants>trace</defineconstants> <errorreport>prompt</errorreport> <warninglevel>4</warninglevel> <deployonbuild>true</deployonbuild> <deploytarget>msdeploypublish</deploytarget> <msdeploypublishmethod>remoteagent</msdeploypublishmethod> <msdeployserviceurl>http://qa-server-address</msdeployserviceurl> <deployiisapppath>projectminder.api</deployiisapppath> <username><machine-name>\builduser</username> <password>*****</password> <authtype>basic</authtype> <allowuntrustedcertificate>true</allowuntrustedcertificate> </propertygroup>

update:

i should add together solution vs2010. believe in newer versions (2012+) can define publish profiles per project (.pubxml) tfs pick up.

c# wcf asp.net-mvc-4 tfs continuous-deployment

knockout.js - KnockoutJS Mapping toJS ignore nested keys -



knockout.js - KnockoutJS Mapping toJS ignore nested keys -

can not ignore nested properties when using tojs in knockoutjs' mapping plugin?

example:

var obj = { "akey": { "anestedkey": "ignore", "anotherkey": "value" } }; console.log(ko.mapping.tojs(obj, { "ignore": ["akey.anestedkey"], }));

expected output

{ akey: { anotherkey: "value" } }

actual output is

{ akey: { anestedkey: "ignore" anotherkey: "value" } }

jsfiddle: http://jsfiddle.net/48kvu/

it works if remove parent (if know key unique in obj or if want remove occurences):

var obj = { "akey": { "anestedkey": "ignore", "anotherkey": "value" } }; console.log(ko.mapping.tojs(obj, { "ignore": ["anestedkey"], //here }));

http://jsfiddle.net/gabrieltran/48kvu/1/

knockout.js knockout-mapping-plugin

windows azure virtual machine hard drive full -



windows azure virtual machine hard drive full -

i have virtual machine running windows on microsoft windows azure. noticing 1 of hard drives shows full. these drives automatically expand info added, or need increment storage, , if so--how?

thanks tips.

in azure, both os disk , attached info disks fixed format vhds. not resized automatically and, in fact, there no supported process modify size. since these disks allocated using sparse storage - i.e., billed space used - general recommendation utilize 1tb disks. if disk empty not billed.

windows server 2012 provides trim back upwards clears space occupied in azure storage deleted files. without back upwards there still charge files have been deleted filesystem still occupy pages in page blob backing vhd in azure storage.

martin balliauw has written instructions modifying size of vhd in azure. has created utility helps task. comes @ own risk warning.

azure virtual-machine windows-azure-storage

Merging and manipulating JSON arrays in ruby -



Merging and manipulating JSON arrays in ruby -

in model i'm getting 2 json arrays both facebook's , twitter's api.

facebook_friends = { "data": [{"name": "friend joe", "id": "123"}, {"name": "friend jane", "id": "12342"}]} twitter_friends = { "users": [{"name": "other friend joe", "id": "333"}, {"name": "other friend jane", "id": "456"}]}

and want build array (nb: i'm appending provider key identify source of data)

all_friends = [ {"name": "friend joe", "id": "123", "provider": "facebook"}, {"name": "friend jane", "id": "12342", "provider": "facebook"}, {"name": "other friend joe", "id": "333", "provider": "twitter"}, {"name": "other friend jane", "id": "456", "provider": "twitter"}]

i can jquery -> http://jsfiddle.net/gm3jj/ how do in ruby? thanks

if want combine stuff, can this:

# array of friends each service , add together provider fb = json.parse(facebook_friends)["data"].map {|x| x["provider"] = "facebook"} tw = json.parse(twitter_friends)["users"].map {|x| x["provider"] = "twitter"} # concatenate them 1 array fb + tw

ruby-on-rails ruby ruby-on-rails-4

c# - How to create a custom DbSet -



c# - How to create a custom DbSet -

how create custom dbset used in our context,

here ferived dbset code sample provided below.

in context have:

public customdbset<items> mydbset { get; set; }

any time reach "context.mydbset" it's null, changing simple dbset work , it's initialized,

public class customdbset<tentity> : dbset<tentity>, idbset<tentity> tentity : entity, new() { #region private fields private readonly observablecollection<tentity> _items; private readonly iqueryable _query; #endregion private fields public customdbset() //: base() //: base((iinternalquery<tentity>)internalset) { _items = new observablecollection<tentity>(); _query = _items.asqueryable(); } }

there more properties in it.

see entity framework repository (custom dbset) blog post on couple of ways this.

c# entity-framework entity-framework-6 dbset

swift - How to add AnyObject type variable in Tuples -



swift - How to add AnyObject type variable in Tuples -

how can give anyobject type 1 of parameters in tuple in swift? like:

var abc = (anyobject type, string)

we can utilize anyobject type parameters in tuple import foundation

var abc : (anyobject, anyobject) abc = ([1,2,3,4],2)

we can give anyobject type parameters in tuple utilize of "any" protocol

var http200status : (any,string) http200status = (200, "success")

swift

swift - Set SKSpriteNode position from a corner -



swift - Set SKSpriteNode position from a corner -

i'm making game in spritekit , swift , want align random x positioned rectangles y point. have code written since rectangles have different sizes , position set center of rectangle, can't take y point align rectangles.

here can see problem. align bottom of rectangles.

what do? in advance!

swift sprite-kit xcode6

objective c - how to open another application from background using Custom URL scheme in iOS -



objective c - how to open another application from background using Custom URL scheme in iOS -

i want develop enterprise application. run in background continuously , background want open application. toggle between 2 application. have implemented forever background running help of location services working fine , updating location background unable execute openurl method.

please suggest something.thanks

it's not possible!

you can utilize these links only.

https://developer.apple.com/library/ios/featuredarticles/iphoneurlscheme_reference/introduction/introduction.html

ios objective-c background iphone-privateapi

google directory api "Domain cannot use apis" -



google directory api "Domain cannot use apis" -

i'm trying utilize google directory api. in project enable admin sdk, google+ domains api.

jsonfactory json_factory = jacksonfactory.getdefaultinstance(); httptransport httptransport = googlenethttptransport.newtrustedtransport();

arraylist<string> scopelist = new arraylist<>(); scopelist.add(directoryscopes.admin_directory_user); scopelist.add(directoryscopes.admin_directory_user_readonly); googlecredential credential = new googlecredential.builder() .settransport(httptransport) .setjsonfactory(json_factory) .setserviceaccountid("bla-bla@developer.gserviceaccount.com") .setserviceaccountscopes(scopelist) .setserviceaccountprivatekeyfromp12file(new file("c:/my-file.p12")) .setserviceaccountuser("logined-user-email") .build(); credential.setaccesstoken(<accesstoken oauth google>); directory admin = new directory.builder(httptransport, json_factory, credential) .setapplicationname("test") .sethttprequestinitializer(credential).build(); users users = admin.users().list().setdomain("my-domain.com").execute();

=> "domain cannot utilize apis"

what fault?

to utilize admin sdk apis, domain admin needs "enable api access" in admin console. please refer this

google-apps google-admin-sdk

android - unable to access the SENSOR_SERVICE inside fragment -



android - unable to access the SENSOR_SERVICE inside fragment -

this used

ssensormanager = (sensormanager)this.getsystemservice(sensor_service);

in activity , in fragment making below

ssensormanager = (sensormanager)rootview.getcontext().getsystemservice(sensor_service);

and there redline below sensor_service below

sensor_service cannot resolved variable

try in fragment

ssensormanager = (sensormanager)getactivity().getsystemservice(getactivity().sensor_service);

android fragment

multithreading - How to parallelize crontab executions to increase user base for web app based on mongodb and mysql? -



multithreading - How to parallelize crontab executions to increase user base for web app based on mongodb and mysql? -

i have symfony based web application runs on mongodb , mysql backend. principal of application each user there python script runs 4-12 times day on cronjobs , populates mysql , mongodb databases. script takes between 1.5 minutes 2 minutes execute. @ moment cronjob runs on sequential basis. means script executes job , waits job end before executing next one. moment web application has new user cronjobs auto created duration of time. 24 hours in day can run limited number of cronjobs thereby, limited number of users (around 250-300)

what need if wanted host 1000 1000000 users on web application? can run script on multithread basis? means instead of waiting job finish, launch hundreds of job @ same time. way can grow user base of operations exponentially.

but, concurrency mongodb , mysql able sustain? how many jobs can execute parallelly? scheme factors need consider grow user base? need add together more machines application?

multithreading parallel-processing scalability crontab

F# Type providers and Sky Biometry -



F# Type providers and Sky Biometry -

has used f# type providers sky biometry?

a bulk of calls work great type providers. however, when phone call faces/recognize method, getting fails using both json , xml type provider.

using json one, declare type this:

type skybiometryjsonfacerecognition = jsonprovider<"http://api.skybiometry.com/fc/faces/recognize.json?uids=default@imagecomparer&urls=https://lg2014dev.blob.core.windows.net/d69bdda9-d934-448c-acae-99019f3a564f/01ee184f-ff0b-426f-872a-cbc81ef58d90.jpg&api_key=xxxxx&api_secret=yyyyy">

when seek , utilize type in code, failing on lastly part of graph:

let recognition = skybiometryjsonfacerecognition.load(stringbuilder.tostring())

it should be:

recognition.photos.[0].tags.[0].uids.[0].confidence

but instead get:

recognition.photos.[0].tags.[0].uids.[0].jsonvalue

i swapped on xml type provider 1 phone call , getting intellisense working:

let recognition = skybiometryxmlfacerecognition.load(stringbuilder.tostring()) recognition.photos.photo.tags.tag.uids.uid.confidence

but when run it, get

system.xml.xmlexception: info @ root level invalid. line 1, position 1.

looking @ xml in phone call browser, sure looks fine me:

does have suggestions? thanks

thanks ntr's suggestion, changed type def utilize local storage. json tp found of props , actual phone call worked expected. everyone.

f# type-providers f#-data

ios - Using an “IF” statement for popping to two possible View Controllers -



ios - Using an “IF” statement for popping to two possible View Controllers -

currently have segue hooked uitableview pops next uitableview in navigation stack.

what need though instead, set if statement based on text in uitableview cell, to decide which of 2 possible uiviewcontrollers pop to.

so viewcontroller2 needs able pop either":

- viewcontroller1

or

- forwards viewcontroller3

based on text in uitableview cell populated json.

can help me out that? post code needed. thanks!

current viewcontroller:

- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"standardcell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; spring *spring = [springs objectatindex:indexpath.section]; leaf *leaf = [spring.leafs objectatindex:indexpath.row]; cell.textlabel.text = leaf.shortname; homecoming cell; } - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { // new view controller using [segue destinationviewcontroller]. // pass selected object new view controller. if ([segue.identifier isequaltostring:@"themes"]) { uitableviewcell *cell = (uitableviewcell*)sender; nsindexpath *indexpath = [self.tableview indexpathforcell:cell]; // reference destination view controller mrtviewcontroller *tvc = (mrtviewcontroller *)[segue destinationviewcontroller]; } }

update added code per @troops still not sure how pop vc3

- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath]; nsstring *stringtocheck = @"aaa"; if([cell.textlabel.text isequaltostring:stringtocheck]) { //pop vc1 [self.navigationcontroller poptoviewcontroller:[[self.navigationcontroller viewcontrollers]objectatindex:0] animated:yes]; } else { //pop vc3, not sure set here // pass info tvc.spring = [springs objectatindex:indexpath.section]; tvc.leaf = [tvc.spring.leafs objectatindex:indexpath.row]; tvc.buttonnumber = _buttonnumber; } }

you check cell's textlabel's string: if want utilize segues , not tableview's delegate method of: didselectrowatindexpath: that's why based reply off initial question/code looks like.

- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath]; nsstring *stringtocheck = @"aaa"; if ([cell.textlabel.text isequaltostring:stringtocheck]) { // pop vc1 [self.navigationcontroller poptorootviewcontrolleranimated:yes]; } else { // force vc3 mrtviewcontroller3 *tvc = [self.storyboard instantiateviewcontrollerwithidentifier:@"yourid"]; tvc.spring = [springs objectatindex:indexpath.section]; tvc.leaf = [tvc.spring.leafs objectatindex:indexpath.row]; tvc.buttonnumber = _buttonnumber; [self.navigationcontroller pushviewcontroller:tvc animated:yes]; } }

ios objective-c uitableview segue