Posts

Showing posts from January, 2013

visual studio - Web Forms Project Consuming Web Api 2 Project in debug mode -

in solution, creating new web api 2 project migrate services in web forms project. my question is: is there way (best way) use new web api project in web forms project when debugging? actually have start web api (without debbuging), after, able start web forms , use web api. unproductive. i have tried make works pre-build event, not know if did wrong. ps.: not need both projects running in debug mode.

javascript - Use RequireJS to include a class defined using ES6 syntax -

i have existing project (which run in browser, no server-side component) uses requirejs manage dependencies. way i'd been defining "classes" (including inheritance) this: define([ 'jquery', 'classes/someparentclass', ], function($, someparentclass){ function thisclass(data){ someparentclass.call(this, data); this.init = function(data){ //do stuff } this.init(data); } thisclass.prototype = object.create(someparentclass.prototype); thisclass.prototype.constructor = thisclass; return thisclass; }); and when wanted include in other class i'd use standard requirejs define/require syntax: define(['classes/thisclass'], function(thisclass){ var fooinstance = new thisclass(foodata); }); i wanted try hand @ "class" syntax in es6, set converting 1 of existing classes (i started "static" class simplicity). looks this: define([ 'jquer

android - MediaStore.Images.Media.insertImage() error -

i have 2 devices same android version (4.4.2). problem when call method insertimage(getcontentresolver(),bitmap, "", ""), on 1 have error , other works planned e/mediastore: failed insert image java.io.filenotfoundexception: no entry content://media/external/images/media/3865 @ android.database.databaseutils.readexceptionwithfilenotfoundexceptionfromparcel(databaseutils.java:189) @ android.content.contentproviderproxy.openassetfile(contentprovidernative.java:646) @ android.content.contentresolver.openassetfiledescriptor(contentresolver.java:939) @ android.content.contentresolver.openoutputstream(contentresolver.java:686) @ android.content.contentresolver.openou

Struts2 Bean Validation -

i setting stuts2 app using hibernate bean validation validate form fields on login page. have added necessary plugins , dependencies , configured struts.xml include custom stack calls beanvalidation interceptor. /logon path excluded authinterceptor . unfortunately, when form fields email , password populated, return message blank. can see in debugger email , password being set in loginaction class it's if beanvalidation doesn't have information. if switch order of interceptors have beanvalidation last, never called. <?xml version="1.0" encoding="utf-8"?> <!doctype struts public "-//apache software foundation//dtd struts configuration 2.0//en" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devmode" value="false" /> <constant name="struts.action.extension" value="," /> <constant name="struts.custom.i18n.

excel - VBA: Trying to consolidate all worksheets into one new worksheet in single workbook -

i trying copy worksheets, 1 @ time, , pasting new worksheet. these files come multiple third parties worksheets can vary. i'm running problem below when trying determine last row lrow , last column lcol because error appears saying object doesn't support property or method . plan on submitting work error proofing or general macro tips appreciated. sub ws_copy() dim lrow long dim lcol long dim pasterow long dim wscount integer dim integer 'on error resume next 'application.displayalerts = false = application.inputbox(prompt:="enter place order of first tab copied.", title:="worksheet consolidation", type:=1) if isempty(i) = true exit sub else if isnumeric(i) = false msgbox "enter numeric value." else if isnumeric(i) = true worksheets.add(before:=sheets(1)).name = "upload" wscount = worksheets.count = + 1 wscount lrow = worksheets(

android - signed apk Parse error when parsing manifest -

when try install signed apk parse error (see logcat). when install apk signed default debug key okay. this logcat output: 08-28 17:12:47.267 23828-23828/com.android.packageinstaller w/packageinstaller: parse error when parsing manifest. discontinuing installation 08-28 17:12:47.267 23828-23828/com.android.packageinstaller w/packageparser: skipping dir: /mnt/shell/emulated/0/vertretungsplan-2.0.0.apk 08-28 17:12:47.287 23828-23828/com.android.packageinstaller d/dalvikvm: gc_for_alloc freed 1414k, 62% free 4110k/10772k, paused 16ms, total 16ms 08-28 17:12:47.287 23828-23828/com.android.packageinstaller i/dalvikvm-heap: grow heap (frag case) 5.708mb 1127536-byte allocation as says parse error when parsing manifest here manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.mayerhofersimon.vertretungsplan" android:versioncode="

java - how to parse some specific nodes of xml using sax or dom based on given condition -

i new jaxp , stuck have parse xml using either sax or dom. have ask user enter empoyee code , display other nodes of particular employee for ex :if user enters 101 show ename:akshay ecode:101 dp no.:10 mgr code=201 i tried alot no results,can help. <employees> <employee> <ename>akshay</ename> <ecode>101</ecode> <empsal>2100.0</empsal> <department_code>10</department_code> <manager_code>201</manager_code> </employee> <employee> <ename>rahul</ename> <ecode>102</ecode> <empsal>21000.0</empsal> <department_code>20</department_code> <manager_code>202</manager_code> </employee> </employees> the code tried parse xml public class parseusingdom { public static void main(string[] args) { try { documentbui

Uninitialized constant Game::World when I try and initialize the World class in Ruby -

so i'm trying create basic text adventure in ruby, , i'm following tutorial ( https://jsrn.gitbooks.io/make-your-first-text-adventure-in-ruby/content/creating_the_framework.html ) but when try , run code error: gamebase.rb:10:in `initialize': uninitialized constant game::world (nameerror) gamebase.rb:55:in `new' gamebase.rb:55:in `<main>' this code: from gamebase.rb dir["gamedir/**.*"].each { |file| require_relative file } class game actions = [ :forward, :backward, :look, :attack, :loot, :inventory, :use, :cast ] def initialize @world = world.new @player = player.new start_game end private def start_game while @player.alive? @current_room = @world.get_room_of(@player) print_player_status action = take_player_input next unless actions.include? action take_action(action) end end def take_player_input print "what do?" gets.chomp.to_sym end def take_action(action) case action when

ios - Change the alertBody of a repeating local notification -

is possible have repeating local notification different alertbody each time? if not, how implement such functionality? code (edit) let notification = uilocalnotification() notification.firedate = nsdate(timeintervalsincenow: 60) // randomitem extension in code. notification.alertbody = self.athkar.randomitem() notification.soundname = uilocalnotificationdefaultsoundname notification.repeatinterval = nscalendarunit.minute uiapplication.sharedapplication().schedulelocalnotification(notification)

r - Attaching object without using attach() or with() -

this may appear strange request, i'm looking attach object temporarily individual elements can extracted said object, without using attach() or with() . instance, i'm aware these 2 approaches fine index data.frame elements name" obj <- data.frame(n=2, sd=1) myfun <- function(obj){ n2 <- obj$n^2 rnorm(n2, obj$sd) } myfun(obj) myfun2 <- function(obj){ with(obj, { n2 <- n^2 rnorm(n2, sd) }) } myfun2(obj) however, want more general, form can # wanted myfun3 <- function(){ n2 <- n^2 rnorm(n2, sd) } with(obj, myfun3()) #this idea doesn't work so explicitly indexing elements of obj not required, , wrapping whole statement in with() function can avoided. myfun3() doesn't locate internals of obj , to. following works fine , want functional standpoint, far kosher: attach(obj) myfun3() detach(obj) attaching considered bad, , purpose code has work within r package, attach() isn't allowed (

c# - Entity Framework 6 inserts null as primary key while inserting nested identifying relationships -

i have 4 entities defined using ef6 code first: public class item1 { [key] [stringlength(50)] public string name { get; set; } } public partial class item2 { [key] [column(order = 0)] [stringlength(50)] public string item1name { get; set; } [key] [column(order = 1)] [stringlength(50)] public string name { get; set; } } public partial class item3 { [key] [column(order = 0)] [stringlength(50)] public string item1name { get; set; } [key] [column(order = 1)] [stringlength(50)] public string item2name{ get; set; } [key] [column(order = 2)] [stringlength(50)] public string name { get; set; } } public partial class item4 { [key] [column(order = 0)] [stringlength(50)] public string item1name { get; set; } [key] [column(order = 1)] [stringlength(50)] public string item2name{ get; set; } [key] [column(order = 2)] [stringlength(50)] public strin

c# - Given bounding rectangle, starting angle, and sweep angle, how to determine points of the arc endpoints -

Image
given bounding rectangle, starting angle , sweep angle, how determine points of each end of arc? private void mypaint(object sender, painteventargs e) { graphics g = e.graphics; rectangle rc = new rectangle(242, 299, 200, 300); pen penred = new pen(color.red, 1); g.drawarc(penred, rc, 18, -108); // todo - determine point of each end of arc // point pt1 = ??? // point pt2 = ??? } using equation of ellipse excellent mathematics answer can calculate start , end points of ellipse, given start angle , sweep. first, need center of bounding box, know how shift coordinates. that's simply rectangle rc = new rectangle(242, 299, 200, 300); int cx = (rc.left + rc.right) / 2; int cy = (rc.bottom + rc.top) / 2; // debugging purposes, let's mark point. g.fillrectangle(brushes.yellow, rectangle.fromltrb(cx - 3, cy - 3, cx + 3, cy + 3)); we need convert angles degrees radians, , change clockwise angle counter-clockwise angle

android - Retrieving an Image from parse.com in a List View using an Array Adapter -

i have searched throughout answer none answer question. have data stored on parse.com. trying retrieve image , string , place in list view. have adapter have been using grab text unsure how image. there 1 line in particular need with. public class appetizeradapter extends arrayadapter { protected context mcontext; protected list mappetizer; public appetizeradapter(context context, list appetizer) { super(context, r.layout.custom_appetizers, appetizer); mcontext = context; mappetizer = appetizer; } // inflates each row of app @override public view getview(final int position, view convertview, viewgroup parent) { // initialize view holder viewholder holder; if (convertview == null) { // if no items in view displayed convertview = layoutinflater.from(mcontext).inflate( r.layout.custom_appetizers, null); // initialize views holder = new viewholder(); // creates new view holder.appetizer = (textview) con

c - The value of the output for my double variable is not correct on the Arduino Uno -

i use code test if output displayed correctly when print double variable: double t = (0.8*0.8*(10^5)*599*(10^-6)*1388.888889)/(287*(25+273)*14.7*3*(10^-3)*4); serial.println(t); but output on serial port 4.03 instead of 3.52 i using arduino uno , arduino c language. what problems code? how solve problem in c,c++,javascript,java: number 10^5 has represented in program 1e5 and number 10^-6 1e-6 the use of '^' forces program perform bit wise operation 10^5 = (10)^(5) see: https://msdn.microsoft.com/en-us/library/3akey979.aspx solution change double t = (0.8*0.8*(10^5)*599*(10^-6)*1388.888889)/(287*(25+273)*14.7*3*(10^-3)*4); to: double t = (0.8*0.8*(1e5)*599*(1e-6)*1388.888889)/(287*(25+273)*14.7*3*(1e-3)*4); now correct result: t = 3.5292104651726235 the int on arduino has limited range: 32767 -32768. long 2147483647 -2147483648 avoid mixing int , double avoid rounding error. use double or can use cast: double d = (doub

android - individually assign buttons variables to a 2d array -

i want assign button values 2-d array. how it? `int[][] m =new int[5][5]; m[0][0]= button b1; m[0][1]= button b2; m[0][2]= button b3; m[0][3]= button b4; m[0][4]= button b5; assume, button value mean button text , int datatypes how can this. m[0][0] = integer.parseint(button1.gettext().tostring()); m[0][1] = integer.parseint(button2.gettext().tostring());

tfs2012 - TFS 2012 security - allow users to edit status of work items -

Image
my organization wants use tfs track user sign-off of work items changing work item status. first user asked view work item in tfs being prevented viewing work item. how set permissions him view , edit work item status? i suggest access web portal of project, select security section ensure user have permission, exist in contributors group contains permission. (best practise set contributor group members team)

c - Compiler dependency in right shift operator on signed types: -

in following code, #include <stdio.h> #include<conio.h> main() { int y=-01; y<<=3; printf("%d\n",y); y>>=3; printf("%d",y); getch(); } i read in book while using right shift operator on y, signed bit may or may not preserved depending on compiler. why that? concept behind this? please elaborate. some processors have "unsigned" right shift (fills sign bit 0's) or signed right shift (fills size bit copies of current sign bit). since processors have 1 or other, not both, standard doesn't try mandate 1 behavior or other. for it's worth, many (most?) current processors have instructions both. example, x86 includes both shr (logical shift right -- fills 0's) , sar (arithmetic shift right -- fills copies of sign bit).

android - Convert GWT web game to support mobile browsers -

i have web game built in gwt. struggling make mobile-friendly. support multiple screen sizes desktop, used transform: scale(*) css property, doesn't seem apply mobile browsers. guidelines/tips how tackle this? http://www.poker-fighter.com/pokerfighter.html there not gwt-specific responsive design. of techniques same html/css/js frameworks. (nb: should never use scale() way fit screen size.) what gwt, however, ability create different layouts different screen sizes, , create separate permutations phones , tablets/desktop instead of using media query break points or other techniques bloat code or css files. to accomplish that, typically, create abstract view implementation (i.e. gameboardviewimpl) includes code , ui references common form factors, , extend abstract view implementation create form-factor-specific implementations, e.g. gameboardviewimpldesktop , gameboardviewimplphone. approach not creates smaller , more efficient code, creates code easier develop ,

java - unceraintity with arrayList storing -

public void openfile(){ try { l = new formatter("try.txt"); system.out.println("opened file"); } catch (exception e){ system.out.println("did not open file"); } } public void addrecord(){ l.format("%s", namefield.gettext()); system.out.println("added name" + " " + namefield.gettext()); } public void onclose(){ l.close(); } /* trying store user data, have gui , anytime click sign want store namefield in array list, possible anytime close , reopen program , else puts in name adds array list instead of overriding earlier person put in? example in gui type in mike name, close , reopen , put in john name, add mike , john or john? , how make them co-exist? thank it reads file, everytime close program , run again replaces whatever on first line. with list (of arraylist 1 implementation) can use add method. e

java - Getting "No services have been found." error -

i'm new maven, spring , cxf , trying small 'hello world' thing going have rest service available use. i've spent day on , still i'm getting dreaded "no services have been found." error when run project on tomcat inside eclipse. below i've posted important code few files. i'm hoping can tell me i'm doing wrong: web.xml: <web-app> <display-name>archetype created web application</display-name> <context-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/beans.xml</param-value> </context-param> <servlet> <servlet-name>cxfservlet</servlet-name> <display-name>cxf servlet</display-name> <servlet-class>org.apache.cxf.transport.servlet.cxfservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>cxfservlet</servlet-name>

jquery - Changing font size with JavaScript -

i'm trying change font size of letters "se habla espanol". i'm relatively new javascript. , during process of me playing website got following problem. this have: <body> <font color="yellow"> <script> function blinker() { $('.blinking').fadeout(500); $('.blinking').fadein(500); } setinterval(blinker, 1000); </script> <center> <p class="blinking">se habla espanol</p> </center> </font> </body> i thinking of using following code seems responsive html , not javascript <font size="+2">this bigger text.</font> this had in mind work not accurate , taken internet --this attempted didn't work: <center> <font size="+2"> <p class="blinking">se habla espanol</p> </font> </center> if using jquery why not use selector css $('.blinking').css('font-size'

c - confusion while understanding parameters of main -

while understanding parameters of main function i.e, int argc, char* argv[] i wrote piece of code understand these parameters. #include <stdio.h> int main(int argc,char*argv[]) { printf("test\n"); printf("%d %c",argc,*argv[argc-1]); return 0; } this prints test 1 f here don't understand why there f output. mean how executed result in output f ? i read these perameters , main function @ here , here . still don't understand how these works. please explain . edit: mentioned in comments if change code printf("%d %s",argc,argv[argc-1]); now i'm getting whole path of file f:\file path so mean argv[0] location of file in drive? it not defined in c standard, on unix argv[0] name of executable. argv[1] first argument, etc. think true, of time, on microsoft's dos , windowing oses.

javascript - move clip area to center of canvas, Fabric js -

i created clipped area in canvas using fabricjs, here clipped area have created, var canvasdefaultwidth = 350; var canvasdefaultheight = 180; var targetcanvas = document.getelementbyid('canvas'); canvas = new fabric.canvas(targetcanvas); canvas.setwidth(canvasdefaultwidth); canvas.setheight(canvasdefaultheight); canvas.backgroundcolor = '#fff'; canvas.clipto = function(ctx) { ctx.beginpath(); var rect = new fabric.rect({ fill: '#fff', opacity: 1, left: 35, top: 15, width: 280, height: 150, }); rect.render(ctx); } canvas.controlsaboveoverlay = true; var text = new fabric.itext('lorem ipsum dolla'); canvas.add(text); canvas.renderall(); html{background:#cfcfcf} canvas{ border: 1px solid #000; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/

javascript - Using data-attr to identify an active selection -

Image
i'll try keep @ simple can. i have json object pulled via ajax. displaying list of icons in main div data dynamically can toggled on or off. i have secondary div selected items appearing, while main div icon receives class of active . i want end user able remove of them clicking on them on either main div or secondary div . most of working, i'm having trouble figuring out best way map them have 2 separate click events can control same outcome. i think may have fact i'm dynamically creating elements... create more elements... have alter initial elements. my structure far map current selection inside of array . gives me control on keeping code-based list of selected (there more data in example i'll providing). so, here how have far: html: <div id="options"></div> <div id="selectedoptions"></div> javascript/jquery: // simple simulated ajax data var ourdata = { "color1": "yellow&qu

laravel - Display error when i try to composer install -

have 1 laravel5.0 project want run project in local system when run command cmd "composer install" time cmd display following error message c:\xampp\htdocs\laravel5>composer install > php artisan clear-compiled warning: require(c:\xampp\htdocs\laravel5\bootstrap/../vendor/autoload.php): fai led open stream: no such file or directory in c:\xampp\htdocs\laravel5\bootstrap\autoload.php on line 17 fatal error: require(): failed opening required 'c:\xampp\htdocs\laravel5\bootstrap/../vendor/autoload.php' (include_path='.;c:\xampp\php\pear') in c:\xampp\htd ocs\laravel5\bootstrap\autoload.php on line 17 script php artisan clear-compiled handling pre-update-cmd event returned error [runtimeexception] error output: install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore

Adding a facebook page tab using Facebook PHP SDK v5 -

i have created facebook application. using php code adding tab in facebook page. , want change 'secure page tab url' tab on same app don't know how it! example: tab -> secure page tab url / tab b -> secure page tab url b does 1 have idea this? thanks! you can have 1 secure page tab url per app. if want show different content on different pages, have parse signed_request post parameter page id - , show different content depending on id. more information: https://developers.facebook.com/docs/games/gamesonfacebook/login#parsingsr btw, not possible add 1 app several times 1 page, in case that´s want achieve.

c# - tessnet2 language file or training -

i'm pretty new tessnet2. i'm using tessnet2 because i'm using ocr in c# language. add tessnet_32.dll reference make ocr works. however, faced issue. since tessnet2 tesseract2.0, can't use language file in tesseract github. therefore question : 1) possible can extract lang.traineddata , 8 files can used in tessnet2? 2) if not, can please explain me how train data add new language? (such korean or japanese)? know https://github.com/tesseract-ocr/tesseract/wiki/trainingtesseract2 has steps. when use command line, don't anything. in other words, i'm stuck in making box. if can explain me how train data installing tesseract 2.0, great. thank helping me.

python - How to filter price range for products in django? -

i trying filter products list price specified user(min , max price).i have 2 input box taking price range.'price' 1 of column in database table.i getting error int() argument must string or number, not 'dict'.i have include template file , small part of views file. models.py, class add_prod(models.model): book = models.charfield("book name",max_length=40) author = models.charfield("author",max_length=30) price = models.positiveintegerfield("price") image = models.imagefield(upload_to='images',null=true) cat = models.foreignkey(add_cat,on_delete=models.protect) def __unicode__(self): return "%s" % (self.cat) my template file, <p>price</p> <input type="text" name="min_price" maxlength="4" size="3" > <input type="text" name="max_price" maxlength="4" size="3"> <input type=&quo

android - How to update a textview of a listItem based on the current time and the event start time -

i new android. i'm creating contest app in have listview contains status of event. whether started or not. should updated automatically when current time exceeds event start time. i'm using asynctask not accurate. @override public view getview(final int position, view view, viewgroup parent) { layoutinflater scheduleinflater = layoutinflater.from(getcontext()); final holder h; if(view == null){ view = scheduleinflater.inflate(r.layout.custom_list , parent , false); h = new holder(); h.eventname=(textview) view.findviewbyid(r.id.eventnamecustomlist); h.eventstatus=(textview) view.findviewbyid(r.id.eventstatus); h.lefttime = (textview) view.findviewbyid(r.id.lefttime); h.righttime= (textview) view.findviewbyid(r.id.righttime); view.settag(h); }else{ h = (holder) view.gettag(); } final data d = getitem(position); h.eventname.settext(d.geteventname()); date startdate= d.ge

javascript - Get a div offset for one page site -

here have used bootstrap fixed navigation. i have section <section id="count" class="count-section"> // here code </section> i trying apply animation, if user scroll , see on portion. here trying make measure offset. have tried below code $(window).scroll(function() { var pos = $('#count').offset().top; console.log(pos); } after reload page got value 1539.5333404541016 after scroll page value 1539.5333251953125 . how can measure position top fixed navigation ? something might work: $(window).scroll(function() { var pos = $('#count').offset().top - $(document).scrolltop(); console.log(pos); }); take @ $(window).height() , $(document).scrolltop() .

invalid literal for int() in Ansible -

when run code below, there error. why happen? can value {{ ssh.port }} or {{ ssh.port|int }} , when replace {{ ssh.port|int }} 10022 , works. $ ansible-playbook -i staging site.yml error! unexpected exception: invalid literal int() base 10: '{{ssh.port|int}}' # staging [webservers] ip_address [all:vars] env=staging # site.yml - include: webservers.yml # webservers.yml - hosts: webservers remote_user: deploy port: "{{ssh.port|int}}" become: true gather_facts: false vars_files: - group_vars/credentials/{{ env }} roles: - common # group_vars/all.yml ssh: port: 10022 ansible: 2.1.0.0, mac: 10.11.5 this possible bug. error occurs here . pla

Launch Excel file from Python on Mac -

i'd start excel file python on mac. when hardcode file path in following lines works fine. import os os.system("open -a 'microsoft excel.app' 'path/file.xlsx'") but problem instead of hardcoding path solution should like: file_path = '/users/path/file.xlsx' import os os.system("open -a'microsoft excel.app' 'file_path'") apparently not work. in advance try maybe: os.system("open -a 'microsoft excel.app' '%s'" % file_path)

javascript - Bounce Text one by one in regular interval of time -

i trying code bouncing effect text, make bounce 1 one in regular interval marquee. i've tried jquery not getting bounce 1 one. here fiddle . js: $(document).ready(function(){ $(".test").effect( "bounce", {times:4}, 500 ); }); html: <div class="test"> <p>first time bounce</p> <p>this bounce nxt(after first)</p> . . . <p>last bounce return first one</p> </div> if update html have type of wrapper element around each letter, can animate each in turn. need loop through letters , animate them 1 @ time. $(document).ready(function(){ //setup counter keep our place , cache selection letter wrappers var counter = 0, $chars = $(".test").children(); //setup interval animate letter every setinterval(function () { //select current letter wrapper , animate $chars.eq(counter).effect( "bounce&

ios - How to identify specific cell in UICollectionview -

Image
i want set color black color cell1,cell4,cell7 ,...n & white color cell2,cell5,cell8 ,...n note: number of cell not fixed. how can implement this?? i assume cellforitematindexpath knows how cell number (i.e. 1 , 2 , 3 , 4 on picture) nsindexpath passed method. can decide on color use obtaining remainder of division 3, this: // decode index path cell number picture int cellnumber = [self getcellnumberfromindexpath:indexpath]; // figure out color if (cellnumber % 3 == 1) { // 1, 4, 7, etc ... // use black color } else if (cellnumber % 3 == 2) { // 2, 5, 8, etc ... // use white color }

objective c - UIView with xib ignores size classes -

i'm working on custom notification view, must show on everything. achive i've implemented subview of separate uiwindow , works fine except layout: use size classes, , layout ignores it. here code use setup view: notificationview *notificationview = [[[nsbundle mainbundle] loadnibnamed:@"notificationview" owner:self options:nil] firstobject]; uiwindow *window = [[uiwindow alloc] initwithframe:frame]; // additional window setup.. [window addsubview:notificationview]; you need add constraints, in code, relate 2 views after adding 1 other. read here more information: https://adoptioncurve.net/archives/2014/08/working-with-size-classes-in-interface-builder/

c# - Xamarin Android passing data from class to activity -

i made web api xamarin android app. , pass through data web api android using json (jarray). , filled class json data, i'm not sure how data class android activity. codes: requesting jarray in web api activity, , convert class made. webclient request = new webclient(); uri uri = new uri("http://iphere/database/api/surfboards/getsurfboards"); string surfboardsstring = request.downloadstring(uri); jarray thearray = jarray.parse(surfboardsstring); surfboard[] surfboard = (surfboard[])jsonconvert.deserializeobject(thearray.tostring()); this surfboard.cs (class) class surfboard { public string name { get; set; } public double price { get; set; } public string type { get; set; } public byte[] picture { get; set; } public string description { get; set; } } and have question, can upload image gets converted byte array json, how can turn image if byte array in android app? thanks! as variables in class in public can values object values

hadoop - How can I select a part of rows and create a new table in HBase? -

i have large table in hbase, want separate them several small tables, easier me use. (the original table should kept.) how can that? for example: have table, called all following rowkey: animal-1, ... plant-1, ... animal-2, ... plant-2, ... human-1, ... human-2, ... i want separate 3 tables: animal , plant , human 3 type of living beings. how can it? you can use mapreduce multipletableoutputformat below example. but in below example reading file i.e textinputformat instead have read hbase table using tableinputformat 'all' instead of table1 table2 ... have use 'animal', 'planet', 'human' as per requirement, if scan on hbase table , pass mapper using table inputformat, rowkey mapper's map method. need compare decide table going insert. please see 7.2.2. hbase mapreduce read/write example package mapred; import java.io.ioexception; import org.apache.hadoop.hbase.io.immutablebyteswritable; import org.apache.hadoop.hbase.

ruby - redirection route to :back - rails -

i have in routes file match "/:url" => redirect_to :back, constraints: { url: /^keys.*/ } but message error routes.rb:132: syntax error, unexpected tsymbeg, expecting keyword_do or '{' or '(' (syntaxerror) match "/:url" => redirect_to :back, constraints: { url: /^keys.*/ } ^ where did go wrong ? it's ambiguous, parentheses rescue! match "/:url" => redirect_to(:back), constraints: { url: /^keys.*/ } update regarding there no redirect_to , try: match "/:url" => redirect{|params, request| request.env["http_referer"]}, constraints: { url: /^keys.*/ } i didn't tested code, let me know if wrong.

jquery - Hide and show parents and child menubar -

i trying making menubar. when clicks on parent li ( showul) want slidedown child li (hideul). , again when clicks on parent li, should open respective child li hide opened li. check jsfiddle better understanding. kindly help. learning jquery. <ul> <li><a href="#" id="update" class="showul">update pages</a> <ul class="hideul"> <li>about us</li> <li>contact us</li> </ul> </li> <li><a href="#" id="category" class="showul">category option</a> <ul class="hideul"> <li>add category</li> <li>category list</li> </ul> </li> <li><a href="#" id="postoption" class="showul">post option</a> <ul class="hideul"> <li>add post</li> <li>post list<

wordpress - Slack Slash Command - Passing custom POST paramater? -

is possible send post data along slash command? for example, when setting new slash command can set callback url receive post data slack. in case it's http://example.com/wp-admin/admin-post.php i writing wordpress plugin, , in order have plugin parse post data need pass along action variable in post data. action=update_status ... correct action called: add_action('admin_update_status', function() { // parse post }); is possible send custom post parameter slash command? maybe like: /update action:update_status projecta in q/a i figured out can send action parameter get request so: http://example.com/wp-admin/admin-post.php?action=update_status

select2 jquery with asp.net with images -

Image
i have jquery select2 integrated webform working flawlessly want integrate dropdown dynamic image path scenario1 dropdown static number of fields , known images known image names like <asp:dropdownlist runat="server" id="ddl_heat" cssclass="selectdropdown form-control"> <asp:listitem text="select" selected="true" value="" disabled="disabled"></asp:listitem> <asp:listitem text="low" value="1"></asp:listitem> <asp:listitem text="moderately low" value="2"></asp:listitem> <asp:listitem text="moderate" value="3"></asp:listitem> <asp:listitem text="moderately high" value="4"></asp:listitem> <asp:listitem text="high" value="5"></asp:listitem> </asp:dropdownlist> now found digging add images in dropdown using b

c# - wcf restful service method input parameter: string vs stream -

can explain me? difference between wcf methods string , stream input parameters? void method1(stream input) , void method2(string input) when 1 should use stream input parameter? benefits , disadvantages , limits each of these approaches? thank much. you'd use stream parameter if want receive bytes incoming http request body in operation. that's "raw" mode mentioned @ http://blogs.msdn.com/b/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model-receiving-arbitrary-data.aspx , , can use receive arbitrary data. you'd use string parameter if want receive well-formatted string in of supported formats. out of box, means either json (the string value surrounded " ) or xml (depending on body style of operation, either xml element node called <string> text value passed operation, or element name of operation, child element named parameter, child text node value passed operation.