Posts

Showing posts from May, 2013

android - Gson Parse Json with array with different object types -

android - Gson Parse Json with array with different object types - how can parse json using gson? have array multiple object types , don't know kind of object need create save structure. cannot alter json message (i don't command server). the class function (sort of) this public class response { private list<object> tr; private int results; (...) } json message (note array multiple object types.) { "tr": [ { "a": { "userid": "112" } }, { "b": { "userid": "123", "address":"street dummy" } }, { "a": { "userid": "154" } } ], "results":3 } the gson user's guide explicitly covers this: https://si...

Generating import library for dbghelp.dll using dlltool of MinGW -

Generating import library for dbghelp.dll using dlltool of MinGW - as mentioned in first reply post "win32 api stack walk mingw/msys?" dlltool can used generate import library mingw. but below command prints "create process" on screen , generates 0kb dbghelp.a file dlltool -k -d libdbghelp.def -l dbghelp.a i used .def file available here: http://sourceforge.net/p/mingw/feature-requests/40/?limit=10&page=1#54a9 the first few lines of .def file are ; file generated automatically ./dbghelp.spec; not edit! library dbghelp.dll exports enumdirtree@24 @3 enumdirtreew@24 @4 enumerateloadedmodules@12 @5 enumerateloadedmodules64@12 @6 am missing something? using mingw version 4.4.1 i see header file dbghelp.h available in page found libdbghelp.def . should placed? also limitation on location tool has run. have copied .def file same directory dlltool , executed command. regards, shreyas the problem mingw 4.4.1 again. works fine...

Mysql inserts the data as unknown values java -

Mysql inserts the data as unknown values java - hello using prepared statement insert values mysql. i facing issue in string inserting "c2a054656e6e6973c2a0" value " tennis " , tried utilize trim trim whitespace in front end of "tennis" did not work .from question why trim not working? tried using solution ponumber.replace(string.valueof((char) 160), " ").trim(); , worked. can 1 give solution this? sample code create table `news1` ( `article_id` int(11) not null auto_increment, `article_title` varchar(500) collate utf8_bin not null, `article_subcategory` varchar(255) collate utf8_bin default null, primary key (`article_id`) ) engine=innodb default charset=utf8 collate=utf8_bin auto_increment=22 ; //sample category "home » tennis" string category = item.getarticle_category(); string categoryarray[] = category.split("»"); preparedstatement = connect ...

How to allow user other than Administrator to Add New User in DotnetNuke? -

How to allow user other than Administrator to Add New User in DotnetNuke? - in dotnetnuke, administrator can add new user. want allow other user custom role add together new user. possible dotnetnuke ? it used possible, though haven't tried in quite while. basically can seek couple of options. 1) can assign page permissions on user accounts page in dnn users of specific role. need provide users link page, won't see admin menu , won't have access link via admin menu. 2) can (used able to) place user business relationship module on page other roles have access to, problem user accounts , security roles modules "premium" meaning have (as superuser) allow them utilize in portal before can placed on page. host/extensions page , click on edit pencil next module, find premium section assign specific portal. add together module(s) page, you'll find more user business relationship module gets added, want remove ones deleting them page. hopeful...

twitter bootstrap - Accordion doesn't collapse previously opened div -

twitter bootstrap - Accordion doesn't collapse previously opened div - i unsure how messed up! copied , pasted code twitter bootstrap accordion straight bootstrap website (or thought!), yet when click open first panel, 2nd, first doesn't auto collapse. clue did wrong? source code located here twitter-bootstrap jquery-accordion

c# - how to update a table values based on the table values in update statement? -

c# - how to update a table values based on the table values in update statement? - i using mqsql db , connect db c#.now want update table field adding table field + current value. i have done like, first field using select statement , add together current value existing value.finally update table set new value table field... so, there way in update statement without using select statement? please guide me out of issue? since same table, can update straight , utilize where clause field value want, instead of select . something this: update tablename set somefield = somefield + 'some value' somefield = 'some other value'; note that: there no need field value first add together current value existing value , update, can however, straight using: set somefield = somefield + 'some value' . c# mysql sql database

laravel fluent update two tables -

