Posts

Showing posts from February, 2015

android - How can I open a Fragment under the open NavigationDrawer with defining the Drawer in a separate fragment? -

android - How can I open a Fragment under the open NavigationDrawer with defining the Drawer in a separate fragment? - my app opens navigationdrawer @ start. when user clicks on item in fragment beingness replaced. for every item in navigation drawer have separate fragment. when user not take of options in navigationdrawer , closes it, main activit layout beingness shown. i want 1 of own fragments brought when user closes side menu. (navigation drawer) npe when seek change setcontentview(r.layout.activity_main); with setcontentview(r.layout.my_fragment); (because cannot find navigation_drawer since defined in activity_main) i don't set navigationdrawer in 1 of fragments, neither re-create fragment elements main.xml (it messy design :( ). supposed do? how supposed open desired fragment underneath navigationdrawer?? here oncreate in mainactivity: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);

gradle - How to download a non-dependency artefact as part of buildScript block for Semantic Versioning -

gradle - How to download a non-dependency artefact as part of buildScript block for Semantic Versioning - first off, have no code show since i'm stumped one. bad form question apologize - worked entire yesterday on related build script couldn't useful show this. i working on build script part of jar task (or rather dolast {} closure) verify current jar against previous published jar own artifactory using semver api. else have works except downloading previous version of project; can't seem able devise working script. my approach far based on reasoning gradle uses ivy dependency management scheme should able phone call of ivy's ant tasks right parameters - same current project have access group, name , current version - , path downloaded artefact file , utilize input aforementioned semver api. beingness bit of gradle newbie , not have used ivy few years struggle revealed me @ point have no thought how in clean way. 1 of major hurdles has far been gradle&#

php - My Laravel 4 app shows errors when uploaded to my website -

php - My Laravel 4 app shows errors when uploaded to my website - i new laravel 4. when upload app website shows errors. how should configure prepare it? warning: require(__dir__/../bootstrap/autoload.php) [function.require]: failed open stream: no such file or directory in /home/a4651312/public_html/laravel/public/index.php on line 21 php error message fatal error: require() [function.require]: failed opening required '__dir__/../bootstrap/autoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a4651312/public_html/laravel/public/index.php on line 21. i set app (name laravel) in public_htmt , sent link default.html public. php laravel-4 laravel-routing

c# - Get url address from url file -

c# - Get url address from url file - i'm pretty new c# (only month of experience). i'm working on project url address .url file have no thought how go doing so. i've tried googling maintain getting "text url", not other way around. help awesome! input in advance! i'm new site, if need reply more questions, please allow me know! edit: basically, i'm trying convert net shortcuts in favorites folders addresses. example, turn "google" shortcut http://www.google.com. hope helped. will quite easy think, seek like: string line = file.readlines(filename).skip(1).take(1).first(); string url = line.replace("url=",""); url = url.replace("\"",""); url = url.replace("base",""); kind of ugly works, advise using regular expressions validate resulting url. c# string url text

android - How to set an image to the really top of app? -

android - How to set an image to the really top of app? - i seek set image top of android app. but there space left/right/top if margin zero. code: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="0dp" android:layout_marginbottom="0dp" android:layout_marginleft="0dp" android:layout_marginright="0dp" android:layout_marginstart="0dp" android:layout_margintop="0dp" android:background="@drawable/bgcolor" android:gravity="top" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:c

android.view.InflateException Caused by: java.lang.OutOfMemoryError -

android.view.InflateException Caused by: java.lang.OutOfMemoryError - this issue seems occur on little number of devices crashes entire app users. the app loads 2 images @ once, 1 original, 1 blurred re-create scrolling effect. i'm using picasso load in images reduced issues still occurs select few. a new set of images (original & blurred) loaded every time app opened. the images initialised in oncreateview method follows: nonblurimageview = (imageview) layoutview.findviewbyid(r.id.orginal_image); picasso.with(getactivity()).load(getresources().getidentifier(bgnum, "drawable", getactivity().getpackagename())).into(nonblurimageview); blurredimageview = (imageview) layoutview.findviewbyid(r.id.blured_image); picasso.with(getactivity()).load(getresources().getidentifier(bgnum+"_blur", "drawable", getactivity().getpackagename())).into(blurredimageview); the stack trace starts android.view.inflateexception: binary

android - How to create Parcelable code for object that contains GregorianCalendar -

android - How to create Parcelable code for object that contains GregorianCalendar - i haven't understood how create code needed implement correctly parcelable object contains gregoriancalendar objects. e.g. object user contains string name; , gregoriancalendar creationdate; , effort this: @override public int describecontents() { homecoming 0; } @override public void writetoparcel(parcel dest, int flags) { dest.writestring(this.name); dest.writeparcelable(this.creationdate, flags); } private user(parcel in) { this.name = in.readstring(); this.creationdate = in.readparcelable(gregoriancalendar.class.getclassloader()); } public static final creator<user> creator = new creator<user>() { public user createfromparcel(parcel source) { homecoming new user(source); } public user[] newarray(int size) { homecoming new user[size]; }

