Posts

Showing posts from March, 2013

display text on hovering mouse over a button in gwt -

display text on hovering mouse over a button in gwt - i using gwt 2.4. , not using uibinder. have button has background image. when place mouse on button should display text saying "submit" . kind of text says button does. button uiobject , can utilize settitle method on button set tooltip. or if want else on mouse over. create utilize of mouse handlers. read button documentation more details. button gwt

c# - How can i change in Graphics DrawString the text font size? -

c# - How can i change in Graphics DrawString the text font size? - i'm using method draw text on form1: private bool drawtext(bool draw, string texttodraw) { graphics g = this.creategraphics(); sizef size = g.measurestring(texttodraw, systemfonts.defaultfont,14); g.drawstring(texttodraw, font, brushes.red, picturebox1.location.x + (picturebox1.width / 2) - (size.width / 2), picturebox1.location.y - 30); homecoming draw; } i tried set width 14 on sizef size lline didn't alter dize , thing did moving bit text it's location . how can alter font size of text, , maintain perspective(if right word use) of text location ? this how when not using width 14 @ text in center above picturebox1. want when alter text size kept in center now. the text in reddish , it's in hebrew in case. try using bigger font: using (fon...

node.js - Installing node with homebrew on OSX. Npm not found -

node.js - Installing node with homebrew on OSX. Npm not found - i had working install of node , npm on osx, when updating npm went wrong. messed things more using homebrew seek , link, uninstall, , reinstall node. somewhere along way original node install, used installer nodejs.com, , brew usage on node conflicted. got node reinstall homebrew, when seek running npm npm command not found. here message when running brew install node. $ brew install node ==> downloading https://downloads.sf.net/project/machomebrew/bottles/node-0.10.3 downloaded: /library/caches/homebrew/node-0.10.32.mavericks.bottle.tar.gz ==> pouring node-0.10.32.mavericks.bottle.tar.gz ==> caveats bash completion has been installed to: /usr/local/etc/bash_completion.d ==> create install npm err! npm err! additional logging details can found in: npm err! /usr/local/lib/node_modules/npm/npm-debug.log npm err! not ok code 0 make: *** [install] error 3 warning: post-install step did not finish ...

Ruby on Rails Association with model many-to-many -

