Posts

Showing posts from August, 2015

visual studio 2013 - VS2013: Linker conflicts -

i have problem linker of standard windows libraries in visual studio 2013. receive following message when try build c++ project: this error message when build platform toolset v100: error lnk1123: failure during conversion coff: file invalid or corrupt c:\solutions\patchmanagement\trunk\main\windows\patchmgmtagentstest\link patchmgmtagentstest this error message when build platform toolset v120: error lnk1104: cannot open file 'atlsd.lib' c:\solutions\patchmanagement\trunk\main\windows\patchmgmtagentstest\link patchmgmtagentstest earlier c++ project , others c# projects in same solution written on vs2008 using .net 3.5. migrated vs2013 , .net 4.5.1. moreover, have vs2008(where old version of same solution verify migration) , vs2010 anbother solution. have found solutions or tips first error message can appeared due .net 4.0 or greater, or due visual studios variable enviroments leads conflicts. however, cannot refuse .net 4.5.1. how can fix first or seco

C# unit testing API 2 call -

i have web api 2 web service method. inside i'm using httpcontext.current.request.userhostaddress. when calling controller method directly int unit test isn't filled in errors null object. searched how fill in , found following helped issue: add ip address httprequestmessage however, needs server name send request to. problem when tests run vsexpress need running api web service, won't when running tests. on top of if seems picks random port run on couldn't hardcode address in above link. how can test api 2 method given above issues? this line blows when test api method string ip = httpcontext.current.request.userhostaddress; [edit] answer just knows here solution in code public class mycontroller : apicontroller { private: httprequestbase httprequest; public mycontroller() { httprequest = new httprequestwrapper(httpcontext.current.request) } public mycontroller(httprequestbase http) { httprequest = http; }

php - Issue uploading Images into WordPress -

when trying upload images wordpress, keep getting error: 413 request entity large nginx i checked php.ini file make sure have proper upload-able amount , have 32mb i have dedicated server media temple , have never had issue before. hope shed light? the file sizes uploading 1 - 3 mb . less 1mb seems go through. this not php.ini issue. error coming web server nginx. add line somewhere in nginx server block (change 5m whatever need): client_max_body_size 5m;

python - How to link uploaded-file from a form to a model with Flask? -

i working on basic ecommerce platform learning purposes. , i've stumbled across difficulties couldn't find book or resources answers it. however, sure there should easier solution didn't recognise... the aim upload file along other form data database, file linked product id. below example, class productform(form): name = stringfield('design', validators=[required()]) series = selectfield('collection', choices=[(c.id, c.name) c in series.query.all()], coerce=int) material = selectfield('material', choices=[(c.id, c.name) c in material.query.all()], coerce=int) purity = selectfield('purity', choices=[(c.id, c.name) c in purity.query.all()], default=['1'], coerce=int) description = textareafield('description', validators=[required()]) price = integerfield('price', validators=[required()]) photo = filefield('gallery') submit = submitfield('add display') i know photo

java - Trouble printing my list -

if see i'm keeping numbers in matrix below list according me there are keeping these numbers , when try print list send me lot of these: i@7852e922 memory address? , if objects print. thank attention. package estructurasdedatos; import java.util.list; import java.util.linkedlist; public class matriz { private static scanner read; public static void main(string[] args){ /*read = new scanner(system.in); system.out.println("ingrese el numero de filas y columnas: "); int f = read.nextint(); int c = read.nextint();*/ linkedlist ll = new linkedlist(); system.out.println(" ** ** *** ******* **** ***** *** ***** ***** "); system.out.println(" * ** * * * * * * * * * * "); system.out.println(" * ** * * * * * * * * * * "); system.out.println("

jquery - How to use <select> element in php for navigating database? -

i've made html page this. users can select dropdown list, whether want download hall ticket or result. not able link options in tag database. please me php code. <html> <body> <table width="200" border="0" class="download"> <form name="download" action="downloadhalltickets.php" method="post"> <caption align="top"> downloads: </caption> <tr> <td>select:</td> <td> <select name="select"> <option value="hall tickets">hall tickets</option> <option value="results">results</option> </select> </td> </tr> <tr> <td>seat no.</td> <td><input type="text" name="se

perl - date is error when run zabbix_bind.9.6_stats.pl on Solaris -

analyse named.stats file on solaris 10, sunos azalea 5.10 generic_150400-13 sun4u sparc sunw,sun-fire-v490 perl version: v5.8.4 built sun4-solaris-64int bind 9.9.5-p1, dns has view zone! when ran zabbix_bind.9.6_stats.pl script, date in first line of result file zabbix_named.stats.txt wrong. input file: named.stats +++ statistics dump +++ (1411256097) ++ incoming requests ++ 245677755 query 11 iquery 131 notify 5 update ++ incoming queries ++ 7 reserved0 214646337 195659 ns 194834 cname 67573 soa 11863353 ptr 13 hinfo 311508 mx 80961 txt 17684359 aaaa 313197 srv 35 naptr 1026 a6 377 ds 2 nsec 16 dnskey 2658 spf 6 axfr

sql - How do I write a create table statement for an entity that has two relationship sets attached to it? -

Image
take picture example: **ignore isa relationship understand concept. my question creating table team. understand how create tables entities, , relationships i'm getting little confused how should go creating table team has 2 relationship sets being related it. my possible solution: team holds attributes ssn(from professors) , ssn(from gtas, comes it's isa) , use primary key(profssn, gtassn) uniquely identify teams? if this, how model on_team_1 , on_team_2? thought having on_team_1 have attributes ssn(since primary key of professors) , 2 attributes such team_profssn , team_gtassn come team entity. does sound viable or missing how this? i think need have team table holds attributes specific team (name, least), seems need team_member table models relationship between individual , particular team. if understand data think team_member have team_name , ssn - although in euphemistically known "the real world" there's no way in hell you'd away usin

