Tuesday, 15 May 2012

java - Regex for almost JSON but not quite -



java - Regex for almost JSON but not quite -

hello i'm trying parse out pretty formed string it's component pieces. string json it's not json strictly speaking. they're formed so:

createdat=fri aug 24 09:48:51 edt 2012, id=238996293417062401, text='test test', source="region", entities=[foo, bar], user={name=test, locations=[loc1,loc2], locations={comp1, comp2}}

with output chunks of text nil special has done @ point.

createdat=fri aug 24 09:48:51 edt 2012 id=238996293417062401 text='test test' source="region" entities=[foo, bar] user={name=test, locations=[loc1,loc2], locations={comp1, comp2}}

using next look able of fields separated out

,(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))(?=(?:[^']*'[^']*')*(?![^']*'))

which split on commas not in quotes of type, can't seem create jump splits on commas not in brackets or braces well.

because want handle nested parens/brackets, "right" way handle them tokenize them separately, , maintain track of nesting level. instead of single regex, need multiple regexes different token types.

this python, converting java shouldn't hard.

# comma sep_re = re.compile(r',') # open paren or open bracket inc_re = re.compile(r'[[(]') # close paren or close bracket dec_re = re.compile(r'[)\]]') # string literal # (i lazy escaping. add together other escape sequences, or find # "official" regex use.) chunk_re = re.compile(r'''"(?:[^"\\]|\\")*"|'(?:[^'\\]|\\')*[']''') # class could've been generator function, couldn;'t # find way manage state in match function wasn't # awkward. class tokenizer: def __init__(self): self.pos = 0 def _match(self, regex, s): m = regex.match(s, self.pos) if m: self.pos += len(m.group(0)) self.token = m.group(0) else: self.token = '' homecoming self.token def tokenize(self, s): field = '' # field we're working on depth = 0 # how many parens/brackets deep while self.pos < len(s): if not depth , self._match(sep_re, s): # in java, alter "yields" append list, , you'll # have equivalent (but non-lazy). yield field field = '' else: if self._match(inc_re, s): depth += 1 elif self._match(dec_re, s): depth -= 1 elif self._match(chunk_re, s): pass else: # else consume 1 character @ time self.token = s[self.pos] self.pos += 1 field += self.token yield field

usage:

>>> list(tokenizer().tokenize('foo=(3,(5+7),8),bar="hello,world",baz')) ['foo=(3,(5+7),8)', 'bar="hello,world"', 'baz']

this implementation takes few shortcuts:

the string escapes lazy: supports \" in double quoted strings , \' in single-quoted strings. easy fix. it keeps track of nesting level. not verify parens matched parens (rather brackets). if care can alter depth sort of stack , push/pop parens/brackets onto it.

java regex

json - SerializeObject adds unicode c# -



json - SerializeObject adds unicode c# -

i have wcf service returns database tables in json format. seralizeobject adds unicode httpresponse, how can remove this?

code:

using (var db = new newtestdbcontext()) { var query = b in db.roads orderby b.roadid select b; road rr = query.first(); var serializersettings = new jsonserializersettings { preservereferenceshandling = preservereferenceshandling.objects }; homecoming jsonconvert.serializeobject(rr, formatting.indented, serializersettings);

reponse:

"{\u000d\u000a \"$id\": \"1\",\u000d\u000a \"roadparts\": [\u000d\u000a {\u000d\u000a \"$id\": \"2\",\u000d\u000a \"road\": {\u000d\u000a

responseformat = webmessageformat.json

that json encode homecoming value of annotated method. if homecoming value json string, json encoding twice.. first road object , json string resulting former.

so homecoming road object , allow webmessageformat.json handle json encoding.

c# json unicode entity

database design - MYSQL populate foreign id with value -



database design - MYSQL populate foreign id with value -

i have printed table here, , issue query effort bring together tables tech_id, clients_id, job_id, part_id should populate corresponding key in tables / column too.

here query:

select * work_orders, technicians tech, parts_list parts, job_types job, clients client left bring together technicians on tech_id = technicians.tech_name left bring together parts_list on part_id = parts_list.part_name left bring together job_types on job_id = job_types.job_name left bring together clients on clients_id = clients.client_name

i've messed around multiple different variations, 1 seem syntax correct, i'm getting: column 'clients_id' in on clause ambiguous

i'm sure happen not clients maybe others. want able print table in image above, clients listed. possible done via 1 query well? thanks.

you have 2 problems.

first (this might not problem, that's "good practice"), shouldn't utilize select *, indeed have field same name in different tables.

this 1 (of many) reason avoid * in select clause.

then, main problem select tables in clause, , 1 time again joining.

problematic line :

from work_orders, technicians tech, parts_list parts, job_types job, clients client

so (i don't know table structure, may errors, you've got idea)

select w.client_id, t.tech_name --etc work_orders w left bring together technicians t on c.tech_id = t.tech_name left bring together parts_list p on c.part_id = p.part_name left bring together job_types j on w.job_id = j.job_name left bring together clients c on w.clients_id = c.client_name

mysql database-design

BOOST Hardening Guide (Preprocessor Macros) -



BOOST Hardening Guide (Preprocessor Macros) -

i'm having hard time determining preprocessor macros should utilize boost (1) debug instrumentation (such checked iterators) , (2) security related items.

all can seem find preprocessor metaprogramming (linked www.boost.org/libs/preprocessor/).

update (02-18-2013): found boost macro reference, lacks related debugging or security.

does know of list of available preprocessor macros debugging , security or hardening guide?

there's not equivalents i'm aware of in of boost libraries. few of them respect ndebug , create optimisations based on (and there asserts ndebug disable), setting ndebug release not debug seem expected (whether leaving ndebug undefined release counts "hardening" don't know). none of libs have options beyond give them armour-plating or debuggability.

how boost libraries should interact microsoft's _has_iterator_debugging , particularly _secure_scl recurring debate see e.g here, here , here (for "header-only" libraries doesn't create much difference; it's more of problem making sure provided dlls compatible integrators expect, , there's no universal understanding on whether ms defaults these options should used or not many people suspicious of performance overheads).

boost preprocessor boost-preprocessor

Java only uses Default Constructor won't calculate by entered parameters -



Java only uses Default Constructor won't calculate by entered parameters -

i've looked on code few times , i'm not sure affecting , forcing utilize default constructor. illustration if seek set in 2000 amount invested still default 1000.

public class investment { private double moneyinvested; private double yearsinvested; public final static double amount_default = 1000; public final static double years_default = 5; public final static double rate = 0.12; public investment() { moneyinvested = amount_default; yearsinvested = years_default; } public investment(double amount_default, double years_default) { if (moneyinvested <= 0) { moneyinvested = amount_default; } if (yearsinvested <= 0) { yearsinvested = years_default; } } public double getmoneyinvested() { homecoming moneyinvested; } public double getyearsinvested() { homecoming yearsinvested; } public void setmoneyinvested(double inputmoney) { moneyinvested = inputmoney; if (inputmoney <= 0) { inputmoney = 1000; } } public void setyearsinvested(double inputyears) { yearsinvested = inputyears; if (inputyears <= 0) { inputyears = 1; } } public static string returnvalue(double inputyears, double inputmoney) { double returninvestment; int inityears = 1; string returnvalue = ""; while (inityears <= inputyears) { returninvestment = math.pow(1.12, inityears) * inputmoney; int investreturn = (int) returninvestment; returnvalue = "the amount @ end of year " + inityears + " " + investreturn; joptionpane.showmessagedialog(null, returnvalue); inityears++; } homecoming returnvalue; } } public class makeinvestment { public static void main(string[] args) { investment otherclass = new investment(); double ya = otherclass.years_default; double ma = otherclass.amount_default; while (inputamount() == false) { inputamount(); } while (inputyears() == false) { inputyears(); } otherclass.returnvalue(ya, ma); } public static boolean inputamount() { string amountamount = ""; amountamount = joptionpane.showinputdialog(null, "enter amount invest (9999).", "investment amount", joptionpane.question_message); if (amountamount == null || amountamount.length() == 0) { joptionpane .showmessagedialog( null, "nothing entered - must come in number amount invested.", "investment amount error", joptionpane.error_message); homecoming false; } (int = 0; < amountamount.length(); i++) { if (!character.isdigit(amountamount.charat(i))) { joptionpane.showmessagedialog(null, "you must come in number amount invested.", "investment amount error", joptionpane.error_message); homecoming false; } } double dblamount = double.parsedouble(amountamount); homecoming true; } public static boolean inputyears() { string yearamount = ""; yearamount = joptionpane.showinputdialog(null, "enter number of years invest.", "investment years", joptionpane.question_message); if (yearamount == null || yearamount.length() == 0) { joptionpane .showmessagedialog( null, "nothing entered - must come in number years invest.", "investment years error", joptionpane.error_message); homecoming false; } (int = 0; < yearamount.length(); i++) { if (!character.isdigit(yearamount.charat(i))) { joptionpane.showmessagedialog(null, "you must come in number of years invest.", "investment years error", joptionpane.error_message); homecoming false; } } double dblyear = double.parsedouble(yearamount); homecoming true; } }

nothing "forcing utilize default constructor". you're ever calling default constructor

investment otherclass = new investment()

to utilize 2-argument constructor, pass in arguments

new investment(2000.0d, 5.0d)

java parameters default-constructor

vb6 migration - How can we migrate the VB6 code to Vb.NET? -



vb6 migration - How can we migrate the VB6 code to Vb.NET? -

i have problem while converting vb6 code vb.net .can 1 help me convert next lines of code?

bin_str = strconv(imga, vbunicode)

bin_str -- > string imga -- > variant type

i believe right way this:

bin_str = system.text.encoding.unicode.getstring(imga)

vb.net-2010 vb6-migration

Pre-Login Handshake Error Connecting to SQL Server 2012 through VS 2012 -



Pre-Login Handshake Error Connecting to SQL Server 2012 through VS 2012 -

so i'm trying connect sql server 2012 instance running on local server running windows server 2012 through visual studio 2012's sql server object explorer. can connect through other computers, locally , remotely, fine, reason desktop gives me lovely error:

"a connection established server, error occurred during pre-login handshake. (provider: ssl provider, error: 0 - wait operation timed out.) (microsoft sql server, error: 258) - wait operation timed out."

i'm using sql server authentication in ss2012, unencrypted, etc. i'm not sure info include, i'm sure it's stupid issue, life of me can't find solution. searches give me bunch of old hell results.

have tried qualified domain name?

looks dns issue

visual-studio-2012 sql-server-2012 handshake

swing - The TableFilterDemo.java is not working -



swing - The TableFilterDemo.java is not working -

i learning how add together filter jtable, found tutorials in sun website

http://docs.oracle.com/javase/tutorial/uiswing/examples/components/tablefilterdemoproject/src/components/tablefilterdemo.java

i copied code netbeans, code complied , run successfully, when come in "jane" in filtertext table info disappears instead of showing row.

looking help give thanks you.

it's case sensitive. type "jane"

good luck

update

if want create case insensitive (?i) works fine before regex alter line

rf = rowfilter.regexfilter(filtertext.gettext(), 0);

like this.

rf = rowfilter.regexfilter("(?i)"+ filtertext.gettext(), 0);

good luck!

java swing jtable

doctrine2 - PHPStorm not showing relationships of Symfony2 Doctrine Entities -



doctrine2 - PHPStorm not showing relationships of Symfony2 Doctrine Entities -

i'm using phpstorm 5 , symfony2 doctrine2 entities. i'm using annotations specify relationships.

when seek generate diagram of bundles , entities shows diagram of individual classes / entities no relationships between entities.

i thought supported phpstorm?

as far know, diagram generated phpstorm shows classes extend class or implement interfaces.

it looks this:

new in phpstorm 5 symfony2 support, eg. can run symfony2 app/console tool out of ide, , supports mvc project view, hast nil diagrams.

symfony2 doctrine2 data-modeling phpstorm

javascript - Status bar Message Not shown on hosted website -



javascript - Status bar Message Not shown on hosted website -

i have used below script show message on status bar in browser.

if session("username") isnot nil dim strusermessage string = session("username").tostring & ", welcome abc application" page.clientscript.registerstartupscript(me.gettype(), "struser", "<script>window.status = '" & strusermessage & "' </script>") end if

however, message shown on locahost/intranet.

but whenever have hosted site on internet. message not shown.

do have create configuration settings ???

javascript asp.net

java - Need to know about one PMD rule -



java - Need to know about one PMD rule -

this question has reply here:

when should 1 utilize final method parameters , local variables? 15 answers

i utilize pmd tool find errors in java code if any. 1 mutual suggestion pmd gives "local variable {local_variable} declared final". necessary declare local variables final if it's state not changed further?

is necessary declare local variables final if it's state not changed further?

no not necessary, except in 1 situation: if need access variable within anonymous class.

is practice create local variable final when don't change?

this subjective - think clutters code unnecessarily , if follow coding practice, methods should short plenty , self-explanatory plenty making variables final should not required.

java optimization code-cleanup

java - How can I associate and inbound and outbound soaphandler with each-other -



java - How can I associate and inbound and outbound soaphandler with each-other -

http://docs.oracle.com/javaee/5/api/javax/xml/ws/handler/soap/soaphandler.html

how can associate inbound handlemessage(soapmessagecontext) phone call , outbound handlemessage(soapmessagecontext).

i've tried few things, weblogic doesn't reuse context object reference checking doesn't work. can't find property indicates request distinctly , therefor can't seem create link between request , response.

alternatively there improve way request , response on web-logic problematically , associated such can dumped database future debugging purposes.

okay, may not work on implementations of jax-ws weblogic does.

what i've done

public final boolean handlemessage(soapmessagecontext context) { // using `object` type don't have need import servlet libraries jax-ws library object o = context.get(messagecontext.servlet_request); // o hold reference request // if inbound.o == outbound.o request objects identical , therefor can associate them. homecoming true; }

i don't see why wouldn't work in other containers please double check before using method.

java soap weblogic

android - i can send value from my activity to broadcastreceiver but i can't use it for long time -



android - i can send value from my activity to broadcastreceiver but i can't use it for long time -

actually in app want send message when phone making phone calls...here app installing time asking parent number , number sending broadcast receiver activity first activity...its received there , toasting value..but when making phone phone call value alter null...can help me access value @ phone calling time ..is possible ??how..thank code given below...

in first activity sending value broadcast receiver:

try { toast.maketext(getapplicationcontext(), "try", toast.length_long).show(); intent in = new intent("my.action.string"); in.putextra("parent", parent);//this string sending broadcast receiver sendbroadcast(in); } grab (exception e) { // todo: handle exception e.printstacktrace(); }

and broadcast receiver is:

public class mybroadcast extends broadcastreceiver { string out_number; string myparent; @override public void onreceive(context context, intent intent) { // todo auto-generated method stub myparent = intent.getextras().getstring("parent"); //this sting access number first , alter null @ making phone phone call final string my=myparent; toast.maketext(context, "broadcst"+myparent, toast.length_long).show(); if (intent.getaction().equals("android.intent.action.new_outgoing_call")) { out_number=intent.getstringextra(intent.extra_phone_number); toast.maketext(context, "broadcst"+my+" "+out_number, toast.length_long).show(); smsmanager sm=smsmanager.getdefault(); sm.sendtextmessage(myparent, "5554", "calling..to"+myparent, null, null); //5554 emulator number check in emulator toast.maketext(context, "send"+out_number, toast.length_short).show(); } } }

/* * receiver intended incoming calls read though phone * state more details see android.content.broadcastreceiver * * @author parul * */ public class incomingcallreciever extends broadcastreceiver { public static string log = "incomingcall"; /* * (the onreceive invoked when receive arbitrary intent * incoming phone call service) * * @see android.content.broadcastreceiver#onreceive(android.content.context, * android.content.intent) */ @override public void onreceive(context context, intent intent) { // todo auto-generated method stub log.v(log, "incomingcallreciever"); bundle bundle = intent.getextras(); if (bundle == null) { return; } string state = bundle.getstring(telephonymanager.extra_state); log.v(log, "" + state); if (state.equalsignorecase(telephonymanager.extra_state_ringing)) { string phonenumber = bundle .getstring(telephonymanager.extra_incoming_number); toast.maketext(context, "the incoming number ..." + phonenumber, toast.length_short).show(); log.v(log, "incomming number ... " + phonenumber); } else { log.v(log, "test 2 "); } } }

android broadcastreceiver

c# - Multiple LINQ to SQL insert using IDENTITY from previous insert -



c# - Multiple LINQ to SQL insert using IDENTITY from previous insert -

i want seek , insert multiple tables in sql server database, 1 of first insert generates foreign key identity value want utilize in subsequent inserts. not sure how go in linq sql. think can in multiple transactions prefer in 1 place ... aka within using clause.

my pseudo code algorithm follow:

check if id value exist in table1.col2 column if not exist insert new row table1 get foreign key value of newly inserted row table1.col1 column.

create object new foreign key value , update table2.

using (var sms = new smsdatadatacontext(connection_string) { foreach(someobject in listofobject) { table1 t1 = checkid(sms, i.id); if (t1== null) { table1 new_row = new table1(); sms.table1.insertonsubmit(new_row); //ideally want though dont think work. sms.submitchanges(); table2 update_row = new table2(); update_row.id = new_row.col1.value; //has newly created identity value lastly insert. //assume update_row exist in table2 table. sms.table2.insertonsubmit(update_row); } } sms.submitchanges(); }

linq sql built around unit of work pattern on object graph rather separate statements each row. assuming have association between parent (table1) , children (table2), should able build graph , issue single submitchanges. linq sql automatically handle setting child's parent id based on value submitted.

using (var sms = new smsdatadatacontext(connection_string) { foreach(someobject in listofobject) { table1 t1 = checkid(sms, i.id); if (t1== null) { table1 new_row = new table1(); sms.table1.insertonsubmit(new_row); table2 update_row = new table2(); new_row.table2s.add(update_row); } } sms.submitchanges(); }

c# sql-server linq

c# - Custom Membership Provider With Custom Database -



c# - Custom Membership Provider With Custom Database -

how create membership provider uses database of selection ?

for illustration database should have registration tables these.

users(id, username, passwordsha1)

roles(id, name)

c# asp.net asp.net-membership

java - circular image horizontal scrollview in android so that when i reach last image, first will come and when i reach first image, last will come -



java - circular image horizontal scrollview in android so that when i reach last image, first will come and when i reach first image, last will come -

hello using horizontal image scrolling reference of slide show demo .

now want create circular when 43rd image comes scroll not stopped should come first image.

i have added images this.

public void addimagestoview() { (int j = 0; j < utility.image_array.length; j++) { final button imagebutton = new button(this); imagebutton.setbackgroundresource(utility.image_array[j]); imagebutton.setlayoutparams(new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); system.gc(); runtime.getruntime().gc(); imagebutton.settag(i); imagebutton.setonclicklistener(new onclicklistener() { @override public void onclick(view arg0) { if (isfacedown) { /* * if (clicktimer != null) { clicktimer.cancel(); * clicktimer = null; } clickedbutton = (button) arg0; * stopautoscrolling(); * clickedbutton.startanimation(scalefaceupanimation()); * clickedbutton.setselected(true); clicktimer = new * timer(); * * if (clickschedule != null) { clickschedule.cancel(); * clickschedule = null; } clickschedule = new * timertask() { public void run() { * startautoscrolling(); } }; * clicktimer.schedule(clickschedule, 1500); */ } } }); linearlayout.layoutparams params = new linearlayout.layoutparams( 256, 256); params.setmargins(0, 25, 0, 25); imagebutton.setlayoutparams(params); horizontalouterlayout.addview(imagebutton); } }

i want know how can create 43 images circular smoothly when scroll right , reach lastly image should scroll right 1st image , on. same left scrolling.

this infinitescrollview may help or give thought scrolling , circular scrolling https://github.com/satansly/infinitescrollview

i hope help you.

java android horizontalscrollview circular-list

sql server - SQL: select rows where sum of a column satisfies a condition -



sql server - SQL: select rows where sum of a column satisfies a condition -

on [mytable] :

[id] int -- unique [price] money

on set ordered [id], need select [id]s sum of [price] meets condition

for example:

[id] [price] 1 2.0 2 4.7 3 3.2 4 2.8 5 6.2 6 1.5 7 4.2 8 3.3

for given number '10.0':

[id] [price] [r_total] 1 2.0 2.0 2 4.7 6.7 3 3.2 9.9 4 2.8 12.7 <-- here criteria meets 10.0 5 6.2 18.9 6 1.5 20.4 7 4.2 24.6 8 3.3 27.9

the desired result set of [id]s :

[id] 1 2 3 4

the problem solved using running total, main problem want avoid calculating running total set first, , find point criteria meets, , reason table contains more 100.000.000 rows, , given number comparing total sum of [price] little ( eg: 1250.14 ), , expected result barely riches 100-150 rows!

is there other way calculate , desired rows without disturbing 100.000.000 rows ?

please seek using cte:

;with cte1 ( select id, price, cost cum_sum yourtable id=1 union select c.id, c.price, c.price+c1.cum_sum cum_sum cte1 c1 inner bring together yourtable c on c.id=c1.id+1 10 >c1.cum_sum ) select * cte1

sql sql-server

jquery - Kendo Ui draggable like windows desktop -



jquery - Kendo Ui draggable like windows desktop -

i need simulate desktop icon drag , drop, this:

$(".draggable").kendodraggable({ container: $("#desktop"), hint: function() { homecoming $(".draggable").clone(); }, dragend: function(e) { console.log(e); console.log(e.currenttarget.attr("src")); e.currenttarget.css("top",e.y.location); e.currenttarget.css("left",e.x.location); } });

but im not sure if nice way , drag roll effect break solution.

hava simple way kendoui (no jquery ui draggable).

any help!

i did in past follow:

defined next css styles

.draggable { position: absolute; background: #aaaaaa; width: 100px; height: 100px; vertical-align: middle; } .ob-hide { display: none; } .ob-clone { background: #cccccc; }

(you need ob-hide).

define draggable as:

$('.draggable').kendodraggable({ hint : function (original) { homecoming original.clone().addclass("ob-clone"); }, dragstart: function (e) { $(e.target).addclass("ob-hide"); } });

define area on move as:

$('body').kendodroptarget({ drop: function (e) { var pos = $(".ob-clone").offset(); $(e.draggable.currenttarget) .removeclass("ob-hide") .offset(pos); } })

my html is:

<body style="padding: 0; margin: 0; "> <div id="drop" style="position: absolute; width: 100%; height: 100%; border: 2px solid #000000"> <div class="draggable"> drag 1 </div> <div class="draggable"> drag 2 </div> </div> </body>

jquery drag-and-drop kendo-ui draggable

php - Postfix sends to Exchange Server with "=" characters at end of the lines -



php - Postfix sends to Exchange Server with "=" characters at end of the lines -

i created automated notification scheme in php using mail() function via postfix mta. however, users of outlook, exchange server receive notifications equal "=" characters @ end of lines , broken html.

the exchange server recognized html/text has problem "soft line breaks" or decode quoted-printable or parsing it? how solve problem?

here encodings , schema i'am using:

mime-version: 1.0 content-type: multipart/alternative; boundary="8-10000000000-10000000000:87141" message-id: <20130218130031.e9923d98115@diplo-www> date: mon, 18 feb 2013 14:00:31 +0100 (cet) --8-10000000000-10000000000:87141 content-type: text/plain; charset=utf-8 content-transfer-encoding: quoted-printable --8-10000000000-10000000000:87141 content-type: text/html; charset=utf-8 content-transfer-encoding: quoted-printable --8-10000000000-10000000000:87141--

this original body:

mime-version: 1.0 content-type: multipart/alternative; boundary="8-10000000000-10000000000:87141" --8-10000000000-10000000000:87141 content-type: text/plain; charset=utf-8 content-transfer-encoding: quoted-printable =0a=0a=0a=0a notification=0a=0a =0a new post added in:=0a= =09igcbp11 europe 123=0a=0a =0a=09=09test 4 - exchange server header=0a= =0a=09=09=0a=09this test mail. should html/text formated via quote= d-printable encoding.=0a=0a =0a=09=09author: branislav kurbalija=0a=0a= =09reply online=0a=09=0a=0a=09=0a=09=09to alter business relationship properties or= =0a=09=09password go preferences=0a=09=0a=09=09www.diplomacy.edu=0a=09= =0a=0a =0a=09=09=09=09=09=0a=09this=0a=09is automatically generated e-m= ail notification.please not=0a=09respond e-mail message = not read.=09=09=09=09=0a =0a=0a=0a --8-10000000000-10000000000:87141 content-type: text/html; charset=utf-8 content-transfer-encoding: quoted-printable =0a<center>=0a=0a<div style=3d"font-family: arial, sans-serif; font-size: 1= 4px; width:=0a 600px; border: 1px solid #666666; color: #333333;=0a text-= align: left; border-radius: 2px;">=0a <div style=3d"background-color:= #008191; color: #ffffff; height: 15px;=0a padding: 20px; border-bottom: 1p= x solid #666666; margin-bottom: 5px;">notification</div>=0a=0a <div style= =3d"padding: 20px;">=0a new post added in:<br>=0a=09<a href=3d"ht= tp://wsrv05.diplomacy.edu/textus22/?class=3d1#87">igcbp11 europe 123</a><br= >=0a=0a <div style=3d"font-weight: bold; margin: 20px 0px 10px 0px;">=0a= =09=09test 4 - exchange server header</div>=0a=0a=09=09<p>=0a=09this is<str= ong> test mail</strong>. should <span style=3d"background-color:yello= w;">html/text</span> formated via quoted-printable encoding.</p>=0a=0a <= div style=3d"color: #525252; margin-top: 10px; text-align: right;">=0a=09= =09author: branislav kurbalija</div>=0a=0a=09<a href=3d"http://wsrv05.diplo= macy.edu/textus22/?class=3d1#87">reply online</a>=0a=09<hr>=0a=0a=09<div st= yle=3d"font-size: 11px; float: left;">=0a=09=09to alter business relationship prope= rties or=0a=09=09password go <a href=3d"http://wsrv05.diplomacy.edu/text= us22/cantina/profile.php?user=3d941&class=3d1">preferences</a></div>=0a=09<= div style=3d"font-size: 11px; float: right;">=0a=09=09<a href=3d"http://www= .diplomacy.edu/">www.diplomacy.edu</a>=0a=09</div>=0a=0a </div>=0a=09=09= =09=09=09=0a=09<div style=3d"font-size: 11px; background-color:#eee; height= : 24px;=0a=09 padding: 7px; margin-top: 20px; border-top: 1px solid #66666= 6; text-align: center;">this=0a=09is automatically generated e-mail noti= fication.<br>please not=0a=09respond e-mail message not = read.</div>=09=09=09=09=0a =0a</div>=0a</center>=0a --8-10000000000-10000000000:87141--

there issue quoted_printable_encode() , ms outlook (see https://github.com/php/php-src/pull/120). have upgrade php or implement quoted-printable yourself, or utilize base64 instead.

php email postfix-mta exchange-server quoted-printable

c# - WCF Multiple Base Classes in one interface? -



c# - WCF Multiple Base Classes in one interface? -

i wanted know if possible utilize more 1 base of operations class in 1 interface. face problem using 2 (and there more) base of operations classes 1 interface. using first 1 no problem @ all, when seek work sec one, not work.

i write downwards code in short

[servicecontract(namespace = "http://bla.servicemodel.samples", sessionmode = sessionmode.required)] [serviceknowntype(typeof(observablecollection<models.model1>))] [serviceknowntype(typeof(observablecollection<models.model2>))] public interface iservice { [operationcontract] observablecollection<models.model1> accessmodel1(); [operationcontract] observablecollection<models.model2> accessmodel2(string group); }

after connecting client, creating collection of model1 works fine. when seek create collection of model2, crashes. inner exception "an existing connection forcibly closed remote host."

model1 , 2 contain different information, have same structure.

is there fundamentally error or else?

if need farther information, welcome!

update

i post model classes. maybe blind , cant see error.

[datacontract] public class model2 { private string status; private string name; private string telephone; public model2(string sstatus, string sname, string stelephone) { status = sstatus; name = sname; telephone = stelephone; } [datamember(isrequired = true, order = 0)] public string status { { homecoming status; } set { status = value; } } [datamember(isrequired = true, order = 1)] public string name { { homecoming name; } set { name = value; } } [datamember(isrequired = true, order = 2)] public string telephone { { homecoming telephone; } set { telephone = value; } } } internal class model2builder: observablecollection<model2> { public model2builder(string group) : base() { seek { datatable dt = new database().getmodel2data(group); foreach (datarow row in dt.rows) { add(new model2(row[0].tostring(), row[1].tostring(), row[2].tostring())); } dt.dispose(); } grab (exception ex) { //code log... } } }

on model classes have tried adding parameterless constructors - i'm pretty sure info contract serializer requires requires parameterless constructors, i.e.

[datacontract] public class model2 { private string status; private string name; private string telephone; public model2(){} public model2(string sstatus, string sname, string stelephone) { status = sstatus; name = sname; telephone = stelephone; } ...etc

c# wcf datacontract

javascript - How to set image to be background -



javascript - How to set image to be <canvas> background -

i'm working on project have table , canvas field below table.

i need set 1 of pictures background , in case tshirt.png.

until have done following. have 2 files (index.html & jquery.js)

index

<html> <head> <script src="js/jquery.js"></script> </head> <table border="1"> <tr> <td>#</td> <td>filename</td> <td>x</td> <td>y</td> <td>z</td> </tr> <tr> <td>1</td> <td><img src="images/sheep.png" width="40px" height="40px"></img></td> <td><input type="text" value="" name="x"></td> <td><input type="text" value="" name="y"></td> <td><input type="text" value="" name="z"></td> </tr> <tr> <td>2</td> <td><img src="images/tshirt.png" width="40px" height="40px"></td> <td><input type="text" value=""></td> <td><input type="text" value=""></td> <td><input type="text" value=""></td> </tr> <tr> <td>3</td> <td>item.png</td> <td><input type="text" value=""></td> <td><input type="text" value=""></td> <td><input type="text" value=""></td> </tr> </table> <section id="main"> <canvas id="canvas" width="1024" height="768" style="border:1px solid red;"> </canvas> </section> </html>

jquery.js

function dofirst(){ var x = document.getelementbyid('canvas'); canvas = x.getcontext('2d'); var pic = new image(); pic.src = "images/sheep.png"; pic.addeventlistener("load", function() { canvas.drawimage(pic,0,0,100,200)}, false); var background = new image(); background.src = "images/tshirt.png"; background.addeventlistener("load",function(){ canvas.drawimage(background,0,250,200,300)}, false); } window.addeventlistener("load", dofirst, false);

any help welcome

the canvas takes different mindset , approach remember take step , think of more 'simple' approach, help on engineering science code.

just utilize css define background

background: url("images/tshirt.png");

here how can set in javascript via jquery previous post

javascript jquery html5 canvas

python - Pass dict with non string keywords to function in kwargs -



python - Pass dict with non string keywords to function in kwargs -

i work library has function signature f(*args, **kwargs). need pass python dict in kwargs argument, dict contains not strings in keywords

f(**{1: 2, 3: 4}) traceback (most recent phone call last): file "<console>", line 1, in <module> typeerror: f() keywords must strings

how can around without editing function?

non-string keyword arguments not allowed, there no general solution problem. specific illustration can fixed converting keys of dict strings:

>>> kwargs = {1: 2, 3: 4} >>> f(**{str(k): v k, v in kwargs.items()})

python function python-3.x arguments

javascript - Dynamically formatting text format/Masking in form? -



javascript - Dynamically formatting text format/Masking in form? -

i attempting write form users may come in date , time (ie. 12/12/2005 3:45pm), , i'm attempting mask users input, such '/' , ':' dynamically appear type. i've found http://digitalbush.com/projects/masked-input-plugin/, there library similar without moving underscores? preferably, user re-create , paste formatted dates form well.

javascript jquery

jquery - how to pass a dynamic div id to highchart -



jquery - how to pass a dynamic div id to highchart -

i have dynamic tab created using jquery ui. want add together high chart div created jquery ui. when pass id "renderto" of highchart options says error #13. have looked , according highcharts couldn't find div.

so suggestion how can prepare this..?

function minig_help() { $("#tab_container").tabs("add","#tabs-1","123"); $( "#tab_container" ).tabs( "refresh" ); plotgraph(url_temp,"#tabs-1"); } function plotgraph(url,divid) { .................. options.chart={renderto: divid}; }

this error occurs because div hasn't been written dom yet, , not exist when seek create chart. create sure element written page before creating chart.

one suggestion phone call method create chart on load of tabs. there "load" event can tie (http://api.jqueryui.com/tabs/#event-load):

$( ".selector" ).tabs({ load: function( event, ui ) { //call method create chart } });

jquery html jquery-ui highcharts highstock

VBA excel 2007 Transfer a Cell's value with a condition -



VBA excel 2007 Transfer a Cell's value with a condition -

in worksheet 'hitterscalc' cell d2, want paste value of worksheet 'batters' cell ks2 if value in 'hitterscalc' cell ab2 = 1

i think want of rows have info in worksheet 'hitterscalc'

i have come

with worksheets("hitterscalc") .range("d2:d" & .range("a" & rows.count).end(xlup).row) .formula = "=if($ab2=1,batters!ks2,""))" .value = .value end end

but returning application defined or object defined error.

can point me in right direction fixing issue?

edit:

so when do

with worksheets("hitterscalc") .range("d2:d" & .range("ab" & rows.count).end(xlup).row) .formula = "=batters!ks2" .value = .value end end

the look works properly. how can checks cell value of worksheet hitterscalc column ab first?

edit 2

with worksheets("hitterscalc") .range("d2:d" & .range("ab" & rows.count).end(xlup).row) .formula = "=if(and(a2<>"""",ab2=1),batters!ks2,"""")" '.formula = "=batters!ks2" .value = .value end end

works. confused why 1 works not first one.

i think confusion because of quotes - seek utilize code:

with worksheets("sheet1") .range("d2:d" & .range("ab" & rows.count).end(xlup).row) r = "=if($ab2=1,batters!ks2," & chr(34) & chr(34) & ")" .formula = r .value = .value end end

formula string generated using chr(34) double quotes used in if.

excel vba transfer

Disable keyboard navigation in a Google Map -



Disable keyboard navigation in a Google Map -

i have inline google map that, when clicked, can navigated through using keyboard arrow keys. doesn't allow person utilize arrow keys scroll actual page unless click somewhere else on page first. there way disable navigation arrow keys?

set alternative keyboardshortcuts of map false

google-maps-api-3

c++ - How to make collisions affect rotation only on X and Z axes in lib Bullet? -



c++ - How to make collisions affect rotation only on X and Z axes in lib Bullet? -

having terrain , mesh objects placed static throw capsule objects onto world (for illustration agents engine wants navigate).

i need tham bahaive normal collidable objects yet need tham not rotate on 1 axis @ (for me y) agents in "standing" vertical position so:

thay able jump , move... wonder how create collisions impact rotation on x , z axes in bullet?

there methods this, think best case apply setangularfactor() agent stiff body vector (0, 1, 0)

c++ bulletphysics

c++ - this pointer and constructor -



c++ - this pointer and constructor -

can safely utilize pointer outside class before constructor finished (i don't mean virtual function phone call constructor)?

i mean this:

#include <iostream> class bar; class foo { public: foo(bar* bar); }; class bar { public: bar() : instance(this) {} void foo() { std::cout << "bar::foo() \n"; } private: foo instance; }; foo::foo(bar* bar) { bar->foo(); // ub or not } int main() { bar instance; }

i've got next warning when tried compile code in msvc-11.0

warning c4355: 'this' : used in base of operations fellow member initializer list

and such code?

#include <iostream> class foo; void bar(foo* instance); class foo { public: foo() { bar(this); } void foo() { std::cout << "foo::foo() \n"; } }; void bar(foo* instance) { instance->foo(); // ub or not } int main() { foo instance; }

i can't find quote standard.

that work while foo ctor or bar function in sec illustration do not phone call smth refer still uninitialized members of bar/foo. i'll transform 1st illustration little demonstrate:

class bar { public: bar() : instance(this),zzz(123) {} void foo() { std::cout << "bar::foo(): garbage in zzz=" << zzz << "\n"; } private: foo instance; int zzz; };

c++

python - Convert MongoEngine's ComplexDateTimeField to an ISO date time format -



python - Convert MongoEngine's ComplexDateTimeField to an ISO date time format -

what's best way convert mongoengine complexdatetimefield iso8601 date time format?

update: per @scanny's request, can find source code mongoengine's complexdatetimefield here , illustration of iso 8601 date time 1994-11-05t08:15:30-08:00.

update 2 (problem solved): trying solve problem in context of code snippit. when posted question, wasn't able line #58 working data.isoformat() able datetimefield. nevertheless, problem solved.

python flask mongoengine

html - How to change Alternate Table Row Colors in struts -



html - How to change Alternate Table Row Colors in struts -

i'm using <logic:iterator> tag display table info this

<logic:iterate id="lt" name="lasttoken" scope="request"> <tr> <td class="tblhometd"><bean:write name="lt" property="tokennumber" format="#"/></td> <td class="tblhometd"><bean:write name="lt" property="adjustmenttime" format="hh:mm:ss"/></td> <td class="tblhometd"><bean:write name="lt" property="actualfinishedtime" format="hh:mm:ss"/></td> <td class="tblhometd"><bean:write name="lt" property="consultationtype"/></td> <td class="tblhometd"><bean:write name="lt" property="mobileno" format="#"/></td> <td class="tblhometd"><bean:write name="lt" property="consultationstatus"/></td> <td class="tblhometd"><bean:write name="lt" property="smsstatus"/></td> </tr> </logic:iterate>

now want alter background color alternate rows how can ????

thanks in advance

use

tr td{ background:yellow } tr:nth-child(odd) td{ background:red }

demo

html css css3 struts

mysql - Selecting two colums in two tables (one column being the same in both tables) -



mysql - Selecting two colums in two tables (one column being the same in both tables) -

i have 2 tables - category , subcategory, both have id_category. in other words, in category:

id_category: 3 category_name: security

and in subcategory:

id_subcategory: 1 id_category: 3 subcategory_name: antivirus

i have multiple items in same category, want list items this: security: antivirus, spyware, firewall.

also, want same other categories, in end list this: security: antivirus, spyware, firewall. multimedia: audio, video, images.

i'm not sure how that. searched around , tried different things nil worked me.

you can utilize group_concat aggregate function:

select category_name, group_concat(subcategory_name) category inner bring together subcategory on subcategory.id_category=category.id_category grouping category_name

see fiddle here.

mysql

java - How to change JDK installation directory in Windows XP? -



java - How to change JDK installation directory in Windows XP? -

every time start jdk-6u39-windows-i586.exe error:

this business relationship not have sufficient privileges install java(tm). please login business relationship administrative permissions.

this happens immediately, before wizard appears.

i think because exe file trying install c:\program files, install c:\program files restricted admins. trying install c:\opt. jdk doesn't provide me alternative alter installation path.

run command prompt, jdk-6u39-windows-i586.exe /s /installdirpubjre=c:\opt\

referenced from: http://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html#run

java

java - cassandra field string vs. long -



java - cassandra field string vs. long -

ok, turning crazy here. there number of behaviors cannot explain cassandra , not sure whether related or not.

i created table follows (not showing columns sake of brevity):

create column family cachekey comparator = utf8type , column_metadata = [ { column_name : accountnumber, validation_class : utf8type }, { column_name : homeid, validation_class : longtype } ... ];

some records added table (not me). now, when display schema, not sure why not see columns created

[default@cachekeydata] show schema; ... utilize cachekeydata; create column family cachekey column_type = 'standard' , comparator = 'utf8type' , default_validation_class = 'bytestype' , key_validation_class = 'bytestype' , read_repair_chance = 0.1 , dclocal_read_repair_chance = 0.0 , gc_grace = 864000 , min_compaction_threshold = 4 , max_compaction_threshold = 32 , replicate_on_write = true , compaction_strategy = 'org.apache.cassandra.db.compaction.sizetieredcompactionstrategy' , caching = 'keys_only' , compression_options = {'sstable_compression' : 'org.apache.cassandra.io.compress.snappycompressor'};

now, puzzling me: when pull info java code, null pointer exception when attempting retrieve long not when retrieving string of records:

system.out.println("mac=" + mac); system.out.println(" cidx=<" + result.getstringvalue("homeid",null) + ">"); system.out.println(" cidx=<" + result.getlongvalue("homeid",null) + ">"); system.out.println(" cidx=<" + result.getcolumnbyname("homeid").getlongvalue() + ">");

leads to:

mac=001dd67cff46 cidx=<50190074> cidx=<3832617404583655220> cidx=<3832617404583655220> mac=001dcfe2122c cidx=<3663580>

followed nullpointerexception. in other words, result.getstringvalue("homeid",null) returns 3663580 result.getlongvalue("homeid",null) causes nullpointerexception when running next line within cassandra library code:

longserializer.get().frombytes(column.getvalue());

last, displaying these same 2 records above cli console not show suspicious me:

[default@cachekeydata] cachekey[utf8('001dd67cff46')]; => (column=accountnumber, value=30373833373132303730323036, timestamp=1361305382124) => (column=corp, value=3037383337, timestamp=1361305382124) => (column=homeid, value=3530313930303734, timestamp=1361305382124) => (column=zip, value=3130343732, timestamp=1361305382124) returned 4 results. elapsed time: 70 msec(s). [default@cachekeydata] cachekey[utf8('001dcfe2122c')]; => (column=accountnumber, value=30373830383132333437323032, timestamp=1361305376659) => (column=corp, value=3037383038, timestamp=1361305376659) => (column=homeid, value=33363633353830, timestamp=1361305376659) => (column=zip, value=3036393033, timestamp=1361305376659) returned 4 results. elapsed time: 45 msec(s).

my questions:

q1. big question. why null pointer in illustration above? q2. smaller ones: q2a. observe in 3 normal given how set table in 1? q2b. why string , long values not match?

not sure reply useful anyone, info expected long inserted string. apparently caused @ to the lowest degree 2 issues explained above:

displaying different result whether info read string or long (something wasn't used coming oracle world) causing these occasional null pointer exceptions

java schema cassandra astyanax

ios - Objective c should Google map be cleared when leaving page? -



ios - Objective c should Google map be cleared when leaving page? -

i've noticed memory taken google map quite high, have on tab in tabnav. question is, thought hide map when leave tab (to free memory) , reinitialize when come back? or best leave running?

in previous projects have initialised component within viewdidload (checking beingness initialised since can called more once), within viewwillappear doing same check (as swapping tabs may/probably won't phone call viewdidload again, , component may have deallocated code below) inside:

- (void)didreceivememorywarning { }

i deallocate / nil properties can disposed of incase os decides low on memory.. wouldn't bother clearing google maps out of memory since take time initialise if os doesn't have clear them, won't slow downwards app.

ios objective-c google-maps

javascript - Jquery and canvas code not working on same external file -



javascript - Jquery and canvas code not working on same external file -

i have been mucking little bit coding using jquery , canvas (not together).

i have external javascript file , in contains;

$(document).ready(function() { /* name chooser */ var carl = ['sha', 'shads', 'cai', 'moon', 'sun', 'staffy',]; var rosie = ['mum',]; var prev; $('button').click(function() { prev = $('h2').text(); $('h2').empty().text(carl[math.floor(math.random() * carl.length)] + rosie[math.floor(math.random() * rosie.length)]).after('<p>' + prev + '</p>'); }); });

i have inline javascript canvas element;

<script> var canvas = document.getelementbyid('draw'); if(canvas.getcontext) { var ctx = canvas.getcontext('2d'); ctx.fillstyle = 'red'; ctx.fillrect(0, 0, 800, 500); } </script>

when separated using inline javascript canvas , external file jquery works fine , expected.

when adding inline canvas javascript external file canvas element not working jquery is. javascript loaded after canvas element external javascript linked before closing body tag , furthermore if remove jquery external file canvas element begins work again.

why this?

thanks

edit

i have tried putting canvas code within jquerys document ready function , outside of , still not working. have wrapped canvas code in anonymous function still no avail , have tried selecting canvas element jquery below;

var canvas = $('canvas')[0];

but still doesn't want know. putting canvas code before jquery canvas code executes jquery doesn't, baffled! doesn't bother me keeping seperate know why happening.

thanks again.

this simple problems noted if utilize browser console. that's it! can open console pressing ctrl+shift+j:

in home page:

error: uncaught referenceerror: $ not defined solution: link jquery in source

in namechooser page:

error: uncaught typeerror: cannot read property 'getcontext' of null

the problem:

you trying manipulate div canvas, , can't context of div element. html:

<div id="wrap"> <h1>portfolio project <a href="/">:)</a></h1> <button>click here generate company name!</button> </div>

solution:

change <div> <canvas>

how avoid future problems this?

use browser console, that's it!

javascript jquery canvas

powershell - Define custom property sets (with Add-Member?) for use in Select-Object -



powershell - Define custom property sets (with Add-Member?) for use in Select-Object -

what seek quite simple: create custom object properties, , define "groups" of properties (columns) utilize in select-object. allow me clarify:

$props = @{"mary"=1;"jane"=2;"frank"=3;"john"=5;"brenda"=6} $obj = new-object psobject $props

i have custom object bogus data. want able is

$obj | select male $obj | select female

and had thought trick, this:

$obj | add-member propertyset "male" @("frank","john") $obj | add-member propertyset "female" @("mary","jane","brenda")

it doesn't work - error:

add-member : cannot convert "system.object[]" value of type "system.object[]" type "system.collections.objectmodel.collection`1[system.string]".

i guess should provide object type array add-member, i'm unsure how should that.

does have experience this?

important note: i'm on powershell 2, , read on various sites has bug doesn't allow setting default properties. that's not want - want create custom property set , not default 1 - bug prevents me getting want.

you close. problem you're not creating object correctly. need specify -property parameter before specify hashtable of properties. without it, create hashtable. works:

$props = @{"mary"=1;"jane"=2;"frank"=3;"john"=5;"brenda"=6} $obj = new-object -typename psobject -property $props $obj | add-member propertyset "male" @("frank","john") $obj | add-member propertyset "female" @("mary","jane","brenda") $obj | select male frank john ----- ---- 3 5

why did happend? if read syntax new-object using get-help new-object or get-command new-object -syntax, see normal .net types, syntax is:

new-object [-typename] <string> [[-argumentlist] <object[]>] [-property <idictionary>]

notice -argumentlist 2nd paramter, not -property expected. code did:

$obj = new-object -typename psobject -argumentlist $props

instead of:

$obj = new-object psobject -property $props

edit solution above worked in ps3.0 . it's still valid though, -property parameter required in ps2.0 also. in ps2.0 need cast propertyset-array string[] (string-array) , not object-array (object[]) default array. finish solution ps2.0 is:

$props = @{"mary"=1;"jane"=2;"frank"=3;"john"=5;"brenda"=6} $obj = new-object -typename psobject -property $props $obj | add-member propertyset "male" ([string[]]@("frank","john")) $obj | add-member propertyset "female" ([string[]]@("mary","jane","brenda")) $obj | select male frank john ----- ---- 3 5

powershell custom-object pscustomobject

C strings deletion in C++ -



C strings deletion in C++ -

what's , what's wrong? in case have phone call delete in order prevent memory leak? also, behaviour same in c , c++? there differences?

const char* = "blahblah"; ... delete a; char b* = new char('a'); ... delete b; char c[100] = "blahblah"; ... delete c; char d* = new char[40]; ... delete d; char e* = new char[40]; ... delete[] e;

in case have phone call delete in order prevent memory leak

only delete got new , delete [] got new []. every other delete wrong.

c++ c string

batch file - IF statement not fired -



batch file - IF statement not fired -

i have little calcutations in dos .bat file:

for /f "tokens=1-3 delims=/-" %%a in ("%tag%") ( set day=%%c set month=%%b set /a year=%%a - 2000 ) echo %day% echo %month% echo %year% echo %stamp% if %month% == "02" ( echo "iam in" )

today if feb month comming 02 if status has not beingness meet. doing wrong ?

your quotes part of string compared. need include them on both sides:

if "%month%" == "02" ( echo "iam in" )

or not have them on either side:

if %month% == 02 ( echo "iam in" )

if-statement batch-file dos

html - Image bring front using css -



html - Image bring front using css -

i using below code view product id. using background image each list. want bring image front end , text go back.

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> <style type="text/css"> .addcart { } .addcart ul{ list-style:none; } .addcart li{ list-style:none; background-image:url(round.png); background-repeat: no-repeat; height:45px; top:0px; } .addcart h3 { font-size:24px; font-weight:bold; padding:10px 0px 40px 10px; color:#f00; z-index:400px; position:relative; } </style> </head> <body> <ul class="addcart"> <li><span><h3>96</h3></span></li> <li><h3>97</h3></li> </ul> </body> </html>

if want hide text, this:

.addcart h3 { position : absolute; left : -9999px; }

demo: http://jsfiddle.net/pfmhr/

html css css3

c# - What type of property should I use if it's supposed to contain formatted text, images, links, etc? -



c# - What type of property should I use if it's supposed to contain formatted text, images, links, etc? -

i have "page" class have "content" property - located on web form , user should able format text, insert pictures, attachments, etc. type of property should be?

it looks mvchtmlstring candidate property type.

c# asp.net asp.net-mvc-3 asp.net-mvc-4

php - Where's the bug in my regex? -



php - Where's the bug in my regex? -

i trying build regex extract values of pseudo-xml-tags (enclodes in{} instead of <>) , doesn't work. have verified thing regexbuddy, favourite rx-tool captured quite correct, when using in php-code, not result. so, w/o farther ado, here's problem:

$match=array(); $ret=preg_match('\{lang\s*=\s*[\"\']*?(.*?)[\"\']*?\s*/\}',"{lang='de'/}xxxxlxlxlxl",$match);

why $match empty?

the pattern should be

/\{lang\s*=\s*[\"\']*?(.*?)[\"\']*?\s*\/\}/ ^ ^

php regex

Keeping variables between function executions (Javascript) -



Keeping variables between function executions (Javascript) -

i have javascript function runs every time 1 of many links clicked. functions first checks id of link clicked is, runs if stement. depending on id of link, different variables defined.

all works, problem links define 1 variable while other links define another, need maintain variables defined in previous executions of function defined other executions of function.

an illustration follows:

$(document).ready(function() { $(".sidebar a").click(function(event) { event.preventdefault() var targetid = $(this).attr("data-target") $("#" + targetid).attr("src", $(this).attr("href")) var element = $(this).attr("class") if (element == "submit") { var submit = $(this).attr("user") alert("1") } else if (element == "view") { var view = $(this).attr("user") alert("2") } }) window.history.replacestate({}, 'logs', '/file/path?submit=' + submit + '&' + 'view=' + view) })

thanks

you can utilize outer function nil declare variables , homecoming inner function. inner function can access variables outer scope remain same every phone call of function.

example var next = (function() { var value = 0; function next() { homecoming value++; } }()); console.log(next()); console.log(next()); console.log(next()); live demo

http://jsfiddle.net/bikeshedder/uzkte/

javascript variables

c# - How to handle Index out of range in a better way -



c# - How to handle Index out of range in a better way -

my code giving me index out of range exception input. below problematic code:

string[] snippetelements = magic_string.split('^'); string = snippetelements[10] == null ? "" : "hello"; string b = snippetelements[11] == null ? "" : "world";

for particular input, array snippetelements had 1 element in it, hence while trying index 10th , 11th element, got exception.

for now, have introduced next check:

if (snippetelements.length >= 11) { string = snippetelements[10] == null ? "" : "hello"; string b = snippetelements[11] == null ? "" : "world"; }

can suggest improve way write check. somehow number 11 not looking in code.

can suggest improve way write check. somehow number 11 not looking in code.

well accessing element 11 index, if have index in variable can utilize in check, otherwise 11 fine in check. check should if(index < snippetelements.length)

something like:

int index = 11; if(index < snippetelements.length) { string b = snippetelements[index] == null ? "" : "world"; }

c#

How to bind data in asp.net c# treeview control -



How to bind data in asp.net c# treeview control -

i have never used treeview command in asp.net need bind info it. stored procedure sql server returning the values below. m using c#

termid parentid name 2021 0 a. geographic locations 3602 2021 oceania 3604 3602 australasia 3621 3604 new zealand 3619 3604 pacific islands 3585 3619 polynesia 3592 3585 samoa 3594 3592 american samoa

each term has parentid , termid parentid=0 root node. how can bind info treeview. appreciate advise or examples

this may useful :

treeview command expects heirarchical info construction xml/sitemaps, cant bind datatable directly. utilize info table select parentid = id

please utilize recursive method create kid items relevent current menu item id, refer link below code.

http://www.charith.gunasekara.web-sphere.co.uk/2010/10/how-to-bind-datatable-to-aspnet.html

n below link help creating ur own tree view control.

http://www.codeproject.com/kb/tree/databoundtreeview.aspx

c# asp.net treeview

Create custom button based on Android stlye -



Create custom button based on Android stlye -

i need create custom button command inherit same android style other buttons in application. however, want able add together several lines of text characters of text in different colors. there anyway accomplish this, can't seem see way?

currently have created view looks button drawing background, ok want background etc alter application style.

you should create button descend generic theme widget.button. way can ensure default settings come through you.

android button styles

cakephp 1.2 - Get a field length in mysql for query -



cakephp 1.2 - Get a field length in mysql for query -

i'm using cakephp 1.2, , have situation: have table has 'class' field, class can 'a','b','c','g', or string of 3 letters 'dbb','aba', etc. every string has sense (for example, = article, b = book, etc). write code:

if ($_get['classificazione']!="art0") { $classificazione=$_get['classificazione']; if ($classificazione=="a"||$classificazione=="b"||$classificazione=="c"||$classificazione=="g") $conditions[]=array('classe =' => "$classificazione");

this working 'one letter' case, don't know 2 or more letters. since don't care if equals ('dbb' , 'aba' both documents), thinking check length tried this:

else $conditions[]=array('length(classe) > 1'); }

i tested else, , it's working.

use length() checking length in bytes:

select str sometable length(str) = 5;

or char_length() checking length in number of characters (useful multi-byte strings):

select str sometable char_length(str) = 5;

mysql cakephp-1.2

iis 7.5 - iis7.5 many-to-one client certificate mapping causes error status 500 -



iis 7.5 - iis7.5 many-to-one client certificate mapping causes error status 500 -

we trying implement client certificate authentication in iis 7.5. have configured many-to-one mapping, disabled other authentication modes , cert-authentication seems work correctly: can correctly read certificate info test .aspx page , authenticated username 1 configured in many-to-one mappings.

however, though seems work correctly, each "new" browser session causes 1 "extra" error status 500 row in iis log, before authentication successful:

#fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port ... cs-host sc-status sc-substatus sc-win32-status time-taken 2013-02-12 09:46:35 10.40.64.45 /certtest.aspx - 443 - ... - site.mydomain.com 500 0 64 31 2013-02-12 09:46:35 10.40.64.45 /certtest.aspx - 443 - ... - site.mydomain.com 200 0 0 734

same "extra" error status 500 issue happens file, e.g. images, .css, .js, it's not problem in certtest.aspx file.

any ideas, cause error status 500 in iis?

it seems managed solve issue setting sslalwaysnegoclientcert metabase property true.

technet article iis6.0 (!) admin reference

iis-7.5 client-certificates

ggplot2 - Indicating the statistically significant difference in bar graph USING R -



ggplot2 - Indicating the statistically significant difference in bar graph USING R -

this repeat of question asked here: indicating statistically important difference in bar graph asked r instead of python.

my question simple. want produce barplots in r, using ggplot2 if possible, indication of important difference between different bars, e.g. produce this. have had search around can't find question asking same thing.

you can utilize geom_path() , annotate() similar result. illustration have determine suitable position yourself. in geom_path() 4 numbers provided little ticks connecting lines.

df<-data.frame(group=c("a","b","c","d"),numb=c(12,24,36,48)) g<-ggplot(df,aes(group,numb))+geom_bar(stat="identity") g+geom_path(x=c(1,1,2,2),y=c(25,26,26,25))+ geom_path(x=c(2,2,3,3),y=c(37,38,38,37))+ geom_path(x=c(3,3,4,4),y=c(49,50,50,49))+ annotate("text",x=1.5,y=27,label="p=0.012")+ annotate("text",x=2.5,y=39,label="p<0.0001")+ annotate("text",x=3.5,y=51,label="p<0.0001")

r ggplot2 bar-chart

asp.net mvc - Url.Action for mvc3 application hosted in a sub directory -



asp.net mvc - Url.Action for mvc3 application hosted in a sub directory -

i have deployed mvc3 application in web. how can add together virtual directory name in url.action() method ?

for eg : application in mydomain.com\app

now when

url.action returns action="/home/create" want action = "/app/home/create".

what should done ?

you shouldn't need that. if application deployed in iis within virtual directory (say app) url.action("create", "home") helper generate /app/home/create right url.

asp.net-mvc asp.net-mvc-3 asp.net-mvc-areas

Verify HTML Element within Another Element -- Watir WebDriver -



Verify HTML Element within Another Element -- Watir WebDriver -

i'm looking best way validate element within element using watir webdriver. example: want verify span below is found within anchor contains it.

<a id="header-main-menu-home" href="/" class="tracked"> "home" <span class="arrow arrow-up"></span> </a>

i'm using location validation, not think sustainable.

any help much appreciated?

you can do:

browser.link(:id => 'header-main-menu-home').span(:class => 'arrow').present?

this check link contains span. works because locator of span remain within scope of link.

html watir watir-webdriver

fortran - Why is bounds checking changing the behavior of my program? -



fortran - Why is bounds checking changing the behavior of my program? -

i have thermal hydraulics code written in fortran work on. debug version, utilize -check bounds alternative in ifort 11.1 during compile time. have caught array bounds errors in past in way. recently, though, seeing solution blowing given case. peculiar thing was converging nicely release version of code. sure enough, removing -check bounds flag debug makefile cleared problem.

the unusual thing debug version working fine many other test cases used before , wasn't throwing errors on going outside of array bounds in code. behavior seems unusual me , have no thought if there kind of bug in code or what. have ideas causing sort of behavior?

as requested, flags utilize release , debug are:

release: -c -r8 -traceback -extend-source -override-limits -zero -unroll -o3

debug: -c -r8 -traceback -extend-source -override-limits -zero -g -o0

of course, original question indicates, toggle -check bounds flag on , off debug case.

i suspect numerical algorithm here more fortran code. have ensured of convergence , stability criteria have been met?

what sounds round-off error causing solution fail converge. if on edges of safe convergence, compiler optimizations can tip things 1 way or another.

i utilize gfortran more ifort, don't know specifics of -unroll option, unrolling loops can alter rounding though calculations seem should remain same. also, debug alter exact order of memory , register access. if number in processor in internal representation, written memory , read again, value can change. can alleviated extent careful selection of kind. it's nature, processor specific rather portable.

in theory, total compliance ieee 754 create floating point operations reproducible, not case. if debug causing these problems opposed other bug in code, other mysterious things related inner workings of processor cause blow up.

i add together write statements @ various key points in code output info matrices (or whatever info structures using). sure utilize binary output. open form='unformatted' , access='direct'.

fortran intel-fortran

qml - Qt Quick 2.0 in Windows XP -



qml - Qt Quick 2.0 in Windows XP -

i installed qt 5.0.1 windows 32-bit (mingw 4.7, 823 mb)

then created simple quick 2 application , compiled it. programme runs on clean windows 7, windows 8. programme not run on windows xp. , have error:

Точка входа в процедуру _vsnprintf_s не найдена в библиотеке dll msvcrt.dll

translate: the procedure entry point _vsnprintf_s not found in library dll msvcrt.dll

error

what do? , libraries take programme run?

i found similar bug in list of known issues.

try utilize msvc2010 compiler.

qt qml qt5 qtquick2

objective c - Modify multiple NSTextView with commands -



objective c - Modify multiple NSTextView with commands -

i'm wondering if knows if possible modify multiple nstextviews menu bar command. illustration if user selects "bold" menu bar, different nstextviews selected update content show bold.

here set have:

@interface mycustomtextfield : nsview <nstextviewdelegate>{ nstextview *textview; bool selected; ... }

so have own custom class , within each custom class have nstextview, var determining whether or not view selected , other stuff.

i'm able select multiple fields i've read on apple documentation every nstextview in window shares 1 field editor. when user edits nstextview sending commands field editor processes , routes nstextview. if case mean need create own custom field editor , route commands custom selected text classes instead?

==edit== customtextfield classes have variable named "selected" (see above) , holding shift or apple key downwards i'm able "select" multiple customtextfield instances (i set mask in front end of nstextview instances catches mousedown message).

so selection, multiple instances have "selected" attribute set true. far first responder window, set mask shows bluish halo around nstextviews.

i'm wondering if can tell app take default nstextview commands (such bold, italicize, etc.) , if supply custom field editor, pass appropriate messages selected customtextfields pass on nstextviews.

in head message passed this:

user submits text toolbar command > custom field editor > mycustomtextfield > nstextview

hopefully explanation made sense or maybe i'm in lala land now.

objective-c cocoa nstextview

java - OpenGL ES 2.0 VBO issue -



java - OpenGL ES 2.0 VBO issue -

i trying switch vbos, without indices now. blank screen. can point out why blank? same code works fine if comment out vbo-specific code , replace 0(offset) in glvertexattribpointer mfvertexbuffer, i.e without using vbos.

this ondraw method

gles20.glclearcolor(0.50f, 0.50f, 0.50f, 1.0f); gles20.glclear(gles20.gl_depth_buffer_bit | gles20.gl_color_buffer_bit); // bind default fbo // gles20.glbindframebuffer(gles20.gl_framebuffer, 0); gles20.gluseprogram(mprogram); checkglerror("gluseprogram"); gles20.glenable(gles20.gl_blend); gles20.glblendfunc(gles20.gl_src_alpha, gles20.gl_one_minus_src_alpha); gles20.glbindtexture(gles20.gl_texture_2d, id); int vertexcount = mcarverticesdata.length / 3; gles20.glbindbuffer(gles20.gl_array_buffer, buffers[0]); checkglerror("1"); gles20.glvertexattribpointer(positionhandle, 3, gles20.gl_float,false, 0, 0); checkglerror("2"); gles20.glenablevertexattribarray(positionhandle); checkglerror("3 "); transfertexturepoints(gettexturehandle()); gles20.gldrawarrays(gles20.gl_triangles, 0, vertexcount); checkglerror("gldrawarrays"); gles20.glbindbuffer(gles20.gl_array_buffer, 0); gles20.gldisablevertexattribarray(positionhandle); gles20.gldisable(gles20.gl_blend);

this vbo setup:

// allocate , handle vertex buffer bytebuffer vbb2 = bytebuffer.allocatedirect(mcarverticesdata.length * float_size_bytes); vbb2.order(byteorder.nativeorder()); mfvertexbuffer = vbb2.asfloatbuffer(); mfvertexbuffer.put(mcarverticesdata); mfvertexbuffer.position(0); // allocate , handle vertex buffer this.buffers = new int[1]; gles20.glgenbuffers(1, buffers, 0); gles20.glbindbuffer(gles20.gl_array_buffer, buffers[0]); gles20.glbufferdata(gles20.gl_array_buffer, mfvertexbuffer.capacity() * float_size_bytes, mfvertexbuffer, gles20.gl_static_draw);

before linking program:

gles20.glbindattriblocation(program, 0, "aposition"); checkglerror("bindattribloc");

and vertex shader :

uniform mat4 umvpmatrix; attribute vec4 aposition; attribute vec2 atexturecoordinate; varying vec2 v_texturecoordinate; void main() { gl_position = umvpmatrix * aposition; v_texturecoordinate = atexturecoordinate; gl_pointsize= 10.0; }

you need generate elements array , phone call in order render "object":

// bind vertex buffer gles20.glbindbuffer(gles20.gl_array_buffer, _bufferids.get(2)); gles20.glvertexattribpointer(4, 4, gles20.gl_float, false, 4*4, 0); // bind elements buffer , draw gles20.glbindbuffer(gles20.gl_element_array_buffer, _bufferids.get(1)); gles20.gldrawelements(gles20.gl_triangles, _numelements, gles20.gl_unsigned_short, 0);

hope helps.

java android opengl-es-2.0 vbo

c++ - Cant static cast class to integer -



c++ - Cant static cast class to integer -

why getting error when seek static cast element* int

typedef element* elementptr int element::getvp (elementptr item) { homecoming static_cast <int>(item); // have class called element }

not sure what's question, sense want implicit conversion function. convert element int, want operator int()

struct element { operator int() { homecoming i; } int i; }; int element::getvp (element* item) { homecoming (*item); // have class called element }

but it's still not clear why need getvp in element class.

it' show how convert struct/class int type. i'll delete reply if it's not want.

c++ static-cast

floating point - Java: How to change Double 2.3 to "2.0"? -



floating point - Java: How to change Double 2.3 to "2.0"? -

how can alter

double d = 2.3

to

double value of 2.0

i used math.round, produces 2.0

i need save string 2.0

you can utilize printf(...):

system.out.printf("double value of %.1f", math.round(d));

or can save string using string.format(...):

string s = string.format("double value of %1f", math.round(d));

java floating-point double

java - How to create spring parametrized transactional test -



java - How to create spring parametrized transactional test -

in tests need utilize spring dependency injection transactional , parameters. found illustration how utilize parametrized , di:

@runwith(value = parameterized.class) @contextconfiguration(locations = { "classpath:applicationcontexttest-business.xml" }) public class tournamentservicetest { @autowired tournamentservice tournamentservice; public tournamentservicetest(int playercount) { this.playercount = playercount; } @parameters public static list<object[]> data() { final list<object[]> parametry = new arraylist<object[]>(); parametry.add(new object[] { 19 }); parametry.add(new object[] { 20 }); homecoming parametry; } @before public void vytvorturnaj() throws exception { testcontextmanager = new testcontextmanager(getclass()); testcontextmanager.preparetestinstance(this); } @test public void test1() { assert.assertfalse(false); } }

this illustration works. need add together transaction class:

@runwith(value = parameterized.class) @contextconfiguration(locations = { "classpath:applicationcontexttest-business.xml" }) @transactional @transactionconfiguration(defaultrollback = true) public class tournamentservicetest ...

when add together 2 new line test thrown exception:

org.springframework.aop.framework.aopconfigexception: not generate cglib subclass of class [class org.toursys.processor.service.tournamentservicetest]: mutual causes of problem include using final class or non-visible class; nested exception java.lang.illegalargumentexception: superclass has no null constructors no arguments given

because want add together empty constructor:

public tournamentservicetest() { this.playercount = 20; }

but cant add together because parameterized cant run test. how can solve problem ?

the spring testcontext framework not back upwards parameterized tests. need custom rule or runner this. there open pull request, can take code there.

as of spring 4.2 can use

@classrule public static final springclassrule spring_class_rule = new springclassrule(); @rule public final springmethodrule springmethodrule = new springmethodrule();

java spring junit

powershell - Running raco on the Windows command line -



powershell - Running raco on the Windows command line -

i trying create stand-alone racket executable on windows platform. how go running raco windows command line? i'm not familiar it.

if utilize documentation , come in next command cmd.exe:

raco exe --gui main.rkt

cmd.exe tells me:

'raco' not recognized internal or external command, operable programme or batch file.

substituting in raco.exe tells me same thing.

i tried typing:

'c:\program files\racket\raco.exe' exe --gui .\main.rkt

into powershell , gave me unexpected token 'exe' in look or statement error.

for first problem: need add together windows' %path% (an environment variable) path executable. sec problem: check right syntax exe command, and/or "--gui" modifier, they're beingness misused. instance, seek after solving first problem:

$ raco.exe exe main.rkt

the above create executable main.exe file.

windows powershell scheme racket cmd

ruby on rails - Using the IPAddress Gem As a Custom Field in Mongoid -



ruby on rails - Using the IPAddress Gem As a Custom Field in Mongoid -

i'm trying utilize ipaddress custom field mongoid document monkey patching serialization methods ipaddress module , can't seem it...

class computer include mongoid::document field :ip_address, type: ipaddress end module ipaddress def mongoize to_string end def self.mongoize(object) object.to_string end def self.demongoize(string) ipaddress.new string end def self.evolve(object) object.to_string end end

here's got right second... i've tried lots of other ways , can't find 1 works. help much appreciated!

ruby-on-rails ruby mongoid3

winapi - Write to console when stdin/stderr/stdout redirected in Activestate Perl -



winapi - Write to console when stdin/stderr/stdout redirected in Activestate Perl -

i have next code write windows command console:

use win32::console; $console = new win32::console(win32::console::std_error_handle()); $defaultattribute = $console->attr(); $defaultfg = ($defaultattribute & 0x0f); $defaultbg = ($defaultattribute & 0xf0); $console->attr($defaultbg | $win32::console::fg_lightgreen); $console->write("blah blah"); $console->attr($defaultattribute);

this code fails if user redirects stderr when invoking script:

perl myscript.pl 2> foo

how can obtain handle win32 console process attached without reference 1 of standard handles doesn't matter redirections user makes?

the effect want able write message on console next normal programme output regardless of redirection in similar way bash builtin time command. essentially, similar opening , writing /dev/tty in unix.

i've tried my $console = new win32::console() allocate new console followed $console->display() wrong thing.

after asking question, delved bit deeper , able solve using nasty hack:

use win32api::file qw(createfile); utilize win32::console; $handle = createfile('conout$', 'rwke') or die "conout\$: $^e\n"; # $console = new win32::console($handle) or die "new console: $^e\n"; $console = bless {handle => $handle}, 'win32::console';

i looked @ code new() function within win32::console , saw creates hash containing handle console. if parameter specifies stdin/stdout/stderr, retrieves associated handle otherwise creates new console screen buffer , uses handle that.

so manually created win32::console object containing handle console returned createfile.

so perl myscript.pl > nul 2> nul < nul write blah blah on screen below command line.

i'll take improve reply if comes one.

perl winapi console windows-console activestate

java - Access to HDFS files from all computers of a cluster -



java - Access to HDFS files from all computers of a cluster -

my hadoop programme launched in local mode, , purpose became start in distributed mode. purpose necessary provide access files reading executed in reducer , mapper functions, computers of cluster , hence asked question on http://answers.mapr.com/questions/4444/syntax-of-option-files-in-hadoop-script (also not known on computer executed mapper function (mapper logic of programme there 1 , programme launched 1 mapper), necessary provide access on cluster file arriving on input of mapper function). in regard had question: whether possible utilize hdfs-files directly: re-create beforehand files file scheme of linux in file scheme of hdfs (thereby assume, these files become available on computers of cluster if not so, right please) , utilize hdfs java api reading these files, in reducer , mapper functions executing on computers of cluster?

if on question response positive, give please copying illustration file scheme of linux in file scheme of hdfs , reading these files in java programme means of hdfs java api , and record of contents @ java-string.

copy input files master node (this can done using scp). login master node (ssh) , execute next re-create files local filesystem hdfs:

hadoop fs -put $localfilelocation $destination

now in hadoop jobs, may utilize input hdfs:///$destination. no need utilize api read hdfs.

if want read files hdfs , utilize addiotional info other input files, refer this.

java linux hadoop mapreduce hdfs

flex - What's wrong with this interface assignment? -



flex - What's wrong with this interface assignment? -

i'm trying build old actionscript code inherited, think written older version of flex, , i'm starting larn language. i'm getting error on next line don't know how fix.

import mx.collections.arraycollection; import mx.collections.sort; // ... public var actualmodellist : arraycollection = new arraycollection(); // ... var actualsort : sort = actualmodellist.sort;

1118: implicit coercion of value static type mx.collections:isort perchance unrelated type mx.collections:sort.

i'mm assuming sort implements interface, isort, in other languages i've worked with, assignment seems legit. what's wrong code?

your reply in question itself, lets words -

sort implements interface, isort, in other languages i've worked with, assignment seems legit. what's wrong code?

so know sort implements isort interface or can isort base of operations sort class sort class can cast isort reverse not true.

flex actionscript

api - DHL Real Time Shipping calculator -



api - DHL Real Time Shipping calculator -

is possible have dhl's api implemented shopify?

we assuming need custom ui within shopify well.

not sure why feature not offered dhl has best rates international shipping.

let know if develop , cost be.

thanks in advanced!

you can create app queries dhl shipping rates. can hook on cart. way customers know dhl charges based on whatever cooked products. weight based estimates differ dimensional ones.

assuming got decent estimates on shipping you'd wanting hook shipping rates within shopify utilize dhl. rub there. if cannot hook dhl within shopify setup rates, there not much can within checkout.

perhaps shopify has hooks shop can phone call in own shipping rates? inquire them.

api shopify

asp.net - Dependencies that must be done away with for using CDN -



asp.net - Dependencies that must be done away with for using CDN -

i wanted know that, there special requirement website create utilize of cdn ?

i mean there special scheme(or atleast considerations) on website must build right start create utilize of cdn (content delivery network).

is there can stop website making utilize of cdn, illustration way references content files, static file paths or other thing conceivable.

thanks

it depends.

you have 2 kinds of cdn services:

services aws cloudfront require upload files in special place read (eg. aws s3) - in case need have step in build process correctly upload files , handle addresses somehow within application services akamai need alter , tweak dns records serve request users instead of - in case have 2 domains (image.you.com , image2.you.com) , have image.you.com pointing akamai , image2.you.com pointing original source of file. whenever user requested image in akamai, come through "back door", fetch , starting serving file always.

if utilize sec approach it's simple have cdn supporting application.

asp.net performance website cdn

android - List Specifically Selected app From Google Play -



android - List Specifically Selected app From Google Play -

i know way question 1 app

string desiredappid = "com.rovio.angrybirds"; intent = new intent(intent.action_view,uri.parse("market://details?id="+desiredappid)); startactivity(i);

but if want list (free && selected developer && release date>2011 && etc) how can implement it?

but if want list (free && selected developer && date>2011 && etc) how can implement it?

you cannot create arbitrary queries. the documentation outlines limited options: single app, apps developer, or results of keyword search. there no "date" , there no "&&".

android google-play google-play-services

javascript - How to animate search box on button click? -



javascript - How to animate search box on button click? -

i've create search box search button, want search box visible when click on search button animation (toggle or something...) http://prntscr.com/tijo4 , website: http://thenextweb.com/.

i have tried : http://jsfiddle.net/jhdzd

html:

<div id="search"> <input title="search for..." id="forsearch" type="text" class="forsearch_products"> <input class="search-button" type="submit" value="search"> </div>

css:

#search { width: 250px; height: 28px; background-color: #c7d7e8; padding: 6px 0 6px 0px; } input#forsearch.forsearch_products { width: 135px; height: 18px; border: 2px solid #6b9dd3; margin: 0 3px 0 8px; float: left; padding: 3px; } input.search-button { width: 85px; height: 28px; border: 1px solid white; font-size: 12px; display: block; float: left; font-weight: bold; color: white; background: rgb(237,173,113); }

with jquery, simple. using code fade in search box (which have adjusted hidden) upon click of search button:

$("#search").click(function(){ $("#forsearch").fadein(1000); })

check out fiddle see in action. have adjusted search box's position fixed right (you can see why if remove style changes, leave search box hidden initially). can check out page larn more jquery effects.

javascript jquery dom animation

jpa - Hibernate many to many mapping the same entity -



jpa - Hibernate many to many mapping the same entity -

when mapping same entity answered here :

hibernate many-to-many association same entity

in "tbl_friends" table have rows same meaning. example, have user id=1 , user id=2. in "tbl_friends" table when linked friends have 2 rows

1-2 2-1

is posible somehow create kind of relationship in 1 row (1-2 or 2-1) using hibernate or jpa anotations?

no can't because 2 rows doesn't have same meaning. 1 row saying persona friend personb , other personb friend persona. functionnally speaking, in example, 2 relations might have same meaning that's not case @ database level (friendship not mutual ... that's sad). thing can hide in api :

public class person { private set<person> friends = new hashset<person>(); public void addfriend(person person) { friends.add(person); person.getfriends().add(this); } }

hibernate jpa many-to-many

android - Google map doesn't show correct location -



android - Google map doesn't show correct location -

not long ago updated map class on app utilize google maps android api v2. in app utilize class location save current location. when tried add together marker location on map code:

log.e(tag,"adding user_marker @ lat = " + common.curlocation.getlatitude() + ",lng = " + common.curlocation.getlongitude()); user_curr_position = new latlng(common.curlocation.getlatitude(), common.curlocation.getlatitude()); muser_curr_position_marker = mmap.addmarker(new markeroptions().position(user_curr_position).title("your position").draggable(true));

it gave me wrong location (somewhere in deep sea). checked not entering wrong parameter taking lat , long log ("adding user_marker @ lat=32.165603,lng=34.81224") , found right location on google maps (on internet). can tell me doing wrong ?

well, passing in user's latitude in longitude.

user_curr_position = new latlng(common.curlocation.getlatitude(), common.curlocation.getlatitude());

it needs be

user_curr_position = new latlng(common.curlocation.getlatitude(), common.curlocation.getlongitude());

android google-maps google-maps-api-2

android - What Kind of Bandwidth does NFC Provide? -



android - What Kind of Bandwidth does NFC Provide? -

i'm looking starting projects android , nfc. kind of bandwidth nfc provide? assuming had suitable nfc reader/writer attached arduino or similar, , communicating android device held in contact it. lots of people suggest initiate communication nfc , actual info transfer via bluetooth, i'm wondering bandwidth available strictly nfc communication, out of curiosity.

the supported data-rates of air-interface 1 thing. data-rate see after removing protocol overhead, waiting eeprom writes , other stuff takes time whole different story.

long story short, practical data-rate when reading tag or doing peer-to-peer transfers peaks around 2.5 kilobyte/second.

and depending on specific tags or peer technology can lot slower that.

android nfc