Posts

Showing posts from June, 2012

Java: Clear the console -

can body please tell me code used clear screen in java? example in c++ system("cls"); what code used in java clear screen? thanks! since there several answers here showing non-working code windows, here clarification: runtime.getruntime().exec("cls"); this command not work, 2 reasons: there no executable named cls.exe or cls.com in standard windows installation invoked via runtime.exec , well-known command cls builtin windows’ command line interpreter. when launching new process via runtime.exec , standard output gets redirected pipe initiating java process can read. when output of cls command gets redirected, doesn’t clear console. to solve problem, have invoke command line interpreter ( cmd ) , tell execute command ( /c cls ) allows invoking builtin commands. further have directly connect output channel java process’ output channel, works starting java 7, using inheritio() : import java.io.ioexception; public class cls { p...

vba - Numbers in an Excel column created using VB6 defaulting to scientific notation -

kindly me solve below issue. issue: using vb 6.0 code, excel file generated. column in excel file should have 20-digit number. while opening excel file, showing 2.00575e+15 . please share ideas solve issue. think if can format field text , issue resolved. have tried following code part also.. no positive result. myexcelsheet.range("a1","a10").numberformat = "@" myexcelsheet.range("a1","a10").numberformat = "text" neither works though.

jquery - Sorting taking case into consideration -

i using following code function asc(a, b) { return ($(b).text()) < ($(a).text()); } when pass a,d,c,e,b correct values a,b,c,d,e however when pass a,d,c,e,b c,a,b,d,e how can make code work when different case used? if you're looking case-insensitive sort, easiest way convert both sides all-upper or all-lower case. // note: not array#sort function asc(a, b) { return $(b).text().tolowercase() < $(a).text().tolowercase(); } note, thought, i'm assuming you're not using array#sort , doesn't array#sort expects (return 0 , <0 , or >0 ). side note: () around $(b).text() , $(a).text() in quoted code have no effect whatsoever, i've removed them above. from comment: if have sequence 'c' after 'c' in example, how it? ah, that's different. works array#sort , you'll have modify match you're using asc (i don't know expect in case strings match): live copy // note: des...

android - Refocusing app to foreground restarts entire app -

i wondering if knows problem - have created app , i'm testing it, , problem every time put app in background or minimise it, when bring foreground again entire application restarts first activity intent. there way around this? can't feel i'm missing fundamental knowledge here? my mainactivity shown below: public class mainactivity extends activity { private actionbar actionbar; @suppresslint("newapi") @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); actionbar = getactionbar(); actionbar.sethomebuttonenabled(true); actionbar.setdisplayhomeasupenabled(true); actionbar.setdisplayoptions(actionbar.display_show_custom | actionbar.display_show_home); actionbar.setcustomview(r.layout.abs_layout_main); actionbar.seticon(android.r.color.transparent); } so can see savedinstancestate being cal...

ios - Can I trigger Region Monitoring when I receive a Push Notification while app in BackGround? -

i have requirement need send message user if user available in location region. if app on background through push-notifications need add region region monitoring , trigger server send message user user once user enters region. possible while app in background or suspended . or possible push notification register region monitoring event without direct app involvement? thanx in advance answers. , pardon novice nature of asking.

android - Is there a workaround to get the public Leaderboard with getLeaderboardIntent()? -

Image
opening google games activity containing specific leaderboard quite easy: http://developer.android.com/reference/com/google/android/gms/games/gamesclient.html#getleaderboardintent(java.lang.string) but fond pity public scores not opened. of users have in fact not lot of friends on g+, page looks empty, , of users have ,o motivations @ first place. that's why open public results (second tab) is possible? you creating own view of google leaderboard. mean that, loading each public score individually , creating own leaderboard table in app. unfortunately looking configuration in google getleaderboardintent() method alow load directly correct page google leaderboard interface. should have work , google created different method getleaderboardintent() depending on input types , numbers. never worked me. i explained little bit anwsering post : how open "all" default instead of "social" in google leaderboard?

Building a JSON response in PHP -

how go building json response looks in php? details of { "success": 1, "result": [ { "id": "293", "title": "this warning class event", "url": "http://www.example.com/", "class": "event-warning", "start": "1362938400000", "end": "1363197686300" }, { "id": "294", "title": "this information class ", "url": "http://www.example.com/", "class": "event-info", "start": "1363111200000", "end": "1363284086400" }... } php provides method json_encode(); used convert jason format

java - How do you sort an array of integers? -

firstly, beginner java , programming in general of solutions i've seen question aren't understandable me. however... basically, have array of temperatures, given arguments. i.e. temp[0] = 30, temp[1] = 31, temp[2] = 31, temp[3] = 30 the catch need sort these temperatures numerical order can find median temperature. however, unsure how this. any ideas? thinking along lines of creating second array with temperatures in order index increase. finding middle value of middle index along lines of orderedtemps[(args.length - 1) / 2] (using if statement determine between , odd number of args median differ). however, i'm unsure how go sorting process , creating second array sorting it... tips? you can try median org.apache.commons package.

visual studio - VS 2013 Code Analysis results differ when run from IDE and MSBuild -

has seen this? add code analysis of projects in solution, configurations, using microsoft extended design guidelines. in ide clean result, in msbuild ca1034 use of nested enum types. somewhere along line seems different set of rules used between 2 environments.

javascript - How do I test that this nested function was called in an AngularJS unit test? -

i'm not new unit testing (c#) new unit testing in angularjs. i'm trying test controller , far have been able several tests work properly, there proving rather difficult. i have $scope method makes call our authentication service returns promise. in "then" function checking see if user indeed authenticated , based on call private function go out , make other service calls. currently test failing following error: expected spy getconfigurationstatuses have been called. error: expected spy getconfigurationstatuses have been called. if can please point me in right direction appreciate it. i'll post code below -thanks help! here's specs (the 1 not working "should call specific configurations if user authenticated" spec: describe('environmentctrl specs', function(){ var $rootscope = null, $scope = null, ctrl = null; var authentication = { getcredentials: function(){ return true; } }; var environment = { ...

java - Alert Dialog (List) custom rows for items -

i trying popup list backed string array, using following code: public void gamedialog(activity activity) { textview title = new textview(activity); title.settext("click number make call"); title.setbackgroundcolor(color.black); title.setpadding(10, 10, 10, 10); title.setgravity(gravity.center); title.settextcolor(color.white); title.settextsize(20); alertdialog.builder builder = new alertdialog.builder(activity); builder.setcustomtitle(title); //builder.seticon(r.drawable.alert_36); // builder.setmessage(""+arrayphones); builder.setcancelable(false); builder.setitems(arrayphones,new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialoginterface, int i) { } }); alertdialog alert = builder.show(); textview messagetext = (textview)alert.findviewbyid(android.r.id.message); ...

oracle sql wih rownum <= -

why below query not giving results if remove < sign query.because without < must match results? query used second max id value: select min(id) from( select distinct id student order id desc ) rownum <=2 student id 1 2 3 4 rownum has special meaning in oracle. increased every row, optimizer knows increasing continuously , consecutive rows must met rownum condition. if specify rownum = 2 never occur since first row rejected. you can see nice if explain plan on query. show like: plan rownum <= : count stopkey plan rownum = : filter

knockout.js - Unable to update observable value in subscribe method -

i have subscribe function fires when dropdown value changes. want update observable value inside subscribe function. probelm when control leaves subscribe function observable value got null or empty. self.selectedsubaccount.subscribe(function (newvalue) { //alert("the selected account code:" + newvalue); var likecode = newvalue.substring(0, 2); var acctype = "control"; self.account_code = genrateaccountcode(self.subaccounts(), likecode, acctype); }); assuming self.account_code observable, update so: self.account_code(genrateaccountcode(self.subaccounts(), likecode, acctype));

c# - Disable buttons after click until post back of ascx control using javascript -

the page works expected, disables buttons , shows loading indicator onclick event never called. relatively inexperienced javascript , cannot seem find answer why doesn't work. i expect once disable() method occurs , returns true call onclick method, cause post , automatically re-enable buttons. perhaps going @ wrong, appreciate help. <%@ register tagprefix="componentart" namespace="componentart.web.ui" assembly="componentart.web.ui" %> <%@ control language="c#" inherits="mycontrol" codebehind="thiscontrol.ascx.cs"%> <div class="form" style="width: 100%"> <img id="imgloading" src="images/gridimages/spinner.gif" style="display:none" alt="loading..." /> <ol> <li> <asp:button id="firstbutton" cssclass="btn" runat="server" text="first press me" onclic...

tree - ExtJs 4.2: TreePanel recursive root node load instead of children -

playing around extjs v4.2.1 (trial) not build complete treepanel json file. every time expanded/collapse children, request made server responded same json duplicating root node. first needed rood node interpreted json file , not hardcoded in store, second ajax request reading json file simulate server response. so after lot of googling reading q/a here what i've tried : checked nodes leaf=true/false ( see ) hardcoded root node in store added loaded=true nodes ( see ) added reader proxy point root node in json response ( see ) played around rootvisible=bool , many more ... how load tree json including childrens in version of extjs (v4.2.1) ? i didn't wanted bind event , workaround, had work without custom function or overwrite (there lot of workaround out there suggesting that). so worked me: view/menus.js: ext.define('extapp.view.menus', { extend : 'ext.tree.panel', alias : 'widget.menus', store ...

sanitize - how to remove html and javascript from input field before sending to server -

<form action="process_reg.php" method="post" name="register_form" id="register_form"> <input class="logbar" id="fname" name="fname" type="text" placeholder="firstname" onfocus="checkfname(); return true;" onblur="leavefname();" required> <span id="fnamemessage"></span> <input class="logbar" id="lname" name="lname" type="text" placeholder="lastname" onfocus="checklname(); return true;" onblur="leavelname();" required> <span id="lnamemessage"></span> <input class="logbar" id="email" name="email" type="text" placeholder="email" onfocus="checkemail();" onblur="leaveemail();" required> <span id="emailmessage"...

sql server 2008 r2 - Extract part of a string in SQL -

in sql server 2008 r2 need extract string between character 50 , 60. i've searched similar function on internet didn't find can address problem. i can on excel formula like: mid(a2, 50, 10) the sql function called substring substring(fieldname,50,10)

Windows services authentication using Kerberos from Java program on linux -

hie everyone, struggling problem of authentication few days now. work on web app on tomcat7/java7/linux , need access windows ssrs server app. when run code on windows machine, work fine, authentication done windows , use: inputstream pdfinstream = new bufferedinputstream(pdfurl.openstream(), buffersize); on linux server, use kerberos through gss-api javax.security.auth.login.logincontext , able authenticate against kerberos server: logincontext .login() works fine. and stuck here, windows authentication in java suggest deprecated tool, oracle documentation kept me days without getting point, spnego ( http://spnego.sourceforge.net/ ) doesn't seem address problem. thanks in advance! refs: oracle documentation: docs.oracle.com/javase/7/docs/technotes/guides/security/jgss/tutorials/basicclientserver.html docs.oracle.com/javase/7/docs/technotes/guides/security/jgss/tutorials/clientserver.html docs.oracle.com/javase/7/docs/technotes/guides/security/jgss/tutorials/acnand...

javascript - d3.js svg image: scale from center of rectangle -

i'm using d3 populate cartesian plane bunch of svg:image elements spread out on different coordinates. i'd add mouserover , mouseout logic zooms image mouse on in , lightens opacity of others. i'm filtering selection on mouseover select desired element , working great, except scaling logic doesn't seem desired effect. images expand downward , right rather in outward diagonal center. here's i've tried: transform: scale(1.5) expands, totally shifts image's position transform: translate(-(width/2), -(height/2)) combined scale, same different starting position changing x , y coords ones adjusted half widths , heights, has same effect. is there no text-anchor equivalent image elements set "anchor point" scale from? i'm not sure html svg parlance is, guess i'm thinking of similar anchor points lot of vector editors have. current approach, mouseover handler: function fade(dir){ return function(d){ var other...

Consolidate table using soundex -

i have massive table of similar sounding entries(around 500) , order numbers next them: eg. benzin 3000, ben 209, benziloate 800, . . . cret 20, cretis 333, etc. please note first 3 letters not same names similar sounding. have been trying figure out system find similar sounding entries, collate them 1 , add values of orders. have tried soundex searches similar sounding letters, have not been able modify includes more 1 entry , includes sum of orders next it. does have suggestions of easier way of doing this? thank in advance

php - Find out if a date/time string contains a timezone -

i have table date/time information stored strings. due poor planning, of strings have timezone in them (e.g., "2014-01-13 04:22 -8" ) , others don't ( "2014-01-13 04:22" ). either type of string works fine strtotime() or new datetime() once that, information whether there timezone lost -- strings without timezone assigned server's default timezone. there function can use find out whether string contains timezone identifier? it seems trivial write regex this, experience tells me date formats have enough variation , weird special cases it's better use built-in functions when possible. you haven't lost information whether or not there timezone in date/time string once have created datetime object. if var_dump() on datetime object, output this:- object(datetime)[1] public 'date' => string '2014-01-13 04:22:00' (length=19) public 'timezone_type' => int 1 public 'timezone' => string '-0...

javascript - Why is the loop assigning a reference of the last index element to? -

this question has answer here: javascript variable binding , loop 4 answers javascript closure inside loops – simple practical example 31 answers i want add event listener of tags, each passing reference itself parameter when triggered. here function wrote: function validatedigitsfeature() { // add event listeners input tags // array of input tags var inputtags = document.getelementsbyclassname('validateinput'); var tagid; // loop through them, adding onkeypress event listener each 1 (var = 0; < inputtags.length; i++) { // give each input element id tagid = inputtags[i].id = 'input_id_' + i; inputtags[i].addeventlistener('keyup', function(){isnumberordot(event, tagid);}, false); }...

Java SOAP web service over SSL with basic authentication, connection refused -

i trying send soap request on ssl own little java client , fails "java.net.connectexception: connection refused". same request sent soapui not fail, valid response server. this code trying run: public static void main(string[] args) throws malformedurlexception { system.setproperty("sun.security.ssl.allowunsaferenegotiation", "true"); sslutilities.trustallhttpscertificates(); url wsdlurl = new url(my_wsdl_location); qname servicename = new qname(my_qname, name_of_service); service service = service.create(wsdlurl, servicename); order myorder = service.getport(order.class); bindingprovider portbp = (bindingprovider) myorder; string urlused = (string) portbp.getrequestcontext(). get(bindingprovider.endpoint_address_property); system.out.println("using url: " + urlused); ((bindingprovider)myorder).getrequestcontext().put( bindingprovider.username_property, correct_usernam...

css3 - Twitter Bootstrap 3.1.0: multiple visible-* -

in bootstrap 3.0.3, 1 use multiple visible-* classes explicitly hide content according device width. unfortunately, release of bootstrap 3.1.0, bugging , content hidden @ wrong width (eg. @ medium size instead of small, despite use of visible-md visible-lg ). please see http://bootply.com/109923 demo. anyone has quick-fix or explanation that? solutions quick-fix @natsu: use .hidden-* classes instead a quick fix instead use .hidden-* classes: <ul class="hidden-xs hidden-sm"> <li></li> </ul> http://jsfiddle.net/52vtd/2135/ it appears .visible-lg overriding .visible-md @ medium breakpoint: http://linenwoods.com/test.png

html - How to keep text from going behind an image -

i trying keep top-bar navigation going behind logo image on header of page. see below example of page when maximized in screen: maximized view here looks when browser window made smaller: smalller screen example i trying fix page top nav-bar runs behind image when window made smaller, instead move , extend right. any ideas? site inhishands.com thanks! your problem menu ( <ul id="display"> ) has css property float:right , positioned relative right side of screen. when screen made smaller, right side moves closer left, menu moves leftwards (and overlaps logo). if want menu start right side of logo (and not overlap it), give property float:left , add margin left side (like margin-left:370px ). there other ways of positioning (like using absolute positioning) job done.

foreach - PHP JSON to Array Error -

i have code: $decode_datab = json_decode($grab_datab, true); $unranked = ''; foreach($decode_datab->playerstatsummaries $summary){ if($summary->playerstatsummarytype == 'unranked'){ $unranked = $summary; break; } } for reason, can't figure out, $decode_datab doesn't work foreach() . have tried $decode_datab = json_decode($grab_datab); works uses of website, errors. any great! in advance edit: someone wanted $grab_datab although has nothing error: $instance = new riotapi($region); $grab_datab = $instance->getstats($grab_id); uh... you're passing true second parameter, thereby getting associative array. why, then, treating object? -> getting object properties. foreach($decode_datab['playerstatsummaries'] $summary){ if($summary['playerstatsummarytype'] == 'unranked'){ $unranked = $summary; break; } }

java - Autowiring standalone application with NoSuchBeanDefinitionException -

i have application, can't run in eclipse or elsewhere. here class : package fr.aaa; import org.springframework.context.applicationcontext; import org.springframework.context.support.classpathxmlapplicationcontext; import org.springframework.stereotype.component; @component public class computation { public computation() { } public static void main(string[] args) { applicationcontext context = new classpathxmlapplicationcontext("classpath*:applicationcontext.xml"); computation computer = context.getbean(computation.class); } } and applicationcontext.xml file : <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xmlns:security="http://www.springfram...

c# - Calculate sum of column using group by in Linq -

i have list structure : public class factor { public datetime? date { set; get; } public string innovoiceid { set; get; } public string explain { set; get; } public string tax { set; get; } public string transport { set; get; } public int64? bedehkar { set; get; } public int64? bestankar { set; get; } public int64? mande { set; get; } } list<factor> factors = new list<factor>(); i created query groups records based on innovoiceid .and calculate sum of tax , sum of transport , bedehkar , bestankar , mande . my query is: list<factor> factorsortlist = factors.orderby(o => o.date) .tolist() .groupby(i => i.innovoiceid) .select(g => new { tax = g.sum(i => convert.toint32(i.tax)), transport = g.sum(i => convert.toint32(i.transport)), bedehkar = g.sum(i => i.bedehkar), bestankar = g.sum(i => ...

writing to different file names using for loop in C++ visual studio -

i trying write data different files each index. i.e. file name should change datafile0.res datafile99.res depending on index passed. i using visual c++ 2008. the code is: void write_data(int index) { ofstream coutput; // first need convert integer index string. not sure if right? ostringstream temp; temp<<index; std::string s = temp.str(); std::string dir = "c:\my_data\datafile" + s + ".res"; coutput.open(dir); when run code, following error appears: error c2664: 'void std::basic_ofstream<_elem,_traits>::open(const wchar_t ,std::ios_base::openmode,int)' : cannot convert parameter 1 'std::string' 'const wchar_t *' 1> 1> [ 1> _elem=char, 1> _traits=std::char_traits<char> 1> ] 1> no user-defined-conversion operator available can perform conversion, or operator cannot called. please need help. thanks in advance this has nothing stat...

windows - How to get the output of subprocess.check_output() python module? -

i'm trying information command prompt (cmd - windows ) in python, using module subprocess : ipconfig = subprocess.check_output("ipconfig") print(ipconfig) the result is: b'\r\nwindows ip configuration\r\n\r\n\r\nethernet adapter local area connect:\r\n\r\n connection-specific dns suffix . : xx.xxx\r\n ipv4 address. . . . . . . . . . . : xxxxxxxxx\r\n subnet mask . . . . . . . . . . . : xxxxxxxxxx\r\n default gateway . . . . . . . . . : xxxxxx\r\n' i've read documentation on module subprocess didn't find fits problem. i need information in nice formatted string ... not that, do? (i think problem here string format, if have tips getting nice output without needing of string formatting, appreciate) i know can ip address socket module, i'm giving example. you printing bytes string value, , print() turned unicode string using repr() . want decode value unicode instead: import sys print(ipconfig.decode(sys.stdout.enc...

java - Converting binary to decimals and characters -

i want convert binary decimals , characters this: 11010 --> 1101 + 0(parity bit) -->decimals= 11 --> char ";" 10101 --> 1010 + 1 -->decimals= 5 --> char "5" . . public class stringek { string bitek = "1101010101001000001000001"; string[] bits; string four; char par; int parity; string digits; int n = 0; int b; int kurens; int decimalis; int digit; public stringek() { this.kurens = 0; bits = new string[200]; (int = 0; < 25; += 5) { bits[n] = bitek.substring(i, + 5); n++; } (int = 0; < n; ++i) { int j = 0; 4 = bits[i].substring(j, j + 4); (int p = 0; p < 4; ++p) { b = integer.parseint(four.substring(p)); kurens += b; } par = bits[i].charat(j+4); //system.out.print(par); parity = par-...

c# - Part of Control Ghosts After Close -

i'm not sure how explain experience issue popup dialog (say file browser), , after closed, part of dialog remains visible on top of app. if minimize , restore go away. is common issue? i have ever seen window on stops responding , cannot update area has been revealed. respond again redraws. maybe repeat test , not minimize window behind?

python - Locating the first item in a list of lists -

this question has answer here: list of lists changes reflected across sublists unexpectedly 13 answers python initializing list of lists [duplicate] 1 answer i have scenario: >>> y=[[1]] >>> y=y*2 >>> y [[1], [1]] >>> y[0].append(2) >>> y [[1, 2], [1, 2]] what i'd add 2 first list within outer list i.e. desired output: [[1, 2], [1]] doing: y=[[1]] y=y*2 creates list 2 references same list object: >>> y=[[1]] >>> y=y*2 >>> id(y[0]) # id of first element... 28864920 >>> id(y[1]) # ...is same id of second. 28864920 >>> this means that, when modify one, other affected well. to fix problem, can use list comprehension instead: >>> y = [[1] _ in xrange...

coldfusion - Dealing with WhiteSpaces while accessing Structure "keys" -

Image
please consider following image: so, how correctly access "android phone" key in structure. when following(an excerpt code): <cfloop from="1" to="#arraylen#" index="i"> <cfif structkeyexists(cfdata[i], "open")> <cfoutput>#cfdata[i].open.aol#</cfoutput> <cfelse> null </cfif> </cfloop> it works fine, however, when try <cfoutput> following : <cfoutput>#cfdata[i].open.android phone#</cfoutput> or <cfoutput>#cfdata[i].open.androidphone#</cfoutput> i following error: element open.androidphone undefined in cfml structure referenced part of expression. the error occurred in c:myfile.cfm: line 185 183 : <!--- <cfloop list="#keylist#" index="colitem"> ---> 184 : <cfif structkeyexists(cfdata[i], "open")> 185 : <cfoutput>#cfdata...

c# - Large sized string by ref or value? -

i understand string sent value though reference type, if string tens of mb in size , wanted send argument. should send reference or value? private int getindexofnext(string string,int searchstartindex,char targetchar) or private int getindexofnext(ref string string,int searchstartindex,char targetchar) i understand string sent value though reference type for strings or other reference types, address passed value . not value gets passed, case doesn't matter. reason parameter passing involving strings looks different because strings immutable (and when try modify string's content) . you should see: parameter passing in c# jon skeet

rails 4 using strong parameters with no controller -

rails 4: i'm coming rails 3.2.x , have question. how can use strong parameter no controller. i have model: track (the 1 has controller ) has_many :tracksegments, :dependent => :destroy has_many :points, :through => :tracksegments tracksegment belongs_to :track has_many :points, :dependent => :destroy points belongs_to :tracksegment track 1 has controller has strong parameters. i want know can put parameters belongs "tracksegment" , "points" in rails 3.x it's direct in model in rails 4 have no controller them. you permit parameters whichever controller sending them through. sounds sending them through track controller, if add them there. see question how permit nested params rails 4 - strong parameters - nested objects

pygame - Python Blitting not working? -

i'm writing game in python , pygame , trying create main menu, label wont show up????, im getting error: line 22, in x,y = pygame.mouse.get_pos() error: video system not initialized???? don't understand happening here because new python heres code: bif="menubg.jpg" load_check_x = "null" load_check_y = "null" import pygame, sys pygame.locals import * x = 0 y = 0 pygame.init() screen=pygame.display.set_mode((640,360),0,32) background=pygame.image.load(bif).convert() pygame.display.set_caption("some random title") pygame.display.flip() #screen.fill((0,0,0)) while true: evc = pygame.event.get() event in evc: if event.type == pygame.quit: pygame.quit() x,y = pygame.mouse.get_pos() #setup mouse pos!!! if x >= 340 , x <= 465: load_check_x = "true" if x < 340 or x > 465: load_check_x = "false" if y >= 425 , y <= 445: load_check_y = "true" if ...

SQL Query to return one-to-many relationship in columns -

sql newbie here. i trying return table list of memberships belong each user. data in 2 tables, 1 table of users name , description, , other table 1 or more records each user name , membership identifier: user table name description ------ ----------- user01 first user user02 second user membership table name membership ------ ---------- user01 group01 user01 group02 user02 group01 user02 group03 user02 group05 so far code have returns 1 line each membership user has: select u.name, u.description, m.groupname user u, membership m u.name = m.username order u.name name description membership ------ ----------- ---------- user01 first user group01 user01 first user group02 user02 second user group01 user02 second user group03 user02 second user group05 i want return list of users, followed groups user belongs to: name description membership ------ ----------- ---------- user01 first user group01, group02 user02 second user group01, group03, gr...

spring - Grails TransientObjectException -

this related this post , find of config. ldap user mapped database user table , entry created fine. userdetails tries authorities main user class resulting in following exception: 2014-01-31 12:10:52,076 [http-bio-8111-exec-4] error [/step].[default] - servlet.service() servlet [default] in context path [/step] threw exception message: object references unsaved transient instance - save transient instance before flushing: packagae.user; nested exception org.hibernate.transientobjectexception: object references unsaved transient instance - save transient instance before flushing: package.user line | method ->> 102 | docall in org.grails.datastore.gorm.gormstaticapi$_methodmissing_closure2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 42 | getauthorities in package.user | 27 | getauthorities . . . in package.mdtuserdetails | 72 | attemptauthentication in grails.plugin.springsecurity.web.authentication.req...

php - Rewrite url to show content from other url -

when http://www.placewomen.com/500/400/ called possible show contents of http://www.placewomen.com/c/500/400/ , makes c gone? a bit tricky because there check empty sub , physically new url-rewrite doens't exist... right htaccess; options +followsymlinks -multiviews -indexes rewriteengine on rewritecond %{http_host} ^placewomen.com [nc] rewriterule ^(.*)$ http://www.placewomen.com/$1 [r=301,l] rewritecond %{the_request} \s/+new/index\.php\?var=([^\s&]+) [nc] rewriterule ^ /%1? [r=301,l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.+)$ /new/index.php?var=$1 [qsa,l] rewritecond %{request_filename} -d rewritecond %{request_filename}/placeholder.jpg -f rewriterule ^(.*)$ /$1/placeholder.jpg [l] i'm frontender myself perhaps you'll understand behind knowledge... try adding this: rewritecond %{document_root}/c/$1 -f [or] rewritecond %{document_root}/c/$1 -d [or] rewritecond %{docume...

Android viewpager for screen slides -

i trying build app following requirements: each page has image , text, , right-left page swipe refreshes page display new image , text. the user should able swipe right-left endlessly (with no limits on number of pages). i want able fetch content next pages (from server), prior user swiping next page, better response times. i want restrict user allow right-left swipes , no way swipe older pages (only ensure don't need save older pages in memory). therefore can discard older views/pages memory. not sure how need modify examples given @ http://developer.android.com/training/animation/screen-slide.html achieve expected results.

javascript - Catch img who are within a certain div -

i have code in page: $('img[title!=""]').each(function() { it selects img 's in website, want images within div called 'layout' title not null, how this? assuming layout id of div use $('img[title!=""]', '#layout').each(function() { or $('#layout img[title!=""]').each(function() {

c# - Dynamic created radio buttons wont execute event on click -

i have button named "add radio button" in form, , text box named texbox1. i've written code when click "add radio button", generates radio button; it's own name: c#: using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.htmlcontrols; using system.web.ui.webcontrols; public partial class default2 : system.web.ui.page { protected void page_load(object sender, eventargs e) { if (!ispostback) { viewstate["counter"] = 0; } } protected void button1_click(object sender, eventargs e) { (int = 0; <= convert.toint32(viewstate["counter"]); i++) { htmlgenericcontrol div = new htmlgenericcontrol("div"); radiobutton rb = new radiobutton(); rb.id = i.tostring(); rb.text = "button" + i.tostring(); rb.groupname = "rb...

ssl - Is a Wildcard SAN certificate possible? -

is possible secure multiple domains single certificate using wildcard domains , san? for example, 1 san certificate secures both *.domain1.com , *.domain2.com ? everything have read far seems indicate can have either wildcard certificate (*.domain1.com) or san certificate (host1.domain1.com, host2.domain2.com), not combination. correct? i assume use want use certificate http. in case need @ rfc 2818. rfc defines common name should used if no subject alternative names configured, allows wildcards certificates in san extension. should possible combine several non-wildcard , wildcard certificates inside san part of certificate. it looks various cas have different policies creating certificates mixing wildcard , non-wildcard: while thawte argues mixing not possible ( https://community.thawte.com/blog-posts/difference-between-wildcard-ssl-vs-san-certificate ) digicert propagates best of both worlds ( http://www.digicert.com/ssl-support/wildcard-san-names.htm ). seems mor...

java - generate classes from schema -

i have jdk1.6 , using eclipse juno verion , class path set jdk1.6. i have created jaxb project , set project face of use jaxb 2.1 , jdk1.6. but when try generate java classes xsd, getting below error message. as understand if have jdk 1.6, don't need have other jaxb jars in build path of project. error: classpath project not appear contain necessary libraries proceed class generation. please help no friend have add jaxb-api jar build path doesn't comes jdk download jax-b here https://jaxb.java.net/ , puts “jaxb-api.jar” , “jaxb-impl.jar” on project classpath i.e. in buildpath but prefer have create maven project, have add dependencies in project , maven download these dependencies maven repo, if have not define repository in maven settings.xml , make project light-weight well

networking - Communicating between networks using sockets -

i have question network connections among computers. i've made applications messages pass through internet (via sockets) make connection between 2 devices. however, strong condition 2 devices must connected same network. can give me trick how create communication using sockets between 2 computers if connected different netwkorks? thank in advance. here great tutorial on how use sockets , general networking (in java) http://www.thenewboston.org/watch.php?cat=25&number=38 in order communicate between 2 diffrent networks on internet, need called port forwarding . when public ip of network receives packet spesific port number. router knows send packet local ip. if dont port forward , receive data. router doesent know send packet. therefore discards it, means others wont able connect you. you need port forward network server (using example linked). how logging in router, , port server uses gets forwarded ip of pc hosting server. on other network (clie...

How to check if COM port exist before opening connection in Visual C# -

i need check if selected com port exist before conecting (it gives error) i'm using visual studio express 2013 c#. or, there way hide error? thanks.. ~richard i'd use system.io.ports.serialport.getportnames - returns array of valid serial port names can opened.

javascript - Unauthorised domain name masking -

today noticed several domains using masking associate domain name content. e.g. “draughtmark.co.uk” , “recycleofficewaste.co.uk” (plus several others). can prevent , bots indexing content under domains (otherwise site penalised)? i have since put in javascript , php function detect , redirect site. seems prevent people unknowingly browsing content on domain, don't know if in regards bots either requires referrer set or javascript file loaded. use canonical urls in html no matter domain served under pages given proper credit being original. although designed deal duplicate content on website, changed work across domains republished works.

javascript - How to successfully integrate AppWarp to ActionScript 3 code? -

i want create flash multiplayer game facebook . done game's code, don't know how integrate appwarp correctly. i've created app on apphq, have api , secret keys, created room have room's id. when in main class actionscript 3.0 code try use this: public class script extends movieclip { public var roomid:string = "my room id"; private var apikey:string = "my api key" private var secretkey:string = "my secret"; private var listener:appwarplistener; } public function script() { warpclient.initialize(apikey, secretkey); warpclient.getinstance().setconnectionrequestlistener(listener); warpclient.getinstance().setroomrequestlistener(listener); warpclient.getinstance().setnotificationlistener(listener); } i got errors (in appwarplistener.as file) : 1045: interface connectionrequestlistener not found. 1045: ...

c++ - Remote Injection -

so, i'm injecting code in memory of process this: void remoteinj::executefunction(dword start, dword end, dword entry, remoteargs* args) { unsigned long id; int size = end - start; cout << size << endl; void* func = virtualallocex(hprocess, null, size+10, mem_commit, page_execute_readwrite); void* ep = (void*)(entry-start+(dword)(func)); writeprocessmemory(hprocess, func, (void*)start, size, null); void* data = virtualallocex(hprocess, null, sizeof(remoteargs)+1, mem_commit, page_readwrite); writeprocessmemory(hprocess, data, (void*)args, sizeof(remoteargs), null); cout << hex << func << endl; cout << "function: 0x" << hex << start << endl << "end: 0x" << hex << end << endl; system("pause"); createremotethread(hprocess, null, null, (lpthread_start_routine)ep, data, null, null); closehandle(hprocess); } my problem is:...