facebook - How to share a website on FB by URL -

facebook - How to share a website on FB by URL - i want share website on fb(social button idea), basic button dont want utilize kind of script how can share site on fb clicking on link? yes dont want show popup , not new tab! //example <a href="http://www.facebook.com?share=www.mysite.com">share on facebook</a> you can utilize sharer.php this: https://www.facebook.com/sharer/sharer.php?u=http%3a%2f%2fwww.devils-heaven.com no script or app needed. can invoke share dialog, need app id (see "url redirection"): https://developers.facebook.com/docs/sharing/reference/share-dialog facebook

scala - Meaning of exclamation mark in zipAll(s).takeWhile(!_._2.isEmpty) -

scala - Meaning of exclamation mark in zipAll(s).takeWhile(!_._2.isEmpty) - what explanation mark doing in (!_._2.isempty) ? as in : def startswith[a](s: stream[a]): boolean = zipall(s).takewhile(!_._2.isempty) forall { case (h,h2) => h == h2 } taken stream. is negation ? if yes, why no space required between ! , _ ? is not !_ interpreted method name ? can method names contain or start ! ? it negation. expanding definition replacing _ more verbose name might create more obvious. def startswith[a](s: stream[a]): boolean = zipall(s).takewhile(!_._2.isempty) forall { case (h,h2) => h == h2 } can rewritten def startswith[a](s: stream[a]): boolean = zipall(s).takewhile( element => !element._2.isempty) forall { case (h,h2) => h == h2 } ._2 sec item in tuple, in case looks list pair of items (references later h , h2) rewrite unpacking items pair of values as def startswith[a](s: stream[a]): boolean = zipal

jquery - Test for array containing a single empty string in JavaScript -