asp.net mvc - nopCommerce multistore enable/disable functionaliity not working when radio button with different id's -

i using nopcommerce 3.40 i using multistore functionality in nopcommerce plugin. , have issue on multistore default script. <tr class="method"> <td class="admintitle"> @html.overridestorecheckboxfor(model => model.method_overrideforstore, model => model.method, model.activestorescopeconfiguration) @html.noplabelfor(model => model.method): </td> <td class="admindata"> @html.radiobuttonfor(model => model.method, 1, new { id = "one" }) <label for="one">one</label><br/> @html.radiobuttonfor(model => model.method, 2, new { id = "two" }) <label for="two">two</label><br /> @html.radiobuttonfor(model => model.method, 3, new { id = "three" }) <label for="three"&

javascript - How to detect change in form if added a new row in prime faces datatable -

i have requirements disable save , cancel buttons in page on page load. should enable save , cancel buttons if user changes in page. achieve this, using http://plugins.jquery.com/are-you-sure/ this plugin working fine there need customization in many scenarios, 1 below i have page item groups consists of 3 panels. leftpanel : list of item groups in system centerpanel : list of items assigned selected item group rightpanel : list of items assign item group now assume have datatable <p:datatable var="itms" value="#{mybean.listofitems}" rows="10" paginator="true" paginatortemplate="{currentpagereport} {firstpagelink} {previouspagelink} {pagelinks} {nextpagelink} {lastpagelink} {rowsperpagedropdown}" rowsperpagetemplate="10,50,100"> </p:dat

Erlang - Can one use Lists:append for adding an element to a string? -

