Posts

Showing posts from August, 2011

visual studio 2012 - Change the licensed to name in VisualStudio -

i'm having trouble being able change "licensed to" in visual studio 2012. if publish app it's coming out "hp" , needs me. found article online steps don't seem logical. can me this? here article found: http://blog.brouwer.pro/2012/09/how-to-change-licensed-to-name-for-visual-studio-2012/ the problem step 2 in registry don't have "username" , step 4 don't know (replace placeholder own username) any amazing!!! if username value not exist in registration , you'll need create yourself. just create new string value, , set value name. the "(replace placeholder own username)" means replace {your_user} in given path user name. for example if user name 'superior', navigate c:\users\superior\appdata\roaming\microsoft\visualstudio\11.0

iphone - C++ code performance drop in iOS device -

i have implemented c++ code, , have run on windows machine. execution time takes around 220 milliseconds. ran same code on ios device (ipad), takes 1 second execution time. what reason? how can achieve same performance on ios device? there way increase performance of c++ code on such device? what ways increase performance of c++ code in ios? i suppose average windows machine lot more powerful ipad many tasks. that said, use instruments (part of xcode) profile code , see it's spending of time, maybe optimisations ipad become clear.

ruby on rails - Comments system : Hstore with normal association VS simple attributes with polymorfic association -