laravel fluent update two tables - i have 2 tables want update 1 query, cannot find how this? $update = db::table('users') ->join('addresses', 'users.id', '=', 'addresses.user_id') ->where('id', '=', auth::user()->id) ->update(array( 'firstname' => $userdetails['firstname'], 'lastname' => $userdetails['lastname'], 'email' => $userdetails['email'], 'password' => $userdetails['password'], 'addresses.add_line1' => $userdetails['addl1'], 'addresses.add_line2' => $userdetails['addl2'], 'addresses.town' => $userdetails['town'], 'addresses.county' => $userdetails['county'], 'addresses.post_...

Jquery animating child using destination offset with parent set to position relative -

Jquery animating child using destination offset with parent set to position relative - i've serious problems animating little image 1 place another. i destination offset , seek animate image towards desired location using offset content coordinates. ends incorrect. i understand problem position:relative, position:absolute; cannot rid of these becuase of the layout i've... is there improve way calculate coordinates against window? i made simplified fiddle can see mean... http://jsfiddle.net/9wmgk/1/ $("#thirdba a").on("click", function(){ $("#thirdba").append('<p class="animated">this me</p>'); var offset = $("#second").offset(); console.dir(offset.left); console.dir(offset.top); $(".animated").animate({left: offset.left, top: offset.top},"slow"); }); when click link box appended. , must move "come here" div. any ideas how solve problem...

Drawing an OpenGL scene to C# bitmap; off-screen gets clipped -

Drawing an OpenGL scene to C# bitmap; off-screen gets clipped - i draw complex 2d scene opengl window. user able take screenshot of scene , save jpg. however, them able specify scene can drawn bigger screen (which allow them see more details, etc). when specify numbers bigger viewport fits screen, not visible them not drawn bitmap. sense have false understanding of behavior of of these opengl functions haven't been able track down. the below code works totally fine when rendersize smaller default viewport start programme with. if rendersize bigger, jpg of appropriate size gets created, right/top section past screen's visible area blank. if click , drag viewport across sec monitor, more of image gets drawn, still not of if rendersize bigger both monitors. how can create drawing independent of viewport shown screen is? (i can verify renderlocation , rendersize set correctly when function called, rendersize beingness big number, 7000 x 2000) public bitma...

design - Publish event from service layer composed of web applications using service bus -

design - Publish event from service layer composed of web applications using service bus - i have read why not publish nservicebus messages web application , another similar question not clear if applies service layer well. example, if service layer composed of web services or rest services built using wcf or web api or other way, should services publish events or send commands? if services hosted in load balanced web servers, problems outlined in articles apply layer well. how recommendation alter or not change? if definition of event vs command, messages talking events e.g. "a user created" , event should published. matter of fact, service created user doesn't know else i.e. may application supposed create customized portal , yet application supposed send welcome kit user. event , not command. guess hung on definition of web application , application service when application service composed of 1 or many web applications. the definition of web application ...

css - Issue using as vertical spacer in Hotmail HTML email -

css - Issue using <div> as vertical spacer in Hotmail HTML email - we're using next code vertical spacer in html email: <div style="height:14px; font-size:14px; line-height:14px;">&#160;</div> this works everywhere -- except hotmail creates big space. we've researched bit , seems hotmail embeds css default causes lot of issues. we've included next code seek address issue, no avail: .externalclass, .externalclass p, .externalclass span, .externalclass font, .externalclass td, .externalclass div { line-height: 100%; margin: 0; padding: 0;} hoping else here might have solution or workaround. if spacer why not utilize table spacer image instead. email clients prefer table on div inline style , render correctly. such: <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td height="10"> <img src="http://media.i...

passing an html id into javascript function -

passing an html id into javascript function - i learning javascript , not understand how pass id html javascript function. my css page has here: #quizclock (with properties here) and on html page have javascript function so: <script type="text/javascript"> var seconds = 0; var clockid; function runclock() { seconds + 1; quizclock = seconds; //right here problem. } function startclock() { showquiz(); runclock(); setinterval("runclock()", 1000); } function stopclock() { clearinterval(runclock); gradequiz(); homecoming = correctans; alert("you have " + correctans + " right out of 5 in " + quizclock + " seconds."); } </script> so need utilize id quizclock in function. tips? i noticed few other problems code, i've commented fixes , added couple of other tips too. var seconds = 0; var clockid; var correctans; // ...

python - How to get XWindow ID in GTK3? -

python - How to get XWindow ID in GTK3? - in gtk3, how retrieve xwindow id? didn't see related in gdkwindow. in documentation, said there gdk_window_xid() macro. however, cannot find equivalence in python binding. python x11 gtk3

sql - TSQL where case -

sql - TSQL where case - i need right tsql syntax problem : select * table var_a='10' select * table var_b='10' when utilize var_a or var_b depends on value of var_c so when var_c='something' utilize var_a='10' else var_b='10' select * [table] case when var_c = 'something' var_a else var_b end = '10' sql fiddle demo. sql sql-server tsql

ios - Lagging ScrollView with UIWebview inside -

ios - Lagging ScrollView with UIWebview inside - i have uiwebview within uiscrollview lot of content. when content loaded uiwebview big, starts lag. does know how solve issue? maintain in mind lags when uiwebview's height becomes considerably big. thank in advance! if read documentation on uiwebview , states not embed uiwebview uitableview or uiscrollview . doing leads unexpected behaviour, , think experiencing first hand. sorry bearer of bad news. update - specific warning apple docs: the documentation addresses issue specifically. important: should not embed uiwebview or uitableview objects in uiscrollview objects. if so, unexpected behavior can result because touch events 2 objects can mixed , wrongly handled. apple reference on uiwebview . update 2: after doing few searches (search link, same posted in comments), came across this answer, may provide insight. monitors content offset in both uiscrollview , uiwebview via delegates, , cle...

html - jQuery function .bind not working in IE -

html - jQuery function .bind not working in IE - this website if click on little thumbnails larger image displays. in chrome works perfectly, when seek in ie9 doesn't anything. here code: jquery // javascript document //button1 ;(function($) { // dom ready $(function() { // binding click event // jquery v.1.7.0 utilize .on() instead of .bind() $('#my-button').bind('click', function(e) { // prevents default action triggered. e.preventdefault(); // triggering bpopup when click event fired $('#element_to_pop_up').bpopup({ appendto: 'form' , zindex: 2 , modalclose: false }); }); }); })(jquery); //button2 ;(function($) { // dom ready $(function() { // binding click event ...

java - why are all the opengl enums hexadecimal? -

java - why are all the opengl enums hexadecimal? - why opengl enums hexidecimal? example: gl_max_vertex_uniform_components = 0x8b4a the enums used parameters in gl functions. question is, why parameters hexidecimal ? not sure in case, in cases matters bits set, using hexadecimal easier figure out bits set. java opengl enums hex

python - Two bar charts in matplotlib overlapping the wrong way -

python - Two bar charts in matplotlib overlapping the wrong way - i'm creating bar plot matplotlib in python, , i'm having bit of problem overlapping bars: import numpy np import matplotlib.pyplot plt = range(1,10) b = range(4,13) ind = np.arange(len(a)) width = 0.65 fig = plt.figure() ax = fig.add_subplot(111) ax.bar(ind+width, a, width, color='#b0c4de') ax2 = ax.twinx() ax2.bar(ind+width+0.35, b, 0.45, color='#deb0b0') ax.set_xticks(ind+width+(width/2)) ax.set_xticklabels(a) plt.tight_layout() i want bluish bars in front, not reddish ones. way have managed so far switch ax , ax2, ylabels going reversed well, don't want. isn't there simple way tell matplotlib render ax2 before ax? in addition, ylabels on right beingness cutting off plt.tight_layout(). there way avoid while still using tight_layout? perhaps there improve way not know about; however, can swap ax , ax2 , swap location of corresponding y -ticks with ax....

sql - Get Identity after selecting from distinct result -

sql - Get Identity after selecting from distinct result - i have 2 tables ( model_table , items_table) model_tabl ( id, modelname, modelquantity) items_tabl ( i_code, iname, id) after inserting new row (model_table) - triggers insert multi row (items_table) depend on modelquantity (model_table) , , until work fine i created "select distinct modelname , sum(modelquantity) grouping modelname" , got result fine my question is : when select model name (distinct) query want know (id) selected (model_table) model_id (to) model_name = 1 (to) many ty just do: select id, modelname , sum(modelquantity) grouping id, modelname as long id , modelname 1-to-1, you're good. (btw, "distinct" here superfluous - select distinct a,b,c tbl shorthand select a,b,c tbl grouping a,b,c ) sql sql-server tsql

install - GitHub Boxen Error -

install - GitHub Boxen Error - i'm not biggest user of github , when seek , install new "boxen" (https://github.com/boxen/our-boxen) i'm having issues. the readme.md has instructions , i'm getting error when running git checkout -b master upstream/master any ideas? created local repo if that's difference, or need create 1 on github? error message: fatal: operation must run in work tree github install

java - Android Thread progressBar issue -

java - Android Thread progressBar issue - the issue of running thread isn't much issue. i'll give quick outline of want , problem having. i currently: implementing runnable interface creating new thread , phone call start method creating run method start method call. the purpose of new thread animate progress bar while main thread processing image (pixel level). create progress bar follows in oncreate method (loadbar declared globally) loadbar = (progressbar) findviewbyid(r.id.loadbar); then in run method loadbar.animate(); however when run method called throws null pointer exception. when creating new thread runnable interface guess doesn't phone call oncreate method causing null pointer there way around or missing simple? edit: code requested cutting downwards little problem lies public class mainactivity extends activity implements runnable { //declare progressbar private progressbar loadbar; //declare thread private thread createanimation...

ios - Add opaque subview to UITextField -

ios - Add opaque subview to UITextField - i have subclass of uitextfield , i'm trying ot add together opaque subview it. however, when type in uitextfield , appears transparent , can see text behind view. how can create view opaque? here code inits subclass , adds view. - (id)initwithframe:(cgrect)frame { self = [super initwithframe:frame]; if (self) { // initialization code _dropdownicon = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"ab- dropdown-on"]]; dropdownicon.backgroundcolor = [uicolor blackcolor]; _dropdownicon.frame = cgrectmake(self.frame.size.width-dropdown_icon_size,0,dropdown_icon_size,dropdown_icon_size); [self addsubview:_dropdownicon]; } homecoming self; } your subclass needs override -textrectforbounds: method homecoming actual area want text draw in, e.g. - (cgrect)textrectforbounds:(cgrect)bounds { cgrect textrect = [super textrectforbounds:bounds]; ...

java - Integrating Spring Security and Waffle on Tomcat with Role checks -

java - Integrating Spring Security and Waffle on Tomcat with Role checks - as title suggests, i'm trying integrate spring security , waffle on tomcat using roles. app deployed windows environment users have been domain authenticated , want exercising single sign on. take things further, want check groups authenticated user belongs , configure interceptors prevent users not members of approved group(s) accessing web app. here's app context looks like: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p" xmlns:cache="http://www.springframework.org/schema/cache" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:sec="http://www.springframework.org/schema/security" xmlns:context="http://www.springframework.org/sch...

c# - Reduce global state in web applications -

c# - Reduce global state in web applications - there numerous posts available on alternatives global state, have lingering questions regarding implementation in web environment. in asp.net, values stored in session practically global variables, seems can't reasonably store, e.g., authenticated username, permissions, etc. across pages , events without resorting session[] collection. (i typically utilize dependency injection, wouldn't want pass these values in viewstate/url client.) so take global state necessary evil in web development (due stateless nature of http) , reply utilize responsibly. facade pattern implementation? static class such 1 below get s , set s values in session doesn't much mask global state. public class sessionwrapper { public static string username { { homecoming convert.tostring(session["username"]); } set { session["username"] = value; } } public static bool isauthenticated { ...

date - PHP Convert seconds into MM:DD:HH:MM:SS -

date - PHP Convert seconds into MM:DD:HH:MM:SS - this question has reply here: convert seconds days, hours, minutes , seconds 6 answers i help converting seconds mm:dd:hh:mm:ss format. i have code here: <?php // convert seconds months, days, hours, minutes, , seconds. function secondstotime($ss) { $s = $ss%60; $m = floor(($ss%3600)/60); $h = floor(($ss%86400)/3600); $d = floor(($ss%2592000)/86400); $m = floor($ss/2592000); homecoming "$m months, $d days, $h hours, $m minutes, $s seconds"; } ?> it outputs illustration of 0 months, 1 days, 3 hours, 46 minutes, 39 seconds i 00:01:03:46:39 how can that? from gather, looks you're interested in returning string values containing 2 digits separaed colons. assuming positioning doesn't need change, can similar following: <?php // ...

java - Xtend/Xpand find and replace (rule) -

java - Xtend/Xpand find and replace (rule) - is possible set rule allow xpand method output specified string of text depending on input. example: «for a:e.attributes» type = «a.eclass.name» value = «a.name.tofirstupper» «endfor» the above code may output: type = stringattribute value = string1 type = integerattribute value = 123 how create output: type = string value = string1 type = int value = 123 i know can done if statements able more or less automatic. waste have specify such rules every time need output these details in same file. show me kind of code utilize accomplish this? give thanks you. i suggest create reusable xtend helper tosimplename(string inp): switch (inp) { case "stringattribute" : "string" case "integerattribute" : "int" // ...more cases here... default : inp } ; and phone call xpand template this: «for a:e.attributes» t...

image - Traversing through pixels -

image - Traversing through pixels - say have next part of algorithm, provided want implement in matlab : k = 0; while k<n among pixels "belong to" set, select pixel k = k+1; how can implement? determining if pixel "belongs to" image or set of image thanks. generally, in matlab, image (gray/color) represented 2d/3d matrix for example, i = imread("lena.jpg"); so, size of m x n grayness , m x n x 3 color now if want select pixel "belongs to" subset of image (rectangle) (xi yi) (w h) . origin i.e., (1,1) pixel of image top left corner. isub = i(xi:xi+w-1, yi:yf+h-1); also, can access pixels using pixel = i(i,j); ith pixel top , jth pixel left if "belongs to" complex pixels reddish or else, approach/complexity vary image matlab set pixel belongs-to

security - The right way to create a config.php -

security - The right way to create a config.php - at moment placing config.php file in include folder on apache server, gives me easy access file, having write directory path. assume thought since secure , not reachable outside public root folder. i never told how create config.php file improvised, seems may have been done wrong way.. (not secure now). began search tutorials on how build these config files right way, each , every tutorial had own way it.. did using arrays.. did defining configuration variables.. others using class.. there may not right way, want secure , functional scheme work, , don't care how advanced going be.. this current config file.. should see not secure in way, cause might able echo variables , read connection. <? $main_host = 'db01.server.local'; // there may db02, db03 etc. $main_psw = '********'; $main_host_end = '.server.local'; // makes possible me connect different datastore knowing subdomain. // *** us...

android - Custom listview background color change at runtime -

android - Custom listview background color change at runtime - i have application custom list view has textview , imageview. when click image view, background color should change. tried this, getting nullpointerexception ...here code customlistviewadapter.java public class viewholder { textview mname; imageview mdeleteimage; } public view getview(int position, view convertview, viewgroup parent) { holder = null; datafields rowitems = (datafields) getitem(position); layoutinflater inflater = (layoutinflater) context .getsystemservice(activity.layout_inflater_service); if (convertview == null) { convertview = inflater.inflate(r.layout.home_field_row, null); holder = new viewholder(); holder.mname = (textview) convertview.findviewbyid(r.id.hmfieldname); holder.mdeleteimage = (imageview)convertview.findviewbyid(r.id.hmfielddeleteimage); convertview.settag(holder); holder.mdeleteimage.settag(p...

iOS app cannot read info.plist -

iOS app cannot read info.plist - i made re-create of app folder , saved directory on desktop. now, original app (or copy) cannot run because says info.plist cannot read from: could not read info '/users/xxxxxxxx/desktop/development/apps/eus/eus calculator/eus calculator/eus calculator-info.plist': file “eus calculator-info.plist” couldn’t opened because there no such file. but, eus calculator-info.plist @ path. i've looked through , google , can't seem find solution. how can resolve this? based on comments i never moved it, made copy. original on desktop... desktop/development/apps/...i made copy, pasted desktop/git/ , ever since have been getting error and error says could not read info '/users/xxxxxxxx/desktop/development/apps/eus/eus calculator/eus calculator/eus calculator-info.plist': file “eus calculator-info.plist” couldn’t opened because there no such file. so seems info.plist pointing original one. ios info.pl...

Launch event on first click jQuery -

Launch event on first click jQuery - is there possibility in jquery add together event e.g alert('hi'); first click ? yes, may utilize one binding function : myelement.one('click', function() { alert('hi'); }); jquery

c# - knowing type variable at runtime -

c# - knowing type variable at runtime - i want sure parameter variable of type guid. public actionresult edit(guid id) { // if id != guid print error } i guess pretty basic question i'm stuck here. thanks in case, there no chance passed in value not guid. the guid structure value type - can't inherited. means type compiler take argument method guid . c#

excel - Changing String input data into week / month format -

excel - Changing String input data into week / month format - i'm not sure if possible thought inquire see if 1 may have solution. issue: have macro user inputs date string (e.g. 021513) in input box. in string format it's used open file (string @ end of file name). from string (e.g. 021513) need derive next in 2 separate fields: week period (e.g. week: 11th - 15th). month (e.g. february). any help or thoughts appreciated. ciaran you can excel formulas: assuming string cell a1, utilize next formulas: b1 (date): =date(right(a1,2)+2000,left(a1,2),mid(a1,3,2)) c1 weekday: =weekday(b1,2) - homecoming 1 monday, 2 tuesday, etc. d1 start of week: =b1-c1+1 e1 end of week: =d1+4 f1 month: =text(b1,"mmmm") string excel date excel-vba excel-2007

c - changing a const char *str1 = "abc" -

c - changing a const char *str1 = "abc" - is practice? code compiles , runs wonder if practice emulate in c code, we write const char *str1 = "abc"; then later, lets there pointer variable char *str2 points dynamically allocated memory and str1 = str2 both str1 , str2 point dynamically allocated memory so have lost track of pointer "abc" . though in code, may not need wonder best recommended way handle these. the overall problem need string declared abc , later dependent on user input, may want utilize string supplied user. it's absolutely fine. const char *str1 means "a pointer can modified, character info cannot modified (through pointer)". so, can point str1 @ string like, , makes sense "reseat" point @ different strings @ different times. obviously if code complicated enough, can create hard reader work out variable contains, that's true of variables. illustration want careful pointers poi...

keyboard - How can I list available input devices with haxe? -

keyboard - How can I list available input devices with haxe? - i list input devices available when launch application, can't find way in api. how can list of available keyboards, mice, gamepads, touch screens, accelerometers... haxe programming language compiles other languages. there projects utilize compiled haxe code deploy different runtimes. illustration nme framework compiles neko, html5, flash, mobile etc. question doesn't create strictest sense. i uncertainty there api getting list of available input devices in nme evident. go through api 1 input @ time test if available or working guess. do have special need this? people utilize compiler conditionals determine these things eg; #if mobile //your touch input code #elseif desktop //your mouse / keyboard code #end keyboard mouse haxe joystick input-devices

linux - Query regarding su command -

linux - Query regarding su command - can explain difference between su -p (--preserve-environment) , su - when switching user @ command-line? i'm familiar "su -" it's unclear me how su -p differs, if @ all. the difference su -p can preserve personalization did original user. example, preserve alias, bashrc, profile ... linux command

java - Continue keyword in recursion -

java - Continue keyword in recursion - i have come across below code while searching answers. public static void recurse(scanner in, hashmap<string, integer> oldmap) { hashmap<string, integer> map = null; if (oldmap == null) map = new hashmap<string, integer>(); else map = new hashmap<string, integer>(oldmap); while (in.hasnext) { string s = in.nextline(); if (s.startswith("[")) { recurse(in, map); continue; } if (s.startswith("]")) { break; } string[] split = s.split(" "); if (s.startswith("print")) { system.out.println(map.containskey(split[1]) ? map.get(split[1]) : 0); continue; } int x = 0; seek { x = integer.parse(split[1]); } grab (exception e) { x = map.containskey(split[1]) ? map.get(split[1]) : 0; ...

php - does not support Arabic Content in webpage -

php - does not support Arabic Content in webpage - hi creating standard arabic website. problem not back upwards standard arabic content. comes ???????????? . set charset="utf-8" in .htaccess. set meta tag in every page. saved files utf-8 back upwards file format. set there header('content-type: text/html; charset=utf-8'); mysql stored info shown in standard arabic language if set standard arabic language in tag wont support somebody have thought regarding because firs standard arabic website. try adding meta charset standard arabic @ begning <meta http-equiv="content-type" content="text/html; charset=iso-8859-6"> or may seek out next steps :- displaying standard arabic text using php 1. don't utilize short tags <? ?>. utilize total tags <?php ?> 2. remove quotes , semicolon first line , others outside php tags "<!doctype html public "-//w3c//dtd html 4.0 transiti...

Django 1.5 AbstractBaseUser with char primary key not JSON serializable -

Django 1.5 AbstractBaseUser with char primary key not JSON serializable - i having next custom user model trying utilize django 1.5 abstractbaseuser: class merchant(abstractbaseuser): email = models.emailfield() company_name = models.charfield(max_length=256) website = models.urlfield() description = models.textfield(blank=true) api_key = models.charfield(blank=true, max_length=256, primary_key=true) username_field = 'email' required_fields = ['email','website'] class meta: verbose_name = _('merchant') verbose_name_plural = _('merchants') def __unicode__(self): homecoming self.company_name the model works , database expected, problem when seek dumpdata create fixtures tests. python manage.py dumpdata --natural --exclude=contenttypes --exclude=auth.permission --indent=4 > fixtures/initial_data.json then error: commanderror: unable serialize database: ...

android - Is there a way to force different orientations for different devices? -

android - Is there a way to force different orientations for different devices? - i want app displayed landscape on tablets, should rotate ok on mobiles. there way (besides of having 2 different apks)? use method check whether device tablet, force orientation if it's true. // http://stackoverflow.com/questions/5832368/tablet-or-phone-android public boolean istablet(context context) { boolean xlarge = ((context.getresources().getconfiguration().screenlayout & configuration.screenlayout_size_mask) == 4); boolean big = ((context.getresources().getconfiguration().screenlayout & configuration.screenlayout_size_mask) == configuration.screenlayout_size_large); homecoming (xlarge || large); } // ... // activity not wish rotate on tablets: if (istablet(this)) setrequestedorientation(activityinfo.screen_orientation_landscape); android device-orientation

networking - RIP- Counting to infnity -

networking - RIP- Counting to infnity - i'm having problems understanding count infinity rip. i understand how table set using distance vectors. when link breaks costs must recalculated , updated in new table. i'm not sure how (3,3) value updated after (4,1). why cost node 3 node 3 3. in illustration prof posted link between node 3 , 4 breaks. the table route table node 4 destination. (x,y) in table means "i can node 4 via x in y steps. before break: n1 can n4 via n2 in 3 steps. n2 can n4 via n3 in 2 steps. n3 can n4 via n4 in 1 step. after break, n3 no longer knows how n4 directly. problem n2 thinks knows how n4 in 2 steps, , communicates n3. hence n3 thinks can n4 via n2 in 3 steps, , downward spiral begins. networking routing router

java - How to carry row id on javascript function? -

java - How to carry row id on javascript function? - i'm beginner in area, have made coding based on other example. want create dynamic dropdown based on 2 dropdown, when 1st selected , 2nd filtered based on 1st dropdown. problem when multiple row, code not function because doesn't carry row id, don't know how carry row id on function below code i've made financialdatalist.jsp class="lang-html prettyprint-override"> <script language="javascript" type="text/javascript"> function addrowtotable() { var tbl = document.getelementbyid('data'); var lastrow = tbl.rows.length; var iteration = lastrow-1; var row = tbl.insertrow(lastrow); row.valign = "top"; var cnt = iteration+1 //cell 1 var cell1 = row.insertcell(0); var elem1 = document.createelement('select'); elem1.setattribute("id","typecode"+iteration)...

Configuration + Code example of using Atmosphere with Wicket? -

Configuration + Code example of using Atmosphere with Wicket? - this question has reply points non-working illustration , conversation on mailing list vague. there working illustration of using wicket 6.5.0 atmosphere? or there other viable server-push technology integrates wicket? specifically looking finish web.xml (atmosphere.xml if needed), application , page classes the github project rjo linking works fine me. wicket-atmosphere-quickstart i used embedded jetty server run , went http://localhost:8080/app/ wicket atmosphere

itextsharp - while creating pdf from existing pdf the acrofields position are shifting compared to original pdf -

itextsharp - while creating pdf from existing pdf the acrofields position are shifting compared to original pdf - i creating pdf pdf contains acrofields , getting next issues: the acrofields behave strangely because of text shifted downwards (sometimes up) placement in created pdfs after cursor placed , clicked in form field edit text. behavior not occur in original pdf documents. now if create flat pdf setting stamper .setformflattening(true) , text of acrofields not written @ exact position little amount result in overlapping of text if 2 acrofields close each other. the code using is import com.lowagie.text.pdf.acrofields; import com.lowagie.text.pdf.pdfreader; import com.lowagie.text.pdf.pdfstamper; string pdfname = "pdfname.pdf"; pdfstamper stamper = null; fileoutputstream fout = null; pdfreader reader = new pdfreader(pdfname); fout = new fileoutputstream("outputpdf.pdf"); stamper = new pdfstamper(reader, fout); acrof...

c# - group by select max in linq -

c# - group by select max in linq - i'm trying find out how still confuse linq sytax. my purpose find max effectivedate specify empcode var x = (from workingresult in this.dataworkspace.applicationdata.workingresults grouping workingresult workingresult.employeecode g g.employeecode == employeecode && (g.effectivedate.hasvalue && g.effectivedate.value.equals(date)) select new {effectivedate = g.max(d=>d.effectivedate)}); but compiler shows me this " not find implementation of query pattern source type'...'. 'groupby' not found. consider explicitly specifying type of range variable 'workingresult'. " what means ? really need help. give thanks you. the problem code treating grouping g if single workingresult. in reality list of them. furthermore, purpose of g.effectivedate.value.equals(date) ? result in maximum effective date beingness date or nothing, if no...

google maps - Bounding box for a number of lat lon -

google maps - Bounding box for a number of lat lon - i have number of lat long list e.g. 100.909423828125 4.784468966579362,101.337890625 4.543570279371759,101.019287109375 4.521666342614804,100.931396484375 4.532618393971778,100.909423828125 4.784468966579362,100.909423828125. need build bounding box point based on radius in meters. best mechanism accomplish this? give thanks you. google-maps

Fast database as an alternative to PHP array -

Fast database as an alternative to PHP array - i have array containing reference variables, , in scripts need grab 1 variable or two. in current system, have include entire array (and elements) utilize 1 element. seems using database improve 2 reasons: one record read instead of entire array variables can edited however, there major drawback using database: on every php run, need create connection database. since simple database systems sqlite has no server, persistent_connection not advanced database servers mysql . in action, $db = new sqlite3('mysqlitedb.db'); takes more time (and consumes more resources) than include 'array.php'; is there solution having basic database scheme (with fast connection) replacement php array , include file? in other words, need simple database scheme fast connection comparable fopen . however, cdb incredibly fast, not fast plenty on initial connection. by including static array file doing cach...

css3 - Titillium Web Font applied to Select element -

css3 - Titillium Web Font applied to Select element - i have utilize titillium web font select element within web-page, , have utilize specific font-size , font-weight values. problem is, specified values, text within select element shifted downwards , lower edges hidden! i've tried using next css properties on select element: vertical-align: text-top !important; line-height: 80%; but none works! can 1 help me solve please? css3 vertical-alignment html-select css

sql server - Connecting to MSSQL from PHP securely with encryption? -

sql server - Connecting to MSSQL from PHP securely with encryption? - i need connect mssql database php. however, server on remote site connected, require connection encrypted. is possible utilize encrypt connection mssql server using mssql extension php or alternatively pdo? there 3 things of import when implementing secure (encrypted) connection mssql: the options encrypt , trustservercertificate used together. by default sql server installs self-signed certificate utilize encrypt connections - self signed certificate open attacks. should replaced 1 certificate authorization (ca). after replacing certificate, set encrypt = true , trustservercertificate = false ( trustservercertificate = true work, connection vulnerable attacks) code-example article *1: $servername = "servername"; $connectioninfo = array( "database"=>"dbname", "uid"=>"username", ...

database - how to send location map in android -

database - how to send location map in android - i'm trying add together feature in app in android , send location it's done on whatsapp or viber. know how retrieve location either via google maps or coordinates via provider, can help me started in how send map of location? perchance database 1- after location using locationmanager can store values lat/long in variables. 2- store variables in json object. 3- post json using http request on web page 1- handle json response 2- store values in variables 3- view map putting variables in code given google maps api android database google-maps location

javascript - jquery auto print the row number -

javascript - jquery auto print the row number - i've table 10 row, possible print row number (from 1 9, first row no&title, sec row should 1) td class "sno" based on size of table? here html: <table width="100%" border="1"> <tr> <td width="23%">no.</td> <td width="77%">title</td> </tr> <tr> <td class="sno">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td class="sno">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td class="sno">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td class="sno">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td class="sno">&nbsp;</td> <td>&nbsp;</td> ...