here function parses addition equation. expr_print({num,x}) -> x; expr_print({plus,x,y})-> lists:append("(",expr_print(x),"+",expr_print(y),")"). once executed in terminal should (but doesn't @ moment): >math_erlang: expr_print({plus,{num,5},{num,7}}). >(5+7) actually 1 that, not work way wish in x in {num, x} number , not string representation of number. strings in erlang lists of numbers. , if numbers in wright range can printed string. should able find detail explenation here . first thing wold make sure call expr_print({num, 3}). return "3" , not 3 . should able find solution here . second thing lists:append takes 1 argument, list of list. code this expra_print({num,x}) -> lists:flatten(io_lib:format("~p", [x])); expr_print({plus,x,y})-> lists:append(["(", expr_print(x),"+",expr_print(y), ")"]). and should produce nice flat str

configuration - Change the C++ Build command line options with Eclipse -

eclipse 3.8 file>properties displays window: properties hw.cpp . c/c++ build>settings shows: settings tab: tool settings containing these text field values: command: g++ all options: -o0 -g3 -wall -c -fmessage-length=0 i add -std=c++1y all options field not editable. how change command line options? the command field editable. file>properties displays window: properties hw.cpp . c/c++ build>settings shows: settings with: gcc c++ compiler/micellaneous containing text field: other flags -c -fmessage-length=0 change to: -c -fmessage-length=0 -std=c++1y the change show in uneditable field, all options .

php - Display database table value in HTML dropdown <select> list -

apologies if similar question has been asked in past - did search previous questions had no luck finding answer needed. i have account option on website 'my settings' area, allows users change details. 1 of details can change country. instead of allowing user type country (in html textbox), i've made things more restricted providing dropdown list of countries in world. i've briefed code below (as don't want paste list of countries , waste time): <select name="country" id="country" class="required" value="<? echo $row_settings['country']; ?>"> <option value=""></option> <option value="afghanistan">afghanistan</option> <option value="albania">albania</option> ... <option value="uk">uk</option> <option value="usa">usa</option> ... </select> as 'my settings' area registered users

objective c - How to call super class delegate method from subclass delegate method in Cocoa? -

there example class: @interface outlineviewcontroller : nsoutlineview <nsoutlineviewdatasource, nsoutlineviewdelegate> @end @implementation outlineviewcontroller - (nsview *)outlineview:(nsoutlineview *)outlineview viewfortablecolumn:(nstablecolumn *)tablecolumn item:(id)item { nstablecellview *result = nil; if (mycondition) { // ... return result; } else { // how return defult? } } @end is there possibility call default realization delegate method? just use super keyword refer parent class you've done in comment: if (mycondition) { //...your implementation here } else { return [super outlineview:outlineview heightofrowbyitem:item]; } for points, might use -respondstoselector: check super responds method in question. update: noticed superclass in case nsoutlineview itself. quite confusing -- views , view controllers different things, calling descended view "view controller" not plan. also, note docs advise "subclas

subtract one minute from datetime in powerbuilder -

i have seen lot of info on how subtract 1 datetime other , how add years on datetime. following giving me headache. how subtract 1 minute date in powerbuilder?please , support. thanks & regards rahul g this how done in powerscript. easier if did in sql using dateadd function. datetime ldt_thedate, ldt_newdate time lt_thetime // current date-time ldt_thedate = datetime(today(), now()) // subtract 1 minute lt_thetime = relativetime(time(ldt_thedate), -1) // assemble date-time ldt_newdate = datetime(date(ldt_thedate), lt_thetime)

c# - WCF service call taking long time to respond for the first time -

i have wpf (.net 4.5, c# ) application shows user details based on wcf service call. first call service taking time fetch data. subsequent calls fetching data quickly. after idle time of 20 minutes, first call service take considerable amount of time. idea how resolve this? thanks in advance.

javascript - Bootstrap modal new page -

i want make modal in if click button modal pops , content of modal different page. please me. this code <a href="#" class="btn btn-lg btn-success" data-toggle="modal" data-target="#basicmodal">click open modal</a> <div class="modal fade" id="basicmodal" tabindex="-1" role="dialog" aria-labelledby="basicmodal" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title" id="mymodallabel">basic modal</h4> </div> <div class="modal-body"> <h3>modal body&l

how to get shutter actuation count from image metadata android -

i using metadata-extractor-2.5.0-rc3.jar extract metadata image. shows details except shutter count. there possibility metadata image private void prosessimage(uri uri) { try { // inputstream = new url(uri); inputstream = null; = getcontentresolver().openinputstream(uri); // convert stream data here // is.close(); bufferedinputstream bis = new bufferedinputstream(is); metadata metadata = imagemetadatareader.readmetadata(bis, true); jsonarray data = new jsonarray(); (directory directory : metadata.getdirectories()) { (tag tag : directory.gettags()) { system.out.println(tag); data.put(tag); } } system.out.println(data); // jsonarray dictionary = new jsonarray(); } catch (imageprocessingexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } } hi find tag shutte

Ansible: virt module XML error -

i'm trying define vm using virt module , xml file. task: - name: define vm using xml file virt: command=define name={{ new_vm_name }} xml={{ vm_images_path }}/{{ new_vm_xml }} remote_user: root delegate_to: "{{ hyperv }}" fails error: failed: [vm-002 -> nat] => {"failed": true} msg: (domain_definition):1: start tag expected, '<' not found /var/lib/libvirt/images//vm-002-ver1.1.0-00042.xml while works: - name: define vm using xml file command: virsh define {{ vm_images_path }}/{{ new_vm_xml }} remote_user: root delegate_to: "{{ hyperv }}" xml file same in both cases, idea of why first 1 fails? prefer using modules custom commands i'd make first 1 work. the xml parameter of virt module takes xml string, not filename. you achieve want this: - name: define vm using xml file virt: command=define name={{ new_vm_name }} xml={{ lookup('template

Jquery-ias breaking clickable row -

i using jquery 2.1.1, , have been using add 'clickable' rows returned database using this: <script type="text/javascript"> jquery( function($) { $('tbody tr[data-href]').addclass('clickable').click( function() { window.location = $(this).attr('data-href'); }); }); </script> that has been working fine. have added jquery-ias (2.1.2), , first page of returned results has clickable rows. my jquery-ias code follows: <script type="text/javascript"> $(document).ready(function() { // infinite ajax scroll configuration jquery.ias({ container : '.wrap', // main container data goes append item: '.item', // single items pagination: '.nav', // page navigation next: '.nav a', // next page selector negativemargin: 250, }); }); </script> jquery-ias working fine, pages loading

MySQL C API: check if a field exists -

i'm new mysql programming on c. need check if user exists in table. how can using c api? here's i've got, isn't working: if (mysql_query(con, "select * users username='user3'")) { finish_with_error(con); } mysql_res *result = mysql_store_result(con); if (result == null) { finish_with_error(con); } int count = mysql_field_count(con); printf("%d\n", count ); for interested, wrote using comments, , ended using. if (mysql_query(con, "select field table username='user1'")) { finish_with_error(con); } mysql_res *result = mysql_store_result(con); if (result == null) { finish_with_error(con); } mysql_row row; mysql_field *field; if (row = mysql_fetch_row(result)) { printf("%s\n", row[0]); db_pwd = row[0]; }

database - INSERT into table including foreign keys to related tables -

please if help, i have 3 tables: 1. clients; 2 accounts; 3. transactions ... i want clientid clientname , accountid accountname , insert id`s transactions , other values other fields known ... clients clientid | clientname | ... accounts accountid | accountname | ... transactions transid | account id | clientid | value | tax | total how can ... tried many many forms of insert statement didnt work i tried this: insert transactions (accountid, clientid, value) values (select accountid accountname = 'some name' accounts, select clientid clientname = 'some name' clients, 30.00 ) value reserved word in ms access. i think want this: insert transactions ( accountid, clientid, [value] ) select accounts.accountid, clients.clientid, 30.00 expr1 accounts, clients (((clients.clientname)='jimmy') , ((accounts.accountname)='mark')); you'll need rewrite sql fit tables/table names possibly worked me. you should make sur

javascript - var functionName = function() {} vs function functionName() {} -

i've started maintaining else's javascript code. i'm fixing bugs, adding features , trying tidy code , make more consistent. the previous developer uses 2 ways of declaring functions , can't work out if there reason behind or not. the 2 ways are: var functionone = function() { // code }; function functiontwo() { // code } what reasons using these 2 different methods , pros , cons of each? there can done 1 method can't done other? the difference functionone function expression , defined when line reached, whereas functiontwo function declaration , defined surrounding function or script executed (due hoisting ). for example, function expression: // typeerror: undefined not function functionone(); var functionone = function() { console.log("hello!"); }; and, function declaration: // outputs: "hello!" functiontwo(); function functiontwo() { console.log("hello!"); }

java - RecyclerView pull UP to refresh -

how can detect when recycler view @ bottom of list, , not bottom of screen, last item in recyclerview. right im using swiperefreshlayout cant set pull up. use code inside onscrolled() callback. int lastvisibleitem = ((linearlayoutmanager) layoutmanager).findlastvisibleitemposition(); int totalitemcount = layoutmanager.getitemcount(); if (lastvisibleitem >= totalitemcount - 10) { loadmore(); }

sql - count total transaction with in a date range -

i have data: tb_leave id | empid | startdate | enddate 1 | 1 | 01/02/2014 | 01/05/2014 ------ 2, 3, 4, 5 2 | 2 | 01/03/2014 | 01/03/2014 ------ 3 3 | 3 | 01/04/2014 | 01/07/2014 ------ 4, 5, 6, 7 4 | 4 | 01/03/2014 | 01/07/2014 ------ 3, 4, 5, 6, 7 5 | 5 | 01/09/2014 | 01/09/2014 ------ 9 i want return total leave in specific days. out put: total | date 1 | 01/02/2014 3 | 01/03/2014 3 | 01/04/2014 3 | 01/05/2014 2 | 01/06/2014 2 | 01/07/2014 1 | 01/09/2014 you can expand dates using recursive cte , use group by : with cte ( select startdate thedate, enddate tb_leave union select dateadd(day, 1, startdate), enddate cte startdate < enddate ) select thedate, count(*) cte group thedate (maxrecursion 0); note: assumes there not more 99 days 1 row. otherwise, add maxrecu

jquery - How to Select Specific List Items in Dynamic Bootstrap navbar menu for WordPress -

i have created dynamic bootstrap navbar menu wordpress. see menu design, please visit link: https://dl.dropboxusercontent.com/u/211935016/images/created_menu.jpg but there things still need done. top nag “special promotions” , “board certified” need have box around them stand out. see design, please visit link: https://dl.dropboxusercontent.com/u/211935016/images/original_menu.jpg here html code: <!-- menu's code twitter bootstrap --> <div class="navbar navbar-inverse container mainmenu" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">toggle naavigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar">

javascript - How To Loop Through Elements & Count Numbers? -

let's have these spans contain numbers trying fetch , count ... <span class = "apples">9 apples</span> <span class = "apples">7 apples</span> <span class = "apples">3 apples</span> <span class = "apples">6 apples</span> <span class = "apples">11 apples</span> how call on browser fetch number of apples in each span , return total number? i know basic javascript so i think id have loop through span elements , find whichever 1 has classname "apples". ha, , ... don't know after particular situation. any appreciated! thanks. you can this! store span elements class apples in var , setup total var later var apples = document.queryselectorall('span.apples'), total = 0; loop through array , use parseint function number out of textcontent of each element, , add value our total for (var = 0; < apples.length; i++) { total

display individual listView for every item in a listView -

i have form 2 listviews. when select item (parent) in left listview want display list of items (children) in right listview. this picture might clarify mean. is there simple coding approach achieve that? i'd grateful ideas! finally got working. copy items of listview 1 in dictionary, representing keys, whereas subitems (categorical entries) or values represented in form of generic lists individual contents displayed in listview 2, done listview itemselectionchanged event.

java - Building a software that listens to database changes and calls up other methods. Am I doing right architecture? -

i 2 months old software engineer. have got software piece rewritten in java. have no experience in writing industry standard code or designing applications according standards. so, chance me that! this requirement-i need write program listens mysql database new entries. if number of new entries reach threshold, listener should call class pull data database , operations on data. i read design patterns in java , came know observer pattern. think can go ahead or can write piece of code listening , don't care patterns. please let me know inputs. understand experience has lot in space. thanks using design pattern better design approach if intent correctly matched. i.e. if design pattern used right intent. helps achieve design goal of decoupling. observer pattern used implement distributed event handling systems. observer pattern key part in familiar model–view–controller (mvc) architectural pattern. looks perfect fit me problem.

xcode - Comparing image views in iOS 8 not working -

i using button multiple image view, example after clicking on button image of button change used that: if(button.imageview.image ==[uiimage imagenamed:@"addfriendpressed.png"]){ } this working in ios 7 , not ios8. solutions please? - (bool)image:(uiimage *)image1 isequalto:(uiimage *)image2 { nsdata *data1 = uiimagepngrepresentation(image1); nsdata *data2 = uiimagepngrepresentation(image2); return [data1 isequal:data2]; } use isequal : if([button.imageview.image isequal:[uiimage imagenamed:@"addfriendpressed.png"]]){ } or if([[button backgroundimageforstate:uicontrolstatenormal] isequal: [uiimage imagenamed:@"addfriendpressed.png"]]){ } or add category uiimageview

php - SELECT DISTINCT with field type 'text' and SUM(amt) -

i'm having trouble sql query: this i'm trying do: "select distinct *, sum(amt) ttl_amt table where..." two of fields of type 'text', sql not allow type selected distinct not comparable. i need group relative items , display them single row combined ttl_amt value seen above. i've tried selecting 'non-text' fields (varchar, float, int, etc) in select distinct statement , pulling 'text' fields in while() loop using sql query information not show (the 'text' fields). if need more information let me know. any ideas? i'm not expert when comes sql syntax. when using aggregate functions sum() , count() , avg() etc. outher fields within select section should either within aggregate functions or should mentioned in group by . seems want sql being that: select field1, -- can't use * here! field2, ... fieldn, sum(amt) table group field1, -- can't use * her

java - Use the jvm cacerts or own truststore when using selfsigned x.509 certificate -

i'm using selfsigned x.509 certificate encrypt client-/server communication. i'm wondering if importing self-signed certificate clients jvm cacerts truststore causes security issues. more secure create , use own truststore or doesn't matter way prefer? why there usecase create (and use) own truststores, when have possibility import (selfsigned) cert jvms truststore?

spring mvc project not working from eclipse -

i downloaded project mkyong learning spring mvc . http://www.mkyong.com/wp-content/uploads/2011/08/spring3-mvc-helloworld-example.zip when created war command line using mvn clean install , deploy war in tomcat webapp folder. works fine. when import in eclipse , run there gives me error no mapping found http request uri [/springmvc/welcome] in dispatcherservlet name 'mvc-dispatcher' tried everything.search other similar question no use. note: rather posting whole code given link project can downloaded inside eclipse , find server.xml then, @ bottom of file should find line (if not juste replace 1 have following one) <context docbase="springmvc" path="/springmvc" reloadable="true" source="org.eclipse.jst.j2ee.server:springmvc"/></host>

android - How to return the value of the function after completing AsyncTask -

i have funcation updateatserver . there asynctask. want finish background thread first , after function should return values true or false. but background thread running , getting return values of function before completing asynctask. public static boolean hasupdateatserver_deletescore = false; public static boolean hasupdateatserver_score= false; public static boolean hasupdateatserver_swing= false; public static boolean hasupdateatserver_coursedetailsholes= false; public synchronized static boolean updateatserver(context context) { new updateintoserver(context).execute(); return hasupdateatserver_deletescore && hasupdateatserver_score && hasupdateatserver_swing && hasupdateatserver_coursedetailsholes; }

ios - XCode 6 issue - dequeueReusableCellWithIdentifier not returning custom cell height -

i have uitableviewcontroller 2 prototype cells custom heights - 1 has height of 187 points , other has height of 140 points. tableview's default row height ser 187. my cellforrowatindexpath looks this: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { if (indexpath.section == 0) { mylistingcell *cell = [tableview dequeuereusablecellwithidentifier:@"mylistingcell"]; [cell initwithlisting:[self.listings objectatindex:indexpath.row]]; return cell; } else { return [tableview dequeuereusablecellwithidentifier:@"addmylistingcell"]; } } and have matching heightforrowatindexpath looks this: - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { if (indexpath.section == 0) { uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"mylistingcell"]; return cell.frame.size.heig