i create small social network share photos , videos , events: photos table attributes : title, description, name videos table attributes : title , description , name, runtime events table attributes : title, description, date_begining, date_end as can see there duplication between tree tables, not important @ all. so each model (photo, video, event) should have possibility add comments , i'm using postgresql , simple way use polymorfic association , think can use hstore , treat of them (photo, video, event) single model (for example share) contains common attributes , add properties column shares table : shares ( title:string, description:string, name:string, properties:hstore) with that, think don't need polymorfic association , , can add simple relation between share , comment models : class share < activerecord::base has_many :comments end class comment < activerecord::base belongs_to :share end my question here best method (faste

javascript - jQuery Masked Input plugin not working on form input? -

i'm trying use masked input plugin on 1 of datatables editor fields (#dte_field_phone). reason, mask isn't being applied code: $('#dte_field_phone').mask('(999) 999-9999'); i'm calling mask after table , editor initialized, yet still nothing. ideas on may doing wrong? html: <div class="dte_field_input" data-dte-e="input"> <input id="dte_field_phone"></input> <div class="dte_field_error" data-dte-e="msg-error" style="display: none;"></div> <div class="dte_field_message" data-dte-e="msg-message"></div> <div class="dte_field_info" data-dte-e="msg-info"></div> </div> jquery: jquery(function ($) { $( document ).ready(function (e) { var editor = new $.fn.datatable.editor({ "ajaxurl": "../wp-content/plugins/contacts/php/table.wp_contacts

java - How to select the field value if field in all child records are the same -

i don't know if i'm wording question correctly, here goes. this web application using java, oracle, hibernate. i have 2 tables in 1 (items) many (tasks) relationship. items item_id name active_status etc tasks task_id item_id active_status progress_status etc the item's status made of statuses of of tasks. here's logic... if item status canceled or on hold...return item active status if there no tasks, return completed if tasks active , not superseded, then ...return not started if tasks not started ...return completed if tasks completed ...return on hold if tasks on hold otherwise return started i want using sql , map field in hibernate mapping file. i've tried many things on past several days, , can't seem work. tried grouping records , if 1 record found, return status. i've used decode, case, etc. here few examples of things i've tried. in second example 'not single group group function' error.

c# - Clearing canvas has a delay -

below code simple app draws rectangle on canvas in window , takes screen shot of app using copyfromscreen function when key pressed. before called however, call canvas.children.clear(). expect resultant image not have rectangle in it, does. seems actual rectangle image isn't removed canvas when function called time after. i tried putting in system.threading.thread.sleep(1000); after clear() call rectangle stays on screen full second well. it's getting removed after key press function finishes, there way remove before copyfromscreen call? to run need add reference system.drawing. xaml code <window x:class="canvastest.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" width="210" height="240" keydown="keypressed"> <window.background> <solidco

java - How to find dynamically allocated JMX port when port is 0 -

for java application when jmx enabled , port set 0, port dynamically allocated: -dcom.sun.management.jmxremote.port=0 what best way find out port allocated? managed find out using ps , pfiles on solaris, hoping there simpler why find (programmatically) also there better way assign dynamic jmx ports java applications on same box , keep track of them?

Titanium for Android: processing SEND intent keeps timing out -

i'm new android development -- working on first app android, using titanium. i'm running problem app keeps timing out, can't figure out why. have feeling there fundamentally wrong in approach / understanding of how titanium & android work, haven't been able figure out yet. my app bookmarking tool, similar delicious android. it: hooks send intent, capture sharing intents other apps takes subject , text send intent, , processing parse out url , title passes data web page the code follows: in /platform/android/androidmanifest.xml , add intent filter capture send action: <activity android:name=".advocateio2activity" android:label="advocate.io" android:configchanges="keyboardhidden|orientation"> <intent-filter> <action android:name="android.intent.action.send" /> <category android:name="android.intent.category.default" /> <data android:mimetype="text/pl

How to call a web page from android without exiting the app -

i'm new in android need call web page app without exiting try code: intent intent = new intent(intent.action_view); intent.setdata(uri.parse("http://www.google.es")); activity.startactivity(intent); and doesn't work. thank help!!! in xml layout file, use webview <webview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webview1" android:layout_width="fill_parent" android:layout_height="fill_parent" />

winforms - How do I access controls in a tabcontrol? -

i'm writing app in c# following arrangement of controls on form. first, there child form contains splitcontainer, comes 2 panels, panel1 on left , panel2 on right. panel1 contains checkboxes , textboxes. panel2 contains tab control. each tab, when created programatically, contains checkboxes , textboxes. when click save @ top of child form, data controls in panel1 save binary file correctly. save routine have iterate through each tab in tab control , save data checkboxes , textboxes in each tab. here have far: foreach (tabpage tab in tabcontrol1.tabpages) { string question = tbquestion.text(tabcontrol1.selectedindex); } unfortunately, tbquestion.text ends wiggly line under it, error message indicating "doesn't exist in current context." same happen other controls in each tab. need access controls in each tab? could try : foreach (tabpage tab in tabcontrol1.tabpages) { control ctl = tp.con

How do I write an image, along with other data, to my database using php and mysql -

hello: have web form submits data db. able create signature image , save within directory. want save/store signature image in mysql db along record can call later. written in codeigniter 2.0 here model , controller. public function sig_to_img() { if($_post){ require_once apppath.'signature-to-image.php'; $json = $_post['output']; $img = sigjsontoimage($json); imagepng($img, 'signature.png'); imagedestroy($img); $form = $this->input->post(); var_dump($form); $this->coapp_mdl->insert_signature($form); } } public function insert_signature($data) { $sig_hash = sha1($data['output']); $created = time(); $ip = $_server['remote_addr']; $data = array( 'first_name' => $data['fname'], 

php - Basic laravel Route filter parameters error -

i start learning laravel today , reading documentation , testing example codes etc. i come basic route filter parameters problem i'm not sure how works. from example on documentation page http://laravel.com/docs/routing#basic-routing the code below wrong, new laravel , not sure yet how work i got code written give me error route::filter('old', function($age) // guess correct way pass $age=400 ? { if($age < 200){ return redirect::to(''); } }); route::get('user', array('before' => 'old:400', function() { return 'you on 200 years old!'; })); from codes mean passing value of "400" filter old right? ... don't know how 400 value in filter... mean in variable "400" being passed or how retrieve "400" value in filter function. so question how write filter function "400" value ? thanks in advance :) if want pass parameter or value evaluated filter

javascript - How to create a HTML Cancel button that redirects to a URL -

i playing buttons in w3schools tryit editor , , trying figure out how make browser redirect url when click on "cancel" button. here's have tried: <form action="demo_form.asp" method="get"> first name: <input type="text" name="fname"><br> last name: <input type="text" name="lname"><br> <button type="submit" value="submit">submit</button> <button type="reset" value="reset">reset</button> <button type="cancel" onclick="javascript:window.location='http://stackoverflow.com';">cancel</button> </form> but doesn't work. ideas? cancel not valid value type attribute, button defaulting submit , continuing submit form. mean type="button" . (the javascript: should removed though, while doesn't harm, entirely useless lab

jquery - Maps API & MarkerClusterer -

i'm trying markerclusterer work data i've taken out of sql database. it's showing map not pins. if console.log markers var, end whole bunch of lines of object organized indices vi value. <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map-canvas { height: 100% } </style> <script src="jqueryui/js/jquery-1.9.0.js" type="text/javascript"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?key=aizasyc3hdl1qhs4gq_hew-k60benthuzlt5_8s&sensor=false"> </script> <script type="text/javascript"> var script = '<script type="text/javascript" src="markerclusterer';

java - Android: code for 3D human body that can be animated -

i'm looking rather specific here. it'd great if exists, if not don't mind piecing what's needed. essentially: want show 3d human body model on screen, , in code, able manipulate joints create custom animations; nothing facny though. along lines of leftelbowjoint.rotate(57) perfect. any recommended code and/or starting points? if want use 3d objects in application or wallpapers. take @ rajawali library based on opengl es 2.0/3.0. download library , demo app use 3d animations on blender objects. crawling , hand moving. 1 of animation example here .

javascript - How to show Ajax message from JSF bean? -

i trying fire alert message given java function. system simple this: public class adminbean extends abstractlistbean { private collection <hours> a; private modeldto selectedmodel; private string message; public void insert() { //some preparations setmessage(""); if ( selectedmodel!= null ) { try{ //try insert of selected model setmessage("success"); }catch (exception e) { setmessage("unespected error"); } }else{ setmessage("not available"); } //gethttpservletrequest().setattribute("message", getmessage()); //facescontext.getcurrentinstance().addmessage(null, new facesmessage(message)); } } and, @ client side, have wrote xhtml this: <a4j:commandlink styleclass="inscribirse" rendered="#{model.s

c++ - Windows Chromium Build Errors: No such file or directory 2000 times -

i building chromium source code on windows 7 x64 computer. downloaded source using build instructions provided , set environment told instruction pages. can open solution in vs2010pro (albeit taking while), , can edit code. when try build solution, thousands of errors (last time, 2703). first batch cmd.exe exited error code 1; there 20 of those. of rest complain c++ header files not found compiler. here few randomly selected throughout long error list. error 138: error c1083: cannot open include file: 'eventinterfaces.h': no such file or directory d:\chromium\src\third_party\webkit\source\core\dom\eventnames.h in project webcore_rendering error 1952: error c1083: cannot open include file: 'grit/ui_resources.h': no such file or directory d:\chromium\src\chrome\browser\ui\chrome_style.cc in project browser_ui error 2482: error c1083: cannot open include file: 'grit/generated_resources.h': no such file or directory d:\chromium\src\chrome\browser\p

mysql - Eliminate tuples with reverse relation and no primary Key -

i trying insert relations based on question below. have got far, relations c (as per question below). get, getting records getting "c friends a". far understand question statement "no duplicate friendships", have insert friendship c , not vice-versa. either understand problem wrong, or can't desired result. so, when try insert table values i've got, result wrong. persons have friends more desired, value of 2. the structure of tables follows: friend ( id1, id2 ) the student id1 friends student id2. friendship mutual, if (123, 456) in friend table, (456, 123). (no primary key) situation trying solve is: "for cases friends b, , b friends c, add new friendship pair , c. not add duplicate friendships, friendships exist, or friendships oneself." i have been trying solve problem 2 days now. please help. thanks in advance. ----my sql query----- select b.id1 id1,b.id3 id2 (select a.id1 id1,a.id2 id2,a.id3 id3,f3.id2 id4 (select f1.id1

Convert Access Query to VB.net SQL Statement -

Image
i have table in access database called historical_stock_prices filled various companies historical stock prices. need run query convert raw data (the stock prices) quarterly growth rates , display quarterly growth rates in datagridview . i've written the following query in sql view of access database , works within access. select minmaxyrqtrdates.yrqtr, minmaxyrqtrdates.ticker, minmaxyrqtrdates.maxdate, [historical prices].close, minmaxyrqtrdates.mindate, [historical prices_1].open, ([historical prices].[close]/[historical prices_1].[open]-1)*100 growthrate [historical prices] [historical prices_1] inner join ([historical prices] inner join [select year([date]) & "-" & datepart("q",[date]) yrqtr, [historical prices].ticker, max([historical prices].date) maxdate, min([historical prices].date) mindate [historical prices] group year([date]) & "-" & datepart("q",[date]), [historical prices].ticker]. minmaxyrqtrdates on

Eclipse / SWT: How to monitor UI event queue? -

doing lot of thread cleanup in multi threaded eclipse rcp application. got lot of non ui related actions taking place on ui thread due haphazard coding in past (me included, i'll admit it). we've been doing ton of cleanup , proper threading. want monitor ui runnable queue see whats going on ensure i'm not missing things. any recommendations on how monitor uisynchronizer.messagecount / runnablelock[] using appliction?

Scala syntax bug? -

i have encountered think bug/no-syntax-sense in scala syntax prefer post here after reporting might wrong. the controller class: package import java.awt.event.actionlistener import java.awt.event.actionevent class itemcontroller extends actionlistener { val new_item = "new item" val update_item = "update item" private val newitem = new itemnew override def actionperformed(e: actionevent) = { } def create(view: string) = { view match { case new_item => { newitem eraseform //here eclipse says "unit not take parameters". newitem setvisible true } case update_item => } } } the view class package import scala.collection.mutable.hashmap import javax.swing.jpanel import java.awt.gridlayout import javax.swing.jframe import scala.collection.mutable.linkedhashmap import javax.swing.jtextfield import java.awt.borderlayout import java.awt.flowlayout import javax.s

crop - understanding inline-block divs and its "margin" css property -

i'm trying understand code in order both crop , center image. i think i've understood of it, i'm still not figuring out why need this: .img-crop img{ /* removes(sorta) image flow */ padding-left: 100%; margin: -100% -100%; } i think margin: -100% -100% centering image both vertically , horizontally, why placed on left of container (and therefore: why need padding-left: 100%)? i think figured out how works. here can find example tried write scratch. image has been replaced div , since both displayed inline-block , last 1 convenient changing heights , play it. let me it's quite useful if don't want use jquery heavily manipulate dom! crop , centering in bunch of css rulesets.

Image url in Css file under stylesheets under public Rails 2.3 -

i working rails 2.3.5 , have images in public/images/ added css file named custom.css #cssmenu ul { background: url(nav-bg.png) repeat-x 0px 4px; height: 69px; } how can make read image in inside public/images ? have tried did not work #cssmenu ul { background: url(<%= asset_path '/images/nav-bg.png' %>) repeat-x 0px 4px; height: 69px; } also not work #cssmenu ul { background: url(<%= asset_path 'nav-bg.png' %>) repeat-x 0px 4px; height: 69px; } both examples correct: #cssmenu ul { background: url(../images/nav-bg.png) repeat-x 0px 4px; height: 69px; } #cssmenu ul { background: url(/images/nav-bg.png) repeat-x 0px 4px; height: 69px; }

Multiple EditText in Android -

if have,say 20 edittext fields in program...and @ time want access 2 of them...then next 2...then next 2...and on....can using array of exittexts?? if yes can please provide me small example... accessing each , every edittext separately can tedious job...i've tried implement in array...but every time giving me null pointer exception...all ids correctly provided...plus code works when provide each single edittext separately. here code:: edittext e11,e12,e13,e21,e22,e23,e31,e32,e33,e41,e42,e43,e51,e52,e53,e61,e62,e63,e71,e72,e73,e81,e82,e83,e91,e92,e93,e101,e102,e103; edittext arr[]={e11,e12,e13,e21,e22,e23,e31,e32,e33,e41,e42,e43,e51,e52,e53,e61,e62,e63,e71,e72,e73,e81,e82,e83,e91,e92,e93,e101,e102,e103}; string ch1="",ch2="',ch3=""; for(c=0 9) { ch1=arr[(4*c)].gettext().tostring(); ch2=arr[(4*c)+1].gettext().tostring(); ch3=arr[(4*c)+2].gettext().tostring(); } the loop giving me null pointer exception...even if set values edi

mysql - Database design: Best Way to store heterogeneous subtypes of a parent class? -

website has products different categories (phones, tablets, washing machines, ... etc) each product have diff. prices depending on store (if user views galaxy s4 16gb show $x xstore , $y ystore) the website have heavy filtration. instance phones might filtered according price, color, .. etc. filtered manufactures or stores. (all samsung products, products @ xstore, ... etc) for reason specs of each category should stored separately (phones: screensize, memory, os, ... etc. watches have different spec ..). each category (phones or watches) expected have ~1000+ product. question: i first thought of pyramid-like design. 1 table products adding general table each category common specifications (for phones have screen-size, os, ..), third table variations (memory:16gb or 32gb, price @ each store, ... etc). problem is: main table products large (thousands), , heavy filtrations have go , forth between 3 tables @ least, , if i'm filtering samsung products, have deal more

dojo - Cannot get a reference to a dijit form when the form has a DateTextBox -

i having trouble getting reference dijit form widget when form contains datetextbox. code snippet below demonstrates problem. when executed, alert box says "undefined". however, if rid of <input ... id="datetextbox"... /> , able reference form widget. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title></title> <link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dijit/themes/claro/claro.css" media="screen"> <!-- load dojo , provide config via data attribute --> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js" data-dojo-config="async: true, parseonload: true"> </script> <script type="text/javascript"> require(

java - Scanner "Input cannot be solved to a variable" error -

so i'm complete noob @ java , experimenting calculator. code below have far. problem code works until add label "loops:", after adding label scanner gets error reason. want loops label user can choose (if statement @ bottom of code) whether or not continue using calculator. appreciated. import java.util.scanner; public class mainclass { public mainclass(){ loops: scanner input = new scanner(system.in); system.out.println("first number: "); int number1 = input.nextint(); system.out.println("second number: "); int number2 = input.nextint(); system.out.println("operator (+, -, /, *)"); string operation = input.next(); string cont = input.next(); int total; if(operation.equals("+")){ total = number1 + number2; system.out.println(total); } if(operation.equals("-")){

ios - Second thoughts on a tried code - Your views please -

i have been using thiscode years in app uses mapkit , corelocation frameworks: if ((abs(howrecent) < 5.0) && ((newlocation.horizontalaccuracy > 0.0f && newlocation.horizontalaccuracy < 150.0f)) ) however, having second thoughts following reason: i intended test first location update old update on first attempt. being checked on each update location awareness programming guide page 14 gives check: if (abs(howrecent) < 15.0) { the programing guide not mention horizontal accuracy if in cllocation class definition am being cautious checking accuracy time? appreciate views if works well, if code throwing valid location update, won't know it. btw, app supports ios 4.3 6 , wrote version 3 , has updated on version 4. thank responses. i suggest looked following: - (void)locationmanager:(cllocationmanager*)manager didupdatelocations:(nsarray *)locations { cllocation *loc2 = [[cllocation alloc] init]; loc2 = [locations

python - Plotting Celery canvas before running -

Image
there documentation on how produce graph after running canvas job in celery. i'd generate graph before run job. say created simple chain: c = chain(add.s(1, 2), mul(4)) how can generate graph of chain? thanks, miki i had exact same desire. generate graph before running job. worked bit on :) it appears celery not allow it. reason (at least understood when trying it) in graph each node has have unique name. once canvas executed unique name celery task_id before execution there nothing allow such distinction. so solution generate graph yourself, , of course identify uniquely each node (for counter can work). this job of function: # -*- coding: utf-8 -*- celery.canvas import chain, group, signature def analyze_canvas(canvas): return _analyze_canvas(canvas)['dependencies'] def _analyze_canvas(canvas, previous=[], i=0): dependencies = [] if isinstance(canvas, chain): t in canvas.tasks: if not (isinstance(t, gro

java - How to force StyledText to break line in SWT -

i'm trying force styledtext breake line effects hopeless. instead, extends size of shell width of biggest line. i trying achieve creating class extends shell my constructor super(swt.on_top | swt.no_trim | swt.no_focus | swt.no_scroll); filllayout layout = new filllayout(); layout.marginheight = 1; layout.marginwidth = 1; setlayout(layout); mform = new managedform(this); formtoolkit toolkit = mform.gettoolkit(); body = mform.getform().getbody(); filllayout layout2 = new filllayout(); layout2.spacing = 2; body.setlayout(layout2); body = toolkit.createcomposite(body, swt.border ); and when want insert , show text. that string text = body = mform.gettoolkit().createcomposite(parent, swt.border); gridlayout l = new gridlayout(); l.marginheight = 0; l.marginwidth = 1; body.setlayout(l); styledtext bodytext = createdisabledtext(body, text); mform.getform().getcontent().pack(); mfo

c# - Show User Control through Static Method -

i have been researching this, haven't been able find far. currently, using javascript alert box on asp page: public static class alert { public static void show(string message) { string script = "<script type=\"text/javascript\">alert('" + message + "');</script>"; page page = httpcontext.current.currenthandler page; if (!page.clientscript.isstartupscriptregistered("alert")) { page.clientscript.registerstartupscript(typeof(alert), "alert", script); } } } i able call code behind by: alert.show("text"); my plan replace javascript alert utilizing ajaxcontroltoolkit's modalpopupextender. creating user control looks this: <ajax:modalpopupextender id="mpalert" runat="server" popupcontrolid="" targetcontrolid="btnexport" okcontrolid="btnok">

java - Selectively disable automation cases per environment -

what doing : using jenkins run same test suites , test cases against various environments - dev / staging / production. i'm using webdriver java implementation , testng. what i'd do : selectively disable some tests, not entire test suites, running depending on environment. rather maintain separate codebases between environments, i'd know of way accomplish this. initial thoughts : thinking setting system property in jenkins each job in each environment , each test decorator have pull piece of information out determine if should ran or not. think it's clunky, i'm not sure how it, , i'm not sure if right approach. can tell me best way accomplish this? i'm hoping isn't best way. thanks, joe have looked @ testng listeners? you can write listener before berfore test suite run after tests run have been identifier, iterate around list of tests , remove tests not want run. because programatic can write java achieve want. also, create

bash - command export is not in $PATH, yet it can be executed -

bash command export can not found in $path , yet available execute. similar source . why way ? noble answer... it's builtin. read more here: http://www.gnu.org/software/bash/manual/html_node/shell-builtin-commands.html

php - Best strategy for doing real time, scalable audio processing? -

i building web application allows users upload audio files, music in particular. of time, expect duration of each song several minutes , file approximately 3-10mb in size. however, accept audio uploads 100mb, possibly allowing on hour of audio. using combination of ffmpeg, sox, , lame convert 7 possible formats mp3 , perform audio modifications including equalization, trimming, , fading. files stored , linked in database. my current strategy handle entire process in 1 http file upload request using php on backend, in perform following functions: validation transcode audio multiple versions (using shell through php) store original , transcoded versions in temp directory upload audio files amazon s3 permanent storage commit id of each file database, linking them user this works similar image processing system have set up. however, while images can complete whole process in few seconds, audio can take lot longer. @ most, audio take 5-10 minutes processed , stored. my que

android - Changing Button using setBackgroundDrawable, but background stays changed when returning -

i'm using setbackgrounddrawable method change background of button on activity. onclicklistener has intent open new activity. however, when return past activity hitting physical button, button onclicklistener assigned still has onclick background set. if return previous activity using button in action bar, works correctly. tried use selector xml, android studio gives me render errors, , doesn't load when compile. here mainactivity.java: package com.jordandebarth.supercalculator; import android.app.actionbar; import android.content.intent; import android.graphics.color; import android.graphics.drawable.colordrawable; import android.os.bundle; import android.app.activity; import android.view.menu; import android.view.view; import android.widget.button; import android.widget.imagebutton; public class mainactivity extends activity { imagebutton pythag; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestat

asp.net web api - Ajax Web-Api optional parameter null issue. -

ajax webapi when parameter null or blank 400 bad reuqsest occurs. solution needed asap. http://{parenturl}/api/buildtypewebapi/getbuildtypelist?currpage=1&pagesize=10&buildtypename= here buildtypename optional parameter when there not search parameter passed how reduce 400 error. //controller public httpresponsemessage getbuildtypelist(int currpage, int pagesize, string buildtypename = "") { } here issue buildtype. help one. regards you need change way request made. either complete request string adding ="" end, or leave out buildtypename parameter when empty. so either of these 2 cases: /api/buildtypewebapi/getbuildtypelist?currpage=1&pagesize=10&buildtypename="" /api/buildtypewebapi/getbuildtypelist?currpage=1&pagesize=10 this way, web api knows want buildtypename parameter. in case incomplete request.

Ghostscript unrecoverable error undefinedfilename -

problem on many sites trying explain it, error message pretty unclear. in case had lot of pdf files merge , reason 1 file big problem. ghostscript unrecoverable error undefinedfilename i received same error neglecting dash before dbatch. gs dbatch ... instead of gs -dbatch ...

canvas - How to debug CORS error -

i'm trying grab image amazon s3 using cross-origin resource sharing can use canvas.todataurl() method. on s3 set corsconfiguration on bucket to: <?xml version="1.0" encoding="utf-8"?> <corsconfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <corsrule> <allowedorigin>*</allowedorigin> <allowedmethod>get</allowedmethod> <allowedmethod>post</allowedmethod> <allowedmethod>put</allowedmethod> <maxageseconds>3000</maxageseconds> <allowedheader>*</allowedheader> </corsrule> </corsconfiguration> when canvas.todataurl() threw security error code 18, guessed because image had loaded "crossorigin" attribute set. still, no matter how load image s3, example: <img src="http://s3.amazonaws.com/storybookstorage/wood.png" crossorigin="anonymous"> chrom

php - Weird behavior of callback function -

i need parse parameter string becomes array. here code: $paramstr = 'type,mp3|path,audio/file.php?id=artist01|popup,yes'; function parse($paramstr) { $params = preg_split('#=|,|\|#', $paramstr); ($i=0;$i<count($params);$i+=2) { if ($params[$i] == "path") { $params[$i+1] = $baseurl . "/" . $params[$i+1]; } $ret[$params[$i]] = $params[$i+1]; } return $ret; } if ($paramstr != "") { $paramarr = parse($paramstr); } else { echo 'error'; } when var_dump($ret), output correct: array 'type' => string 'mp3' (length=3) 'path' => string 'http://localhost/audio/file.php%3fid%3dartist01' (length=49) 'popup' => string 'yes' (length=3) however, when var_dump($paramarr), got weird output: array 'type' => string 'mp3' (length=3) 'path' => string 'http://localhost/audio/file

java - Jtree inside JScrollPanel not working -

defaultmutabletreenode mycomputer = new defaultmutabletreenode("my computer"); defaultmutabletreenode c = new defaultmutabletreenode("local disk(c:)"); defaultmutabletreenode vinod = new defaultmutabletreenode("vinod"); defaultmutabletreenode swing = new defaultmutabletreenode("swing"); defaultmutabletreenode tr = new defaultmutabletreenode("tree"); defaultmutabletreenode = new defaultmutabletreenode("3½ floppy(a:)"); defaultmutabletreenode e = new defaultmutabletreenode("new volume(e:)"); c.add(vinod); vinod.add(swing); swing.add(tr); mycomputer.add(c); mycomputer.add(a); mycomputer.add(e); jtree tree = new jtree(mycomputer); jscrollpane scrollpane = new jscrollpane(tree); jpanel1.add(scrollpane); tree.setvisible(true); i got new tree example web, when try show it, not appear! dont know why. ideas? thank you! adjusted code sscce , works fine here public static void main( string[] args ) { ev

ember.js - Figure out which button[type=submit] was clicked in a multi button form -

with ember.js, following case: <form {{action 'save' on="submit"}}> <button type="submit" data-source='x'>do x</button> <button type="submit" data-source='y'>do y</button> </form> inside save() event, how 1 figure out button clicked? (i need form way is, , need button[type=submit] too. know can 2 actions on buttons, fire form native submit, if way have 2 separate actions, i'll disappointedly manually fire form submit on each, there has easier way) the action helper not pass jquery event information, can access using view's event handler instead. example define submit-event handler like: app.multibuttonform = ember.view.extend({ tagname: 'form', submit: function(event) { console.log('submit with: ', event); event.preventdefault(); } }); {{#view app.multibuttonform}} <button type="submit" data-source='x'>do x&l

assembly - Compare two strings case-insensitive -

i have code: section .data msg1 db "equal" msg1len equ $ -msg1 msg2 db "not equal" msg2len equ $ -msg2 str1 db "abcde" str1len equ $-str1 str2 db "abcde" str2len equ $ -str2 section .text global _start _start: mov esi,str1 mov edi,str2 mov ecx,str2len+1 cld repe cmpsb jecxz equal ;jumps if equal ;if not equal mov eax,4 mov ebx,1 mov ecx,msg2 mov edx,msg2len int 80h jmp exit equal: mov eax,4 mov ebx,1 mov ecx,msg1 mov edx,msg1len int 80h exit: mov eax,1 mov ebx,0 int 80h what i'm trying make case-insensitive "abcde" still equal "abcde". however, case-sensitive. how make case-insensitive? appreciated. one common approach convert 2 strings common case, example uppercase, , compare those. if don't want manipulate strings beforehand, can on fly, converting current checked characters common case , com

winapi - C++ RegisterHotKey without overriding existing functionality -

when register hot key in c++ (the prtscn key in case), noticed original functionality lost. key not capture image of screen more. there way register hot key without breaking existing bindings? the problem context: trying create application our testing team automate task of taking screenshots. when user clicks prtscn / alt+prtscn keys, want run small application picks image on clipboard , pushes document. of application in java, had come c++ registering hot key. thanks help!! this code used register hot key: registerhotkey(null, 1, mod_alt | mod_norepeat, vk_snapshot); registerhotkey(null, 2, mod_norepeat, vk_snapshot); while (getmessage(&msg, null, 0, 0) != 0) { if (msg.message == wm_hotkey) { winexec(" java application ", sw_shownormal); } } i don't think there's documented way trigger os's print screen functionality programmatically. have few ideas try: implement copy-to-clipboard functionality yourself, or once

linux - ThreadAffinity in windows -

currently porting linux application windows, need set thread affinity. currently linux method is: pthread_setaffinity_np(curthread->threadid, sizeof(cpu_set_t), &curthread->coremask); i need replace equivalent windows call. i have found "setthreadaffinitymask" method equivalent windows call. can use this? if yes how place arguments call? can me on this. possibly useful functions: setthreadaffinitymask() setprocessaffinitymask() getprocessaffinitymask() read multiple processors , processor groups on msdn starter.

mongodb - Updating large number of records in a collection -

i have collection called timesheet having few thousands records now. increase 300 million records in year. in collection embed few fields collection called department won't updates , records updated. mean once or twice in year , not records, less 1% of records in collection. mostly once department created there won't update, if there update, done (when there not many related records in timesheet) now if updates department after year, in worst case scenario there chances collection timesheet have 300 million records totally , 5 million matching records department gets updated. update query condition on index field. since update time consuming , creates locks, i'm wondering there better way it? 1 option i'm thinking run update query in batches adding condition updateddatetime> somedate && updateddatetime < somedate . other details: a single document size 3 or 4 kb have replica set containing 3 replicas. is there other better way this? thin