Ruby on Rails Association with model many-to-many - i`m beginner ror , trying handle many-many association i handled relationship between models , migration trip model class trip < activerecord::base has_many :relationships has_many :topics, through: :relationships end user model class user < activerecord::base has_many :relationships has_many :trips, through: :relationships end relationship model class relationship < activerecord::base belongs_to :user belongs_to :trip end my migration class createrelationships < activerecord::migration def alter create_table :relationships |t| t.belongs_to :user t.belongs_to :trip t.timestamps end add_index :relationships, :user_id add_index :relationships, :trip_id end end user_controller class userscontroller < applicationcontroller before_action :set_user, only: [:show, :edit, :update, :destroy] def trips @user = user.find(params[:id]) @trips = @user.trips end def index @user...

java - Count Down Timer? -

java - Count Down Timer? - i create simple application contain quiz questions , user select reply need help in adding count downwards timer in app 20 sec when time transfer straight next question , when user reply in time transfer next question thank import java.awt.borderlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.timer; import javax.swing.windowconstants; public class countdown extends jframe { // countdown 42 seconds public static int countervalue = 42; public static timer timer; public static jlabel label; public countdown() { initgui(); } private void initgui(){ borderlayout thislayout = new borderlayout(); this.setdefaultcloseoperation(windowconstants.dispose_on_close); this.getcontentpane().setlayout(thislayout); label = new jlabel(); label.settext(string.valueof(countervalue)); this...

c - Move a pointer location around to write a recursively allocated buffer -

c - Move a pointer location around to write a recursively allocated buffer - apologies if title doesn't create sense, i've been staring @ monitor 15 minutes trying come one. i'm using library function c api (in 64-bit xubuntu 14.04) move set number of int16_t values buffer , repeat set number of times, described here in (sort of) pseudo-code: int16_t *buffer = calloc(total_values_to_receive, 2 * sizeof(samples[0])); while (!done){ receive_into_buffer(buffer, num_values_to_receive_per_pass); fwrite(buffer, 2 * sizeof(samples[0]), num_values_to_receive_per_pass, file); values_received += num_values_to_receive_per_pass; if (values_received == total_values_to_receive){ done = true; } } basically receive set number of values on each pass , writes values file, note same file appended each time. e.g. if total_values_to_receive = 100 , num_values_to_receive_per_pass = 10 , there 10 passes in total. what do, increment speed, have wr...

Nintex Workflow 2007 - global settings / variables -

Nintex Workflow 2007 - global settings / variables - the problem: when create workflow on uat/stage environment need import production environment. need alter environment urls (web service calls , such) , email addresses. is possible: store urls , emails in global configuration nintex workflow pick whenever deploy workflow 1 time again production wouldn't need go each step , edit settings? got email nintex support: dear jakub, thank e-mail. the suggestion have utilize workflow constants. can configure workflow constants in central administration > application management > manage workflow constants. in workflow utilize lookup reference points appropriate workflow constant. long workflow constant name same in both environments workflow pick workflow constant contain relevant url environment. hope helps. kind regards simon muntz software back upwards engineer - team lead nintex workflow everyone® | nin...

How to execute a https GET request from java -

How to execute a https GET request from java - i wrote java client executes http requests without problem. want modify client in order import org.apache.http.httphost; import org.apache.http.auth.authscope; import org.apache.http.auth.usernamepasswordcredentials; import org.apache.http.client.credentialsprovider; import org.apache.http.client.config.requestconfig; import org.apache.http.client.methods.closeablehttpresponse; import org.apache.http.client.methods.httpget; import org.apache.http.impl.client.basiccredentialsprovider; import org.apache.http.impl.client.closeablehttpclient; import org.apache.http.impl.client.httpclients; private string executeget(final string url, string proxy, int port) throws ioexception, requestunsuccesfulexception, invalidparameterexception { closeablehttpclient httpclient = null; string ret = ""; requestconfig config; seek { string hostname = extracthostname(url); logg...

c++ - Discouraged pragma use GCC -

c++ - Discouraged pragma use GCC - header guards necessary in c++ programs, pain when naming conventions strictly enforced - during refactoring. when using gcc (and many other compilers) have alternative in preprocessor command #pragma once . recommendations i've seen against utilize of command (e.g. lack of back upwards before v3.4) aren't convincing regard personal projects. utilize #pragma once if possible. all said, quote the gcc website giving me pause: note in general not recommend utilize of pragmas; see function attributes, farther explanation. maybe it's lower-journeyman-level c++ experience working against me, don't see explanation recommendation @ site pointed link. able explain reasoning behind recommendation in (semi-)layman's terms? the general recommendation comes fact not there no guarantee other compilers implement #pragma once (or other pragma), there's no guarantee other compilers implement #pragma once same way ...

android - Changing visibility of menu items in fragment -

android - Changing visibility of menu items in fragment - i'm trying hide menu items when fragment changed, seems not working. here im doing: defining menu , menu items: @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu items utilize in action bar menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.actionbar_sharecall, menu); actionmenu = menu; menuitem searchitem = menu.finditem(r.id.action_searchmenuitem); menuitem item = menu.finditem(r.id.action_menushare); // item.setvisible(false); // searchitem.setvisible(false); topsearch = searchitem; topshare = item; final mrshareactionprovider actionprovider = new mrshareactionprovider( this); menuitemcompat.setactionprovider(item, actionprovider); actionprovider .setsharehistoryfilename(shareactionprovider.default_share_history_file_name); ac...

accurev - File disappears from Change Palette window after target stream is selected -

accurev - File disappears from Change Palette window after target stream is selected - i facing next unusual behaviour in accurev gui: scenario: file selected in list of active files in stream it sent alter palette another 1 stream selected list result: file disappeared list. what can cause it? note: file not exist in target stream, target directory exists there. check out mergelist command in cli manual. command beingness called gui when alter palette operation. see section details mergelist algorithm, explain why files disappearing. accurev

swift - How do I make sure my static library has the right architectures for CocoaLibSpotify? -

swift - How do I make sure my static library has the right architectures for CocoaLibSpotify? - i error when seek build project using cocoalibspotify. ld: warning: directory not found alternative '-flibrary/libspotify-12.1.64-ios-universal' ld: warning: ignoring file /users/tgm/library/developer/xcode/deriveddata/cocoalibspotify_ios_library-gtxluzeubophcpfplfiyijlecxzt/build/products/debug-iphoneos/libcocoalibspotify.a, missing required architecture x86_64 in file /users/tgm/library/developer/xcode/deriveddata/cocoalibspotify_ios_library-gtxluzeubophcpfplfiyijlecxzt/build/products/debug-iphoneos/libcocoalibspotify.a (2 slices) undefined symbols architecture x86_64: "_objc_class_$_spsession", referenced from: __tmacso9spsession in detailviewcontroller.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) i used lipo check architectures in referenced static library: $ lipo -info /us...

php - How to autofix resolution of website on mobiles of different browsers? -

php - How to autofix resolution of website on mobiles of different browsers? - i have created website college.in there resolution issues if open in web browser can view properly, when open in mobile phone total website not looking can help me out ? i'm providing link below : http://mvsrec.edu.in/ieee/ for compatibility mobiles , responsiveness of website. you can utilize next twitter bootsrap : give responsiveness website , can utilize media queries chnage display different resolutions.bootstrap grid flow display html html 5 features can embedded bootstrap php html css website screen-resolution

ios - Programatically Setting Root View Controller in Swift -

ios - Programatically Setting Root View Controller in Swift - i'm not sure why trival, swift translation has been slow one. anyways, can't figure out complaining about. trying set root view controller, , complier spits error saying "splash pagecontroller not have fellow member named init" here's app delegate: var window: uiwindow? var client_key = c_key() func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { // override point customization after application launch. window = uiwindow(frame: uiscreen.mainscreen().bounds) var url_string = "xxxx=\(client_key.client_key)" var g_home_url = string.stringwithcontentsofurl(nsurl.urlwithstring(url_string), encoding: nsutf8stringencoding, error: nil) if (g_home_url? != nil){ nsuserdefaults.standarduserdefaults().setobject(g_home_url, forkey: "showurl") } allow docu...

asp.net mvc - What are the rules for nesting @'s in Razor syntax? -

asp.net mvc - What are the rules for nesting @'s in Razor syntax? - i've started razor (v3) , it's fine, don't understand rules behind when need utilize @ sign. here illustration current project. in code: @if (viewbag.forcepublic == null && user.identity.getuserid() == @model.seller.id) { <h2>listing status</h2> switch (model.status) { if set @ in front end of switch statement, runtime error saying don't need nest @ signs. however, in code: @if(!model.bizaddress.streetaddress.isempty()) { @html.displayfor(model => model.bizaddress.streetaddress); } not not syntax error (as 1 expect, considering illustration above), if don't include @ sign in front end of html.displayfor, streetaddress not printed. instead silently fails! i understand why happening can avoid subtle bugs might cause in future. i suspect root...

ios - target specifies product type 'com.apple.product-type.app-extension', but there's no such product type for the 'iphonesimulator' platform" -

ios - target specifies product type 'com.apple.product-type.app-extension', but there's no such product type for the 'iphonesimulator' platform" - in project, have deployment target of ios 6. want test app in ios 6.1 simulator, xcode 6.1 not back upwards ios simulators older ios 7.0, have downloaded , installed xcode 5.1.1. when build app in xcode 5.1.1, gives me error: target specifies product type 'com.apple.product-type.app-extension', there's no such product type 'iphonesimulator' platform how can prepare problem , run app in ios 6 simulator? app extensions require ios 8.0 , later. if want test project in ios 6.1 xcode 5.1, should remove app extension target project when testing in xcode 5.1 it's not applicable old os version. ios xcode xcode5 ios-simulator

vector - Reading individual hex values line by line in c++ -

vector - Reading individual hex values line by line in c++ - i trying read text file filled individual hex values formatted this: 0c 10 00 04 20 00 09 1a 00 20 what read them in, convert binary, store in vector. print statement output this: 00001100 00010000 00000000 00000100 00100000 00000000 00001001 00011010 00000000 00100000 i thought reading file correctly can seem first hex value each line. example: can read 0c before getting next line , forth. if tell me doing wrong great. here code: #include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include <bitset> using namespace std; vector<bitset<8> > memory(65536); int main () { string hex_line; int = 0; ifstream mem_read; //read text file mem_read.open("examplefile.txt"); if(mem_read.is_open()){ //read convert binary while(getline(mem_read, hex_line)){ unsigne...

angularjs - Controller not being found -

angularjs - Controller not being found - i'm giving angular try. i'm defining controller in customerscontroller.js. but, when run error "error: error:areq bad argument". customerscontroller not beingness found. appreciated. thanks. here html file: <!doctype html> <html lang="en" data-ng-app> <head> <meta charset="utf-8"> <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <link href='http://fonts.googleapis.com/css?family=open+sans:400italic,400,600,700,800,300' rel='stylesheet' type='text/css'> </head> <body ng-controller="customerscontroller"> <h2>customers</h2> filter: <input type="text" ng-model="customerfilter.name" /> <table> <tr> <th ng-click="dosort('name')"...

Java servlet: do parameters sent with doGet() get encoded using HTTPS? -

Java servlet: do parameters sent with doGet() get encoded using HTTPS? - if have java servlet using doget() such as: public class myservlet extends httpservlet { protected void doget(httpservletrequest request, httpservletresponse response) ... param1 = request.getparameter("param1"); ... and gets accessed calling https://www.mydomain.com/myservlet?param1=hello . is param1 secure since i'm using https (that is, param1 not visible user accessing link)? or, visible because doget() places param1 in html header? if latter, what's equivalent dopost() here? if link originates in https site, fine. if link not originate in https site, not. if literally set link on site, or same site using http. if had http://www.example.com/ , linked https://www.example.com/myservlet?param1=hello wouldn't secure because printed out link on plain text. java servlets

vba - Excel macro to transpose data from one sheet to another based column name and cell content -

vba - Excel macro to transpose data from one sheet to another based column name and cell content - i have worksheet1 column labeled participant , columns labeled 1-20 (experiment id numbers). i have worksheet2 info of participants (column) , experiments (column) participated in. in cells under experiment column, there multiple experiment id numbers participants have participated in multiple experiments. illustration cell read, "1,4,5". what need place "x", on worksheet1, in corresponding cells worksheet2. example, cell reading "1,4,5" participant "003" worksheet2 place "x" in columns labelled 1, 4, 5 in worksheet1. i hope clear. new macros need help possible. this lucky day. i'm going walk through how this, code. have understand concepts in order benefit it. if do, can apply these ideas many projects. first, need break downwards tasks manageable easy steps. macros aren't going help because of differe...

powershell - -match several $vars in if statement -

powershell - -match several $vars in if statement - i have this, doesn't work: $var1 = "6.0.6001" $var2 = "6.1.7001" $var3 = "6.2.8074" $var4 = "6.3.8074" if($var1 -match "6.1.?" -or "6.2.?" -or "6.3.?") { write-host "1" }else{ write-host "2" } no matter what, 1 returned. what should like? thanks. run code: if("6.2.?" -or "6.3.?") { write-host "1" }else{ write-host "2" } it'll homecoming 1 no matter what. change status to: if($var1 -match "6.1.?" -or $var1 -match "6.2.?" -or $var1 -match "6.3.?") or better: if($var1 -match "6.[1-3].?") powershell if-statement match

java - gradle: Skipping task ':compileJava' as it has no source files -

java - gradle: Skipping task ':compileJava' as it has no source files - i seek gradle -d compilejava in my seek project, , gradle raise "skipping task ':compilejava' has no source files.". worse thing can't see created in build/. create project running gradle init , creating "src/ex.java". my question is: how load default "compilejava" or define "compilejava" prepare warning. by default, java source files need go src/main/java (or src/test/java test sources). either adapt directory construction accordingly, or reconfigure source directory follows: sourcesets { main { java { srcdirs = ["src"] } } } java build compiler-errors gradle

ios - Is -[NSDictionary setObject:nil forKey:] the same as -[NSDictionary removeObjectForKey:]? -

ios - Is -[NSDictionary setObject:nil forKey:] the same as -[NSDictionary removeObjectForKey:]? - i'm reading through source code , noticed next api, developer passes in nil if want object removed. - (void)setsomestatus:(somestatusobject *)status { if (status != nil) { [store setobject:status forkey:some_status_key]; } else { [store removeobjectforkey:some_status_key]; } } my specific question if above can reduced to - (void)setsomestatus:(somestatusobject *)status { [store setobject:status forkey:some_status_key]; } or alternatively - (void)setsomestatus:(somestatusobject *)status { store[some_status_key] = status; } no, not equivalent. in fact, passing nil setobject:forkey: (either value or key) result in runtime exception. ios objective-c nsdictionary

angularjs - Angular JS with specific select checkboxes -

angularjs - Angular JS with specific select checkboxes - <body ng-app="workapp"> <div ng-controller="firstclaimcontroller"> <input type="checkbox" ng-click="sbcfunction()"> alternative 1 <input type="checkbox" ng-click="sbcfunction()"> alternative 2 <input type="checkbox" ng-click="sbcfunction()"> alternative 3 <input type="checkbox" ng-click="sbcfunction()"> alternative 4 {{myvalue}} </div> <script type="text/javascript" > var claimcontroller = angular.module('workapp', []); claimcontroller.controller('firstclaimcontroller', function($scope){ // test controller whether works $scope.myvalue = "asdf"; // $scope.sbcfunction = function () { }; }); </script> the above code , got 4 checkboxes. aim a...

Vim: What's the best way to have markdown automatically enabled for comments? -

Vim: What's the best way to have markdown automatically enabled for comments? - i able format comments in code somewhat: # **todo** # # *don't forget* i want markdown syntax highlighted bit in comments, add together cterm=bold \*\*(.*)\*\* or something. is there way in vim? to properly, you'd have :syntax include markdown syntax each individual syntax (that has comments you're interested in), , have containedin= corresponding syntax grouping comments. that's doable, requires effort (depending on how many , syntaxes modify). it's quicker utilize plugin syntaxrange plugin alter syntax of comment blocks markdown (manually, , on demand). corresponding mapping, can set quite (but it's not automatic first alternative). vim markdown

How to set several values for a Flurry Analytics parameter? -

How to set several values for a Flurry Analytics parameter? - according flurry analytics events faq: ... each event can have 10 parameters, , each parameter can have number of values. is possible set multiple values single flurry custom event parameter at once? example utilize case: event: user opens article parameter name: hashtags parameter value: a list of tags article tagged with as result, want see top 10 popular tags in parameters pie chart on flurry dashboard. thank you! flurry flurry-analytics

ruby on rails - RSpec passing variable or (let variable) to it block -

ruby on rails - RSpec passing variable or (let variable) to it block - here's code have spec wrote. trying each array(payments), when seek add together allow variable on top of block it's telling me variable or method not exist. assuming variable not beingness called. can take @ how should reogranize spec can this: payments.each |p| "updates payment record of #{p.id} status of #{p.status}" payments.each |p| payment = payment.find_by_id(p.id) payment_status = payment.status payment_status = p.status subject expect(payment.find_by_id(p.id).status).to_not eq(payment_status) end end end original spec code: describe "patch #submit" subject { patch :pay, :payment => [payments] } context "when submission valid" let(:payments) { [] } let(:admin) { factorygirl.create(:admin) } let(:member) { factorygirl.create(:member) } let(:user) { factorygirl.create(:user }...

vim - Set keybindings in a local vimrc file -

vim - Set keybindings in a local vimrc file - i have been unable create keybinding in local _vimrc file though have next settings in global vimrc file: set exrc " enable per-directory vimrc files "set secure " disable unsafe commands in local vimrc files i have local vimrc files each of workspaces, , depending on workspace want able nail <f8> key , automatically grep string in particular file. in global vimrc file next works fine: nnoremap <f8> :grep <c-r><c-w> c:\workspace\projectdirectory\subdirectory\flagsfile.h<cr> but have in local vimrc file in project root directory ( c:\workspace\projectdirectory ) , allow filename different in each of project directories. when set keymapping in local vimrc file , nail <f8> doesn't though have allowed unsafe commands. can please explain right way this? vim

In java, why new operator not used before data type to allocate memory? -

In java, why new operator not used before data type to allocate memory? - if need new operator allocate memory object, why don't utilize before info types allocate memory? class-name class-var = new class-name(); new int a; because james gosling said so.... (or bjarne stroustrup said so). really, question of language design, not technical laws. javac hides these semantics , called boxing / unboxing (and automatically). types can exist values or "objects" (typically implemented heap). when context requires object reference, javac emits box instruction move int value object wrapper (int -> integer) , passes reference value . many low level jvm opcodes built handle scalar values built handle reference values (or references). one prime illustration storing int collection. gets boxed. but in end, asking why language syntactically asking artist why painted painting thus. because. languages designed whim , emotion, in java's case, syntax...

Java Keystore.aliases() - different implementations between IBM and Oracle -

Java Keystore.aliases() - different implementations between IBM and Oracle - i have certificate issued (private) ca. when i'm loading java keystore , phone call aliases() function, different results between oracle jvm (on windows) , ibm jvm (on linux). on oracle, 1 alias - certificate's cn - "my_cert", , on ibm 2 aliases - "my_cert" , "my_ca". i utilize keystore loading ca certificate out of certificate. on oracle, can without knowing certificate's cn - phone call aliases() , returns 1 alias, chain, , chain higest certificate - ca certificate . (my code below). on ibm, can't it, since have 2 aliases , have distinguish between them first. long story short, have 3 questions: can load password protected file without using keystore? are different aliases() results related host platforms (windows/linux)? can utilize java ibm keystore extracting ca certificate without knowing certificate alias? my code: keystore ks = k...

mysql - Make SQL column using PHP explode into variable -

mysql - Make SQL column using PHP explode into variable - hey guys i'm having bit of problem trying create sql column variable in php. so sql row contains image url's , formatted this: http://www.website.com/image.jpg,http://www.website.com/image2.jpg,http://www.website.com/image3.jpg so need display first url in row. i have short line of code: file = '.(explode(',', $cardata["picturerefs"])[0]).'; i trying give variable value of: $file = "http://www.website.com/image.jpg" my current code wrong sense must quite close. how can accomplish this? your short hand correct, string encapsulation not required. $file = explode(',', $cardata['picturerefs'])[0]; // first image src then can utilize like: echo '<img src="'.$file.'"/>'; php mysql

maven - Extracting files downloaded as a dependency in Gradle -

maven - Extracting files downloaded as a dependency in Gradle - i've got gradle script goes following: apply plugin: 'java' apply plugin: 'maven' defaulttasks 'build' ext.basedir = file('.').getabsolutepath() repositories{ maven { url "http://package.repo.com:8081/nexus/content/repository } configurations.all { // check updates every build resolutionstrategy.cachechangingmodulesfor 0, 'seconds' } dependencies { compile group:'com.repo.wwpd', name:'kernel_utilities', version:'3.0.0', changing:true } task copy_dependencies(type: copy) { configurations.compile basedir+'\\install' include '*' { filetree iotree = filetree(dir: "c:\\users\\username\\install") } iotree.each { f -> re-create { tartree(resources.gzip(f)) "c:\\users\\user\\test" } } } the goal dependencies, move them install f...

mysql - Can I limit by unique count of a specific column? -

mysql - Can I limit by unique count of a specific column? - say have database of songs. artist | song ------------------------------------- cloud cult meaning of 8 cloud cult pretty voice jason alexander today day jason alexander virgin jason alexander wasn't me powderfinger dog what want issue query selects songs limit of 20 artists. not 20 database records, many records there songs 20 artists. in above example, if limited 2, 5 results, songs cloud cult , songs jason alexander. is sql can do? you need create sub-query of artists , limit sub-query number of required artists: sql fiddle mysql 5.5.32 schema setup: create table table1 (`artist` varchar(15), `song` varchar(20)) ; insert table1 (`artist`, `song`) values ('cloud cult', 'the meaning of 8'), ('cloud cult', 'pretty voice'), ('jason alexander', 'today day'), ('jason alexander',...

api - RESTful web service: create new resource by combining other resources: provide IDs or URIs? -

api - RESTful web service: create new resource by combining other resources: provide IDs or URIs? - when obtaining collection of items restful web service (via get), representation of each single item (e.g. in json) contains item's resource identifier. can either id of resource or entire uri contains id. this identifier (id or uri) required in case client needs farther interact remote resource representing single item. many people seem consider practice provide entire uri , not id, client has nil uri construction (for example, miguel grinberg writes in this article). but should done in case multiple items combined in order create new resource? client needs tell server items combined. , eventually, server requires list of ids processing request. assuming client retrieved uris each item in first place -- perform uri parsing in order extract raw ids again: in client or in server? example: client retrieved collection of pages in request. each page item identifies uri (cont...

java - CORBA Error : ORB initialization in a method -

java - CORBA Error : ORB initialization in a method - i calling method @ server side client side. have 3 servers , need communicate using udp in method need initialize orb 1 time again start thread process.but pretty sure because of problem in orb initialization my method @ server side: public string getnonreturners(string adminusername, string adminpassword, string educationalinstitution, int numdays) { string _result = null; string _initiatedserverresult = null; final arraylist<string> result = new arraylist<string>(); seek { orb orb = orb.init(); poa rootpoa = poahelper.narrow(orb.resolve_initial_references("rootpoa")); bufferedreader brconcordia = new bufferedreader(new filereader( "concordia.txt")); string concordia = brconcordia.readline(); brconcordia.close(); bufferedreader brmcgill = new buffered...

send - AUTOHOTKEY If left mouse pressed.. loop..something -

send - AUTOHOTKEY If left mouse pressed.. loop..something - this current code: lbutton:: send {sc013} sleep 10 send {sc021} sleep 10 homecoming rbutton:: send {sc014} sleep 10 send {sc021} sleep 10 homecoming and need is... isnsted of when left mouse/right mouse button clicked something..... need when left/right mouse button holded loop letter "f". thnk you. you'll need utilize getkeystate() , while-loop . while rbutton pressed, send f . rbutton:: while (getkeystate("rbutton", "p")) { send, f } homecoming loops send autohotkey mouseclick-event

java - Exported Jar file from Eclipse not locating referenced files -

java - Exported Jar file from Eclipse not locating referenced files - i have written java programme utilizes referenced sound , image files reside within own folder under java project have created in eclipse. when run programme within eclipse, works fine. resources located. seek , export programme eclipse jar file, , execute on command line, complains cannot locate referenced file. here command i've been using run program: java -cp ./seawolfgame.jar game.screen (game package, , screen contains static main) the referenced sound file cannot locate within sounddir. sounddir @ top level of project. referenced files need in packages? here error back: java.io.filenotfoundexception: sounddir/sonar-beep.wav (no such file or directory) @ java.io.fileinputstream.open(native method) @ java.io.fileinputstream.(fileinputstream.java:120) @ com.sun.media.sound.wavefilereader.getaudioinputstream(wavefilereader.java:185) @ javax.sound.sampled.audiosystem....

loopbackjs - Cannot hide updateAttributes method -

loopbackjs - Cannot hide updateAttributes method - related: strongloop: hiding method updateattributes(), accepted reply not solve problem. i have followed started guide in order basic app setup. in app, model called pharmacy, , hide mutating functions (i.e. delete, update,create...) rest api. i next instructions in documentation (http://docs.strongloop.com/display/public/lb/exposing+models+over+rest#exposingmodelsoverrest-hidingmethodsandrestendpoints). while can hide static functions fine, updateattributes method still beingness exposed no matter do. i have placed hiding logic in common/models/pharmacy.js. placing in server/pharmacy.js indicated docs nothing, file not loaded. the content of common/models/pharmacy.js is: module.exports = function(pharmacy) { pharmacy.sharedclass.find('deletebyid', true).shared = false; pharmacy.sharedclass.find('updateattributes', false).shared = false; pharmacy.sharedclass.find('upsert...

mvvm - EXTJS 5 - ViewModel getting Store returns null value -

mvvm - EXTJS 5 - ViewModel getting Store returns null value - im having issue regarding stores declared in viewmodel, using extjs5's mvvm feature. simple utilize case: viewmodel: ext.define('app.view.view1.view1model', { extend: 'ext.app.viewmodel', alias: 'viewmodel.view1',` data: { }, stores:{ company:{ model: 'um.model.companydata', type: 'companydata', //store name autoload: true } } }]; while code below viewcontroller: viewcontroller: ext.define('app.view.view1.view1controller', { extend: 'ext.app.viewcontroller', alias: 'controller.view1', onloadnewdata: function(event, item,store){ var vm= this.getviewmodel(); var store=vm.getstore('company'); console.log(store); } }); on firing event "onloadnewdata" function based on console store null....

mysql - C# - Concurrent Requests to database -

mysql - C# - Concurrent Requests to database - i have application create more available concurrent requests database have hosted on godaddy server. i'm wondering if when user makes request database , denied because of concurrent request limit happen? request tossed uncaught exception? send exception database unable reached or "queue up" , wait turn? i've tried doing research here , either i'm typing in wrong keywords or i'm misunderstanding how works. in advance! c# mysql database concurrency

html - How to scale a fixed-width website to an iPad viewport -

html - How to scale a fixed-width website to an iPad viewport - i need able fit 2560px wide website ipad's viewport. have @viewport { width: device-width; max-zoom: .15; orientation: landscape; } @-ms-viewport { width: device-width; max-zoom: .15; orientation: landscape; } @-o-viewport { width: device-width; max-zoom: .15; orientation: landscape; } and scales viewport of ipad, have scroll horizontally see rest of page. all need scale website within of viewport don't have scroll see rest of page. i'm okay there beingness space leftover in viewport, can't have overextending viewport. does know how can scale 2560px 1440px website fit in ipad's viewport? website's dimensions set fit 2560px 1440px monitor used tradeshow kiosk. thanks help in advance! edit: i've updated css @viewport to: @viewport { width: 2560px; height: 1440px; zoom: .05; orientation: landscape; } @-ms-viewport { width: 2560px; ...

java - How to stop a Thread running a Handler? -

java - How to stop a Thread running a Handler? - i have thread within service listens handler instructions , writes byte[] commands bluetooth stream: class btoutgoingthread extends thread { private static final string inner_tag = "btoutgoingthread"; public void run() { log.e("service: btoutgoingthread","starting"); this.setname(inner_tag); looper.prepare(); mmyservicehandler = new handler() { public void handlemessage(message msg) { // handle messages... switch(msg.what) { case 1: // message write(reset); break; case 2: // other message write(motreset); break; } } }; log.e("outgoing thread","active"); if(stopoutgoing){ // set tru...

java - Decode Regex expression - ^[a-zA-Z0-9 "'&!#$%()*+,-./:;?@[\\]^_`{|}~]+$ -

java - Decode Regex expression - ^[a-zA-Z0-9 &quot;&apos;&amp;!#$%()*+,-./:;?@[\\]^_`{|}~]+$ - using java i not regular on regex, came across next regex part of migration of springmodules-validation stuff latest. ^[a-za-z0-9 &quot;&apos;&amp;!#$%()*+,-./:;?@[\\]^_`{|}~]+$ what doing? need understand write unit test validation. way i'm using in java project. one more interesting thing, tried look in hibernate-validator follows: @pattern(regexp = "^[a-za-z0-9 &quot;&apos;&amp;!#$%()*+,-./:;?@[\\]^_`{|}~]+$") then intellijidea shows error @ end of line saying unclosed character class. regex look formed? update it seems look malformed, see next exception while trying test this: java.util.regex.patternsyntaxexception: unclosed character class near index 57 ^[a-za-z0-9 &quot;&apos;&amp;!#$%()*+,-./:;?@[\]^_`{|}~]+$ here original look 1 of xml files i'm trying migrate: <regexp apply-i...

java - Antlr4 RPN Calc; final result on stack missing -

java - Antlr4 RPN Calc; final result on stack missing - disclaimer: course of study work , first post questions have been asked before after brief crash course of study on antlr i've done best figure out how best tackle problem of creating rpn calculator supports numerical, logical , relational operations. int , boolean accepted. now, while code not near standard antlr quality, working except when 'start' rule matches. want print out result stack, reason stack empty after matching. e.g. 2 3 + ; print debug statements see pushed, popped , result of 5 pushed expected. stack empty 1 time terminating ';' matched 'start' rule. i'm sure i'm missing fundamental here, we've spent day antlr in class, cannot figure out. haven't had luck finding debuggers antlr4 allow me step through code runs, did print out inputs, popped items , pushed items went along , seems until 'start' below sample of code add-on operation , no boolean...

java - Find the smallest number have 3 integer roots? -

java - Find the smallest number have 3 integer roots? - java question find smallest number x, such x > 1, , square roots , cube root , 5th roots integers?? i tried code in java, no result ? int = 1; while (true) { i++; if (math.pow(i, 1.0 / 2) % 1 == 0 && math.pow(i, 1.0 / 3) % 1 == 0 && math.pow(i, 1.0 / 5) % 1 == 0) { break; } system.out.println(i); } your if status not right ! your code should : public static void main(string [] args){ biginteger = new biginteger("2"); double sqroot, cuberoot, fifthroot; while(true) { sqroot = math.sqrt(i.floatvalue()); cuberoot = math.cbrt(i.floatvalue()); fifthroot = math.pow(i.floatvalue(),1/5.0d); system.out.print("i = "+i); if(math.floor(sqroot)==sqroot && math.floor(cuberoot)==cuberoot && math.floor(fifthroot)==fifthroot){ ...