jquery - Test for array containing a single empty string in JavaScript - i returning array function in javascript , need able know when contains nil single empty string. when print value console, returns this: [""] i error if following: if(myvar == [""]){ // } how can test value in variable? jquery answers acceptable plain javascript. i use: if( myvar instanceof array && myvar.length === 1 && myvar[0] === '' ) { // .... } javascript jquery arrays json comparison

go - how to keep key case sensitive in request header using golang? -

go - how to keep key case sensitive in request header using golang? - i using golang library "net/http",while add together header info request, found header keys changing, e.g request, _ := &http.newrequest("get", fakeurl, nil) request.header.add("mykey", "myvalue") request.header.add("mykey2", "mynewvalue") request.header.add("dont-change-me","no") however, when fetch http message package, found header key changed this: mykey: myvalue mykey2: mynewvalue dont-change-me: no i using golang 1.3, how maintain key case sensitive or maintain origin looking? thx. the http.header add , set methods canonicalize header name when adding values header map. can sneak around canonicalization adding values using map operations: request.header["mykey"] = []string{"myvalue"} request.header["mykey2"] = []string{"mynewvalue"} request.header["dont-

tomcat - How to provide the arguement -Xshare:off to the java command starting the application -

tomcat - How to provide the arguement -Xshare:off to the java command starting the application - i have application running under tomcat . i want profile application (visualvm ----> cpu sampler), part of when launched visualvm under java bin directory i seeing next message class sharing enabled jvm" warning shown in reddish box in profiler tab under below link , next resolution mentioned https://visualvm.java.net/troubleshooting.html resolution: there known problem dynamic attach used profiling, may cause target jvm crash when class sharing enabled. start application without class sharing, provide -xshare:off argument java command starting application. could please allow me know how resolve . $ export catalina_opts="-xshare:off" $ $catalina_home/bin/catalina.sh start if using microsoft windows service, run catalina_home/bin/tomcatxw.exe (where x tomcat version) , edit launcher arguments include -xshare:off . tomcat visualvm

greendao - How can I persist an HashMap? -

greendao - How can I persist an HashMap<String, String>? - how persist hashmap in greendao , how generate respective entities? i have read documentation twice going forwards , backward nil there. google wasn't of help either. you should create entity string-primary-key , string-proerty value: entity mapentity = schema.addentity("map"); mapentity.addstringproperty("key").primarykey(); mapentity.addstringproperty("value"); maybe other attributes properties needed (depending on needs) unique, notnull. if want store map within entity, that's not quite simple: basically create entity storing maps: entity mapentity = schema.addentity("map"); mapentity.addlongproperty("id").primarykey().autoincrement(); mapentity.addstringproperty("key").unigue().notnull(); mapentity.addstringproperty("value"); and create relation toone() or tomany() reference corresponding map. p.s. maybe

iOS development: interactive graph -

iOS development: interactive graph - please take @ image above. reddish circles represent user's touching motion. if user touched first circle (to left), there should graph that's skewed left. if user touched in middle, distributed graph. if user touches right part, graph should skewed right. i new ios development , wondering how can accomplish such feature. recommendation suitable libraries, frameworks, documents appreciated. ok, let's go through components of 1 @ time. to know user touches, utilize uipangesturerecognizer or uitapgesturerecognizer . to draw curve, mutual technique add together cashapelayer : cashapelayer *shapelayer = [cashapelayer layer]; shapelayer.strokecolor = [uicolor bluecolor].cgcolor; shapelayer.fillcolor = [uicolor clearcolor].cgcolor; shapelayer.linewidth = 4.0; [self.view.layer addsublayer:shapelayer]; you can set path cashapelayer , , every time alter path , curve on view change. if alter path (e.g. utilize u

How to publish an endless JSON stream as a REST service in Java Enterprise 7 -

How to publish an endless JSON stream as a REST service in Java Enterprise 7 - i inquire illustration publish json endless stream through rest service java ee can't find illustration or tutorial. let's need send continuous serie of instances of new object: public class new { public string title; public string content; } how possible? rest java-ee stream

Android ListView arraylist group items of different positions by comparing with second arraylist -

Android ListView arraylist group items of different positions by comparing with second arraylist - i displaying weekly info in listview. current week dates using java calendar class. getting info have display list within arraylist custom objects. bean class : public class samplebean{ string date; string day; string city; ............................ // getters , setters } that array details contains 7 dates, 1 date can @ multiple positions. e.g date 21 oct 2014 @ positions 3,4 , 5. since need show weekly view, have grouping items @ positions same date , display them in single row of listview - " city1, city2, city3" - separated coma. want accomplish comparing arraylist dates calendar custom arraylist info display in listview my listview needs size of 7. array items same dates need grouped together. that, unable grind out logic. looping patterns have been buggy altogether. if give me idea, sample, or link how

c# - Game scripts or other custom code contains OnMouse_ event handlers -

c# - Game scripts or other custom code contains OnMouse_ event handlers - i need little help. maintain getting warning when im building game android. game scripts or other custom code contains onmouse_ event handlers. presence of such handlers might impact performance on handheld devices. unityeditor.hostview:ongui() do know how rid of this? the controller have has mouse event. public class buttononclickcontroller : monobehaviour { void onmouseup() { application.quit(); } } although warning, not ignore it. have unintended effects on game. it mutual on android builds tend test in editor. can prepare adding this: #if unity_editor void onmouseup() { } #endif then add together different code block android. #if unity_android // handle screen touches here. #endif what doing here separating editor code android code. in other words, wouldn't want mouse input on android device. c# android

windows - send messages to users that connected to current computer -

windows - send messages to users that connected to current computer - i need show list of users connected current computer , send each of them message (by using command line). using '*.bat' need list users connected current computer, , send each of them message (by command line). (i presume using 'net send' on site: http://technet.microsoft.com/en-us/library/bb490710.aspx , need know active users, can see on task manager -> users ,column status = active). thanks :) this ancient, andrewmedico says, msg gives functionality in many versions of windows. if reason wanted usernames send them individual messages, can utilize msg * <message> send every user logged pc same message. if wanted usernames purpose, can these command prompt typing query user . grepping of results bare list of users if require (and dont wish utilize other methods of getting these users such c#). windows cmd

Retrieve Custom CSS Property Value with JavaScript - Must not be possible -

Retrieve Custom CSS Property Value with JavaScript - Must not be possible - the goal define custom css property value in external style sheet. fiddle it external css: #mydiv { --mycustomproperty: 'mycustomvalue'; } markup: <html> <div id='mydiv'></div> </html> there nil in css spec says custom properties invalid. however, browser render them invalid, should, in theory, still available window.getcomputedstyle or similar. firebug shows custom property , value in styles pane marked overwritten. following snippet from: http://www.quirksmode.org/dom/getstyles.html javascript: class="snippet-code-js lang-js prettyprint-override"> function getstyle(el,styleprop) { var x = document.getelementbyid(el); if (x.currentstyle) var y = x.currentstyle[styleprop]; else if (window.getcomputedstyle) var y = document.defaultview.getcomputedstyle(x,null).getpropertyvalue(styleprop);

linux - Utility off using an additional file descriptor? -

linux - Utility off using an additional file descriptor? - i know can create file descriptor , redirect output it. but can same thing without file descriptor. when have utilize additional file descriptor. when redirect without using file descriptor, i.e: echo haha > dump.log it's equivalent echo haha 1>dump.log 1 file descriptor standard output. 2 file descriptor standard error, if want redirect error messages coming command, can utilize file descriptor ech lol 2>dump.log these cases need file descriptors. for example, if writing script, contains naturally lot of commands, can utilize redirection many purposes: log commands , execution in log file follow workflow of script log error messages in log file know if there error messages there error messages, or output want ignore, , can 'incinerate' redirecting /dev/null linux

ssl - Gmail smtp Hostname does not match the server certificate -

ssl - Gmail smtp Hostname does not match the server certificate - i'm having error gmail gem while trying send mail, working fine on local, , working fine on heroku, im moving app vps server. error: e = g.compose 'test@gmail.com' subject 'testasea' body 'test' end => #<mail::message:25450040, multipart: false, headers: <from: .......> e.deliver! => openssl::ssl::sslerror: hostname not match server certificate i've added initializer file, without luck: actionmailer::base.smtp_settings = { :enable_starttls_auto => true, :openssl_verify_mode => 'none' # i've tested 0 , false, } i tried monkey path class openssl::ssl::sslsocket.class_eval def post_connection_check(hostname) homecoming true end end with no luck, when receive 535 wrong authentication data , know info ok because can do g.inbox.count :read and returns me right number. i know: the wrong certificate 1 se

java - Cannot resolve symbol 'activityInfo' -

java - Cannot resolve symbol 'activityInfo' - the line "r.activityinfo" returns "error: cannot find symbol variable activityinfo" on compiling public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { log.d("lp1", "created"); super.oncreate(savedinstancestate); final intent mainintent = new intent(intent.action_view, android.net.uri.parse("http://abc")); mainintent.addcategory(intent.category_launcher); final list<resolveinfo> browslist = this.getpackagemanager().queryintentactivities( mainintent, 0); iterator itr = browslist.iterator(); while(itr.hasnext()) { object r = itr.next(); activityinfo s = r.activityinfo; } ... } you declare object r , object class has not fellow member named activityinfo . to prepare this, utilize enhanced loop: for (resolveinfo r : browslist) { activityinf

c# - Static URL with extension not getting routed to respective controller -

c# - Static URL with extension not getting routed to respective controller - i have defined custom route sitemap this routes.maproute( name: "sitemap", url: "sitemap.xml", defaults: new { controller = "seo", action = "sitemap" } ); in scenario when request url domain.com/sitemap.xml should routed seo controller , sitemap action required info dynamically , generate sitemap.xml file , served here every thing working fine , problem when request url sec time not getting routed controller , same old content rendered think iis serving static file can 1 help me in overcome issue c# routing asp.net-mvc-5

java - Activity which implements multiple dialog listeners? -

java - Activity which implements multiple dialog listeners? - i’m getting confused dialog boxes in android , need advice. everything going well. had numerous dialogs beingness created within mainactivity opened via navi drawer. dialogs created using code this: private void exportdialog() { layoutinflater inflater = this.getlayoutinflater(); final view formelementsview = inflater.inflate(r.layout.export_data, null, false); alertdialog msgbox = new alertdialog.builder(this) .setview(formelementsview).settitle("export responses") .seticon(android.r.drawable.ic_menu_share) .setpositivebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { // code... } }) .create(); msgbox.show(); } but started notice problems when device resumed lock screen. switching/pausing/resuming worke

javascript - Marker click event always opens to the last pushed infowindow -

javascript - Marker click event always opens to the last pushed infowindow - i have json object infocentros utilize build map, this: for ( var = 0; < infocentros.length; i++ ) { var centro = infocentros[i]; var lat = centro.cordenadas.lat; var lon = centro.cordenadas.long; if (lat && lon) { c++; latlon = new google.maps.latlng(lat, lon); var moptions = { position: latlon, map: $project.gmap } moptions.icon = theme_uri + '/images/marker.png'; var marker = new google.maps.marker(moptions); $project.mapmarkers.push(marker); google.maps.event.addlistener(marker, 'click', function() { $project.mapinfowindow.setcontent( '<div class="sescam-info-window">' + '<h3>' + centro.nombre + '</h3>' + '<p>' + centro.lugar + '

ios - Sprite kit double tap detection -

ios - Sprite kit double tap detection - i'm using spritekit game, observe single tap , double tap using next code: -(void)touchesended:(nsset *)touches withevent:(uievent *)event { uitouch* touch = [touches anyobject]; if (touch.tapcount == 1){ [self.tapqueue addobject:@1]; nslog(@"touch.tapcount == 1 :)"); } if (touch.tapcount == 2) { [self.tapqueue addobject:@2]; nslog(@"touch.tapcount == 2 :)"); } } -(void)processusertapsforupdate:(nstimeinterval)currenttime { (nsnumber* tapcount in [self.tapqueue copy]) { if ([tapcount unsignedintegervalue] == 1) [self singletap]; if ([tapcount unsignedintegervalue] == 2) [self doubletap]; [self.tapqueue removeobject:tapcount]; } } this code observe single tap when observe double tap observe single tap it. how can difference between single tap , double tap? thanks are saying sing

java - List of Hashmap in one to many relationships -

java - List of Hashmap in one to many relationships - i have 2 tables relationship of one-to-many. need categorize sub-table (many part) categories , display them. example, have part , product table. 1 part have many products, there many products belong specific category , going display them 1 section. want like: @entity public class part { // ... codes here @onetomany(fetch = fetchtype.lazy) private list<hashmap<long, list<product>>> productentities; // ... codes here } any suggestions please? here doing. appreciate if improve solution. @entity public class part { // ... codes here @onetomany(fetch = fetchtype.lazy) private list<product> productentities; @transient private hashmap<long, list<product>> productsmap; public hashmap<long, list<product>> getproductsmap() { if (productentities!= null) { (product product : productentities) {

phpfox - Please tell me what is the file name of this line -

phpfox - Please tell me what is the file name of this line - please tell me path of line. please advice files... phpfox::getlib('module')->setcontroller('photo.view'); phpfox::getlib('module')->setcontroller('photo.view'); syntax used set controller in controller file. photo.view photo - module name view - controller name /module/photo/include/component/controller/view.class.php here file phpfox

Integrate Smarty Site with Drupal site -

Integrate Smarty Site with Drupal site - i working on site on smarty based.the name of site http://example.com i built new folder in root path , installed droupon (which component of drupal buying or creating deal) on folder.the site url http://example.com/coupon now want integrate or merge 2 sites.so when registered user access example.com can access example.com/coupon session user id. but problem. is possible pass info smarty based site ( example.com ) drupal site example.com/coupon ? please help me. i write @ module in drupal looks @ $_session , creates and/or login user @ drupal-site. perhaps rules module can work, need implement rules-hook grab relevant session info input rules component. here few lines of code of work need implement hook_menu aswell register entrypoint integration. //register user $passwd = user_password(); $edit = array( 'name' => $_session['username'], 'pass' => $passwd, 'mail

php - issue with dropping foreign key -

php - issue with dropping foreign key - my foreign key relates own table. produce posts hierarchy. now when seek , drop column in database, gives me error: 1553 - cannot drop index 'post_field_properties_parent_id_index': needed in foreign key constraint this code: public function down() { schema::table( "post_field_properties", function( $table ) { $table->dropforeign('parent_id'); $table->dropcolumn('parent_id'); } ); } the way seem able it, goto phpmyadmin , remove foreign key itself. , drop column. just figured out own project. when dropping foreign key, need concatenate table name , columns in constraint suffix name "_foreign" http://laravel.com/docs/5.1/migrations#foreign-key-constraints public function down() { schema::table( "post_field_properties", function( $table ) { $table->dropforeign('post_field_prop

Java HashMap in methods -

Java HashMap in methods - is possible have method requiring hashmap , able provide hashmap strings keys? kind of generic info type set instead of 'value'? public void example(hashmap<string, value> hashmap) { //stuff } example(new hashmap<string, integer>); hashmap<string, string> examplemap = new hashmap<>(); example(examplemap); alternatively, possible check key/value type of map, other looping through keys/value , check instanceof (without stopping return)? public boolean example(hashmap<string, value> hashmap) { (value value : hashmap.values())) { if (value instanceof string) { homecoming true; //<- unwanted } } } edit: allow me explain problem bit further. have method: public static object geteic(hashmap<string, object> map, string key) { (string keys : map.keyset()) { if (keys.equalsignorecase(key)) { homecoming map.get(keys); } }

java - Counting current users viewing a page -

java - Counting current users viewing a page - i working on counting number of viewing user on page. basically, when user view url localhost:8080/itemdetail.do?itemid=1 , page showing how many users viewing on page @ same time. solution approach when user viewing particular page, page go on send ajax request every 1 sec server, server utilize map<string, map<string, integer>> (both utilize concurrenthashmap initialization) contain itemid (to know page viewed) , ip , timeout count (in inner map ). every time getting request, counting increment 1. there thread fired during request process decrease timeout counting every 2 seconds. if in end, timeout counting equal 0, app consider user stopped viewing page, thread remove entry , number of user decreased 1. little problem approach since timeout number increasing faster decreasing, if user open page long plenty , close page, app take sometime know that user left page, because timeout number @ moment quite bi

c# - 'And' 'Or' Query in ElasticSearch -

c# - 'And' 'Or' Query in ElasticSearch - public class user { public string email { get; set; } public int age { get; set; } public bool active { get; set; } } client.index(new user { email ="test@test.te" }); query in linq c# illustration : rep.where(user=>user.email=="test@test.te" && (user.age>18 || user.active== true)); how create query elasticsearch (i mean same query in elasticsearch)? you can utilize combination of : range filter age field (reference) term filter email , active fields (reference) a bool filter should clauses (equivalent or) combine age , active filters (reference) another bool filter combine previous 1 email filter in must clause (equivalent and) a filtered query able utilize filters defined above. it may useful know differences between query , filters. you should end : { "query": { "filtered": { "filter": {

c# - SaveOrUpdate in NHibernate : id is 0 for relater entities -

c# - SaveOrUpdate in NHibernate : id is 0 for relater entities - i have entity listing , listingforlease (short version) public class listing: entity{//some properties} public class listingforlease: listing { public listingforlease() { listingspaces = new hashedset<listingspace>(); } public virtual iset<listingspace> listingspaces { get; set; } } and entity listingspace : public class listingspace : entity { public listingspace(){ } public virtual listingforlease listingforlease{ get; set; } public virtual string name { get; set; } public virtual double size { get; set; } } entity sharparch architectural foundation, gives own entities field id . for mapping database used nhibernate. listing mapping : <class name="listing" table="bt_listing" > <id name="id" column="id"> <generator class="native"/> </id> <!

android - Assert that ActionBar item becomes visible after CAB is dismissed -

android - Assert that ActionBar item becomes visible after CAB is dismissed - i have next 2 tests shown: public void testonclickcheckboxstartactionmode() { int index = 4; this.solo.clickoncheckbox(index); assert.asserttrue(this.solo.waitforview(r.id.delete_menu)); } public void testonclickcheckboxstopactionmode() { this.testonclickcheckboxstartactionmode(); int index = 4; this.solo.clickoncheckbox(index); view addmenu = this.activity.findviewbyid(r.id.add_menu); assert.assertnotnull(addmenu); assert.asserttrue(addmenu.isshown()); } the first checks actionmode correctly started when item in listview checked. sec checks actionmode stops after unchecking listview item. problem testonclickcheckboxstopactionmode() fails on line assert.asserttrue(addmenu.isshown()); . can manually verify right behavior in app, test seems broken. believe problem assertion occurs before ui thread has chance remove cab , restore regular actionbar. i have tr

c++ - GLM SIMD implementation of LookAt -

c++ - GLM SIMD implementation of LookAt - i've problem using glm math lib simd. i've encounter problem during calculation of lookat matrix. follow lookat functions: force_inline_alwaysinline const glm::detail::fmat4x4simd lookat( const glm::detail::fvec4simd &eyepos, const glm::detail::fvec4simd &lookatpos, const glm::detail::fvec4simd &upvec ) { glm::detail::fvec4simd v3x, v3y, v3z; v3y = glm::normalize(upvec); v3z = glm::normalize(eyepos - lookatpos); v3x = glm::normalize(glm::cross(v3y, v3z)); v3y = glm::cross(v3z, v3x); glm::detail::fmat4x4simd m4eyeframe = glm::detail::fmat4x4simd(v3x, v3y, v3z, eyepos); homecoming m4eyeframe; } unfortunately doesn't work well, example: if eyepos (the photographic camera position) in 0,0,-10 , lookatpos (target position) in 0,0,0 , object @ position, view work well. if move eyepos on x or y axis, model seems deformed (like stretched) or disappears if had gone outside of frustum

c# - Is there another solution to WebResponse 403 error? -

c# - Is there another solution to WebResponse 403 error? - there many posts on webresponse 403 error situation little different. have created console application run task on server. console application passes user emails in webrequest , waits webresponse receive uri returning parameters. code below worked few days ago 1 of other programmers added new parameter homecoming web address. know fact causing 403 error because if paste uri in ie new parameter works. since have console application homecoming web address cannot do, @ to the lowest degree don't think so. unfortunately programmer said cannot alter , said there way receive uri or entire page content , can process way. still have no clue talking because streamreader requires webresponse , pretty much other solutions think of. even though 403 error response still has uri parameters need because can see in ie in web address. need response uri. appreciate help have offer. below method giving me problems. string empl

ios - How can i design a list of images in PSCollectionView with different Heights? -

ios - How can i design a list of images in PSCollectionView with different Heights? - iam new ios development.i confused design screen attached here. please help me if know how design this.iam not yet started design screen. thanks in advance....![design screen][1] this waterfallcollectionview sample code per requirement ios

python - django REST framework multi source field -

python - django REST framework multi source field - let's have these in models.py : #models.py class theme(models.model): """an theme asset of multiple levels.""" adventure = models.foreignkey(adventure) offset = models.positivesmallintegerfield() finished = models.booleanfield(default=false) class level(models.model): """abstract level representation""" theme = models.foreignkey(theme) offset = models.positivesmallintegerfield() finished = models.booleanfield(default=false) class meta: abstract = true class puzzlelevel(level): """a level puzzle game""" points = models.charfield(max_length=200) image = models.imagefield() class imageandwordlevel(level): """a level imageandword game""" word = models.charfield(max_length=30) image = models.imagefield() and want utilize theme in a

c# - Save data in 2d dictionary? -

c# - Save data in 2d dictionary? - what fastest way store info dictionary<string, int[][]> , dictionary<int, dictionary<string, string> file, later can imported , converted variables? currently, utilize code (this dictionary<string, int[][]> ): string savestring = ""; int = 0; foreach (keyvaluepair<string, int[][]> entry in data) { if (i > 0) savestring += "|"; savestring += entry.key + ":"; int j = 0; foreach (int[] x in entry.value) { if (j > 0) savestring += ";"; int k = 0; foreach (int y in x) { if (k > 0) savestring += ","; savestring += y; k++; } j++; }

Amazon S3 static index.html not changing to homepage -

Amazon S3 static index.html not changing to homepage - i'm uploading new home page / index.html amazon s3. home page not changing new page - still displaying original simple 'hello world' page. i deleted old index.html , uploaded new index.html no luck. endpoint page working correctly. have created alias in route 53. i've made dns changes , think have in place, need switch setting - setting? amazon-web-services amazon-s3

wysiwyg mindmup text editor : how to get the formatted text on server side? -

wysiwyg mindmup text editor : how to get the formatted text on server side? - hello learning bootstrap , have wysiwyg editor. found bootstrap-wysiwyg , want utilize it. http://mindmup.github.io/bootstrap-wysiwyg/ this illustration in website official use <div id="editor"> </div> not use <input type="text" name="editor"> or <textarea name="editor"> </textarea> however, cannot figure out how formatted text on server-side when form submitted. text editor wysiwyg server-side server

c++ - Is it good practice to lock a pthread mutex before destroying it? -

c++ - Is it good practice to lock a pthread mutex before destroying it? - this question has reply here: lock mutex of object before destroy deallocate memory or other unexpected 2 answers class aaa { ... ~aaa() { pthread_mutex_lock( &m_mutex ); pthread_mutex_destroy( &m_mutex ); } } question> saw code somewhere in project. practice so? or undefined behavior lock mutex before destroying it? it strikes me utterly terrible practice. from http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_destroy.html it shall safe destroy initialized mutex unlocked. attempting destroy locked mutex results in undefined behavior. so code guarantees undefined behavior , needs fixed. c++ pthreads

html - How can I convert the string "Hello this is world" to "world is this Hello" in CSS? -

html - How can I convert the string "Hello this is world" to "world is this Hello" in CSS? - how can reverse string "hello world jack" "jack world hello" using css? for example: hello world jack i wondering how convert using css jack world hello assuming each word in different html element, can use class="lang-css prettyprint-override"> display: flex; flex-direction: row-reverse; justify-content: flex-end; class="snippet-code-css lang-css prettyprint-override"> .wrapper { display: flex; } .reversed { flex-direction: row-reverse; justify-content: flex-end; } .wrapper > * { margin: 0 .1em; } class="snippet-code-html lang-html prettyprint-override"> <div class="wrapper reversed"> <span>hello</span> <span>world</span> <span>this</span> <span>is</span> <span>jack</span&

java - DetailedJMSSecurityException while trying to access queue in IBM MQ -

java - DetailedJMSSecurityException while trying to access queue in IBM MQ - here problem. i using trial version of ibm mq v7.1 . have created queue manager myqm , channel my_svrconn mca user id abc . have provided user abc access myqm . trying set message queue q1 . while getting queue connection getting below exception. com.ibm.msg.client.jms.detailedjmssecurityexception: jmswmq2013: security authentication not valid supplied queuemanager 'myqm' connection mode 'client' , host name '(1500)'. please check if supplied username , password right on queuemanager connecting. i have used below command allow user abc access myqm . [mqm@localhost ~]$ setmqaut -m myqm -t qmgr -p abc +connect setmqaut command completed successfully. here java program public class mqput { public static void main(string[] args) { sendmsg("sample message"); } public static void sendmsg(string msg) { mqqueueconn

c++ - How to add a Node pointer to a Vector pointer? -

c++ - How to add a Node pointer to a Vector pointer? - i trying create maze consists of nodes objects. each node object has fellow member variable node *attachednodes[4] contains of attached nodes later tell programme options has when doing breadth first search. every time think understand pointers, issue comes up, , sense lost on again. since working fine (as far knew) until changed thought unrelated. anyways, here issues are: my node object looks this class node { public: ... void attachnewnode(node *newnode, int index); ... private: ... node *attachednodes[4]; ... }; my function attach nodes looks this: void node::attachnewnode(node *newnode, int index) { *attachednodes[index] = *newnode; } and lastly, part of other function calling attachnewnode function looks this: int mazeindex = 0; while (instream.peek() != eof) { int count = 0; node n; node m; ... if (system::isnode(name2)) { m = system:

sql - Derived table with an index -

sql - Derived table with an index - please see tsql below: declare @testtable table (reference int identity, testfield varchar(10), primary key (reference)) insert @testtable values ('ian') select * @testtable testtable inner bring together livetable on livetable.reference=testtable.reference is possible create index on @test.testfield ? next webpage suggests not. however, read on webpage possible. i know create physical table instead (for @testtable). however, want see if can derived table first. you can create index on table variable described in top voted reply on question: sql server : creating index on table variable sample syntax post: declare @temptable table ( [id] [int] not null primary key, [name] [nvarchar] (255) collate database_default null, unique nonclustered ([name], [id]) ) alternately, may want consider using temp table, persist during scope of current operatio

c++ - triangular distribution for creating four momentum vector -

c++ - triangular distribution for creating four momentum vector - in problem create base of operations class represent 4 vector (a concept in physics involving 4 dimensional vector) create derived class represent 4 momentum of particle inherits base of operations class. have been supplied little piece of code utilize generate 'random' x y , z component of momentum magnitude. code follows #include <cstdlib> double triangular(double momentum){ double x, y; do{ x = momentum*rand()/rand_max; y = x/momentum; } while (1.0*rand()/rand_max > y); homecoming x; } it said in problem code supposed generate magnitude, , randomly split x, y , z components. code returns single value , cannot see how doing says in problem. help me understand code doing , how used create 3 components of momentum magnitude. give thanks kindly. c++ random triangular

javascript - add mousewheel eventlistener error -

javascript - add mousewheel eventlistener error - here problem : i have function, should homecoming nothing... called : function zoom(event){ alert("wheel delta : "+event.wheeldelta); homecoming false; } on click on element, seek add together event listener on mousewheel way : element.addeventlistener("mousewheel",zoom,false); element svg tag. but, function zoom never called, message : typeerror: argument 2 of eventtarget.addeventlistener not object. what doing wrong? thanks help :) edit : here whole code : function zoommain(){ var zoom = 0; var main; var clicks = 0; this.click = function(event,svg){ if(svg){ switch(clicks%2){ case 0 : main = svg; main.addeventlistener("mousewheel",zoom,false); clicks++; break; case 1 : main.removeeventlistener("mousewheel",zoom,false); clicks+

How do I get the last part of an ip address string in PHP -

How do I get the last part of an ip address string in PHP - if have ip such as: 195.123.321.456 how 456 variable? this should work you: <?php $ip = "195.123.321.456"; $split = explode(".", $ip); echo $split[3]; ?> output: 456 php

sql - How to create a query condition to bring all names that start with J -

sql - How to create a query condition to bring all names that start with J - my code, dont know how set status name bring names start j select name, cellphone employee experiencelevel = “master” , name select name, cellphone employee experiencelevel = “master” , name 'j%' sql

c# - Config files shared between projects -

c# - Config files shared between projects - i'm starting new web based project may distributing people install themselves. usually set db credentials in webconfig/static class. however, time i'm going setting shared project houses datalayer, web form, win form etc hitting it. what's best way me db connections datalayer has credentials in rather whatever project accesses it. kicker people have installed app can change? c# visual-studio-2012

uitableview - subclassed uitableviewcell subview color -

uitableview - subclassed uitableviewcell subview color - i got unusual issue (in opinion;)) considering subclass of uitableview cell. code subclass is: class subleveltablecell: uitableviewcell { var sublevellabel:uilabel var sublevelback:uiview var sublevelscore:uiimageview override init(style: uitableviewcellstyle, reuseidentifier: string!) { self.sublevelback = uiview() self.sublevellabel = uilabel() self.sublevelscore = uiimageview() super.init(style: uitableviewcellstyle.value1, reuseidentifier: reuseidentifier) self.sublevellabel.textcolor = whitecolor self.sublevellabel.font = uifont(name: sublevellabel.font.fontname, size: 20) self.addsubview(self.sublevelback) self.sublevelback.addsubview(self.sublevellabel) self.sublevelback.addsubview(self.sublevelscore) } required init(coder adecoder: nscoder) { fatalerror("init(coder:) has not been implemented"

How to test same object instance in Javascript? -

How to test same object instance in Javascript? - say have next objects in javascript: var = { xxx: 33 }; var b = { xxx: 33 }; var c; c = a; what javascript test tell me whether dealing same object instance? in other words, should homecoming false , b, b , c, true , c. you need this if(c == a) { // same instance } a == b , b == c homecoming false javascript instance

javascript - Ajax not making function call to php function -

javascript - Ajax not making function call to php function - i have ajax function in script as: $.ajax({ url: 'http://www.somesitename.com/admin/exporttocsvaction', type: 'get', data:{}, cache: false, success: function() { alert("sucess"); }, error: function () { alert("error"); } }); exporttocsvaction function in php as: public function exporttocsvaction() { $exportbatch = 10; $order = $this->gettablegateway('order'); $select = new select(); $select->from('order'); $data = $order->selectwith($select)->toarray(); $batchdir = __dir__ . '/../../../../../data/export/batch/' . $exportbatch; mkdir($batchdir); $filenamewithfilepath=$batchdir . '/order2.csv'; if (file_exists($filenamewithfilepath)) { $this->downloadordercsvaction($filenamewithfilepath); }

html - Bootstrap :before :after { content: " " } bug -

html - Bootstrap :before :after { content: " " } bug - there problem bootstrap code. here cutting bootstrap source: .modal-footer:after { display: table; content: " "; } this kind of browser hack, problem adds 1px white line left of contents , right. line appears on chrome , caused content: " "; have suggestions how remove line, can't show html it's simple div, , problem described in bootstrap code. is possible somehow create content: " " invisible? because empty line creates 1px white line. html css twitter-bootstrap