Posts

Showing posts from May, 2012

Prolog recursivly build list based on dot product -

hi have prolog function/predicate? takes dot product of 2 list. , use write function builds list of dot products list , list of list. basically, dot product called on each list in list of list function dot below , works. dot([], [], 0). dot([head|tail], [head2|tail2], result) :- prod = head * head2, dot(tail, tail2, remaining), result prod + remaining. this attempt @ function fails every-time try run it. can 1 help? dotall([], [[]], [0]). dotall(x, [[head]|[tail]], result) :- dotunit(x, head, prod), result = [prod|result], dotall(x, tail, result). to sum of goal, if passed in dotall([1,2,3],[[1,2,3],[4,5,6],[1,2,3]], what). back, what [15,32,15] . i know mouth full hope 1 can give me pointers on im going wrong. im new prolog. the dotall predicate believe (from example) defined be: dotall(vector, listofvectors, results) and says results list of dot product results obtained taking dot product of vector each vector in listofvectors

AngularJS - When does a service retrieve data? -

when service / factory retrieve data http request? when factory created in service, curious when http request sent, , how processed after app running time. i'm writing code using ionic framework . once initialize app, , stays open day or two, json data refreshed @ interval? or refresh data once app closed, , opened once again? my requirement http request, is updated every day @ 00:01 am. i suppose general question is: how http request fetch data? , how service work in angularjs. here code retrieve json package: angular.module('starter.services', []) .factory('menujson', function ($http) { return { : function() { return $http({ url: 'http://middmenuapi.herokuapp.com/', method: 'get' }) } } }); calls $http() (or of aliases, such $http.get() etc) invoke web request (barring manipulation inspectors or third-party components). analogous issuing xmlhttprequest or jsonp request in

oracle - CURSOR...IF...CURSOR..else condition -

i trying use cursor loop inside if condition , getting error. here details: open c_tab_var v_sql; loop fetch c_tab_var v_cur_inv_var; exit when c_tab_var%notfound; v_cur_bde in ( select distinct bde.col1, bde.col2 tab bde order bde.col1, bde.col2, bde.col3.... ) loop if v_cur_bde.col1 = v_cur_inv_var.col1 , v_cur_bde.col2 = v_cur_inv_var.col2 ( v_cur_var in ( select..... ) loop - - - ) else ( - - - ) end if; here error getting: compilation errors procedure abc error: pls-00103: encountered symbol "for" when expecting 1 of following: ( - + case mod new not null <an identifier> <a double-quoted delimited-identifier> <a bind variable> continue avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date <a string literal character set specification> <a number> <a single-quoted sql string>

java - Is JavaFX 8 going to implement text field validation support? -

javafx 2 not provide validation support (masks, input filtering , on...). difficult adopt technology not offer basic functionalities. trying implement own validators, big pain. are there news in javafx 8 validation? trying find new features, don't know search, difficult find changes in javafx 8. need know it, because considering javafx new application. answer no, javafx 8 not implement high level validation support. opinion i think unlikely comprehensive validation support ever in javafx core libraries (this personal opinion). javafx provides base library upon other libraries can implemented. javafx 2.2 provides enough support write validation libraries on top of javafx (and people have done so). there reasons why might not want validation support in javafx core libraries: as javafx part of java se , open-jfx project, must follow java release process, can quite slow @ times various reasons. 3rd party projects don't have such restrictions. things

reactjs - How to insert a `React` component after a child element? -

i trying create react component , insert after child element. here markup. <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">other <b class="caret"></b> </a> </li> i want insert react component after <a> tag, not child of <a> tag. here want like. <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">other <b class="caret"></b> </a> <ul ... react component> </ul> </li> here code adds component: react.rendercomponent(new navbardropdown(), this.$el.find('what goes here').get(0)); i not want add div id place into, how add react component in location? react needs render component onto something . place placeholder div there.

ios - How to animate/morph an menu button like the Facebook Paper app -

i saw animation/morphing in facebook paper app morph menu button, 1 when pull down menu, x , when tap it. recorded because don't know how show other way. https://www.youtube.com/watch?v=y6j_mvgv-nm can explain me how done? app. that awesome, hadn't seen before. created quick gist that: https://gist.github.com/mnmaraes/9458421 edit: it's not link, key concepts 2 methods: -(void)morphtox { cgfloat angle = m_pi_4; cgpoint center = cgpointmake(120., 120.); __weak tuiviewcontroller *weakself = self; [uiview animatewithduration:0.8 delay:0.0 usingspringwithdamping:0.6 initialspringvelocity:2.0 options:uiviewanimationoptioncurveeaseout animations:^{ tuiviewcontroller *strongself = weakself; strongself.toplineview.transform = cgaffinetransformmakerotation(-angle*5); strongself.toplineview.center = center; strongself.bottomlineview.transform = cgaffinetransformmakerotation(angle*5); strongself.bottom

html - Floating Div in IE7 -

i hoped ie7 woes over, company still supports across our enterprise, alas i'm stuck fixing glitches. must overlooking incredibly silly, , wondering if fresh set of eyes can fix. in problem, text div have suppose float along side image div, isn't working. <div id="news-container"> <div class="news-item"> <div class="news-image" style="background:url('images/site/previewimage.png') no-repeat;"> <img src="images/site/image-border.png" alt="" /> </div> <div class="news-text"> <h1>latest news</h1> <h2><a href="#">"almost, maine" tickets on sale!</a></h2> <p>text blah blah blah.</p> <div class="linkbutton redlink"><a href="#">read more</a></div> </div>

progress 4gl - How to handle numbers of prowin32.exe -

i've been doing os-command execute -p "procedure.p" -param inside loop. my question how can handle number of prowin32.exe not spawn won't consume processor , not less make fast? note: version 8.3c sample code define variable filter character no-undo. each item no-lock: assign filter = "item.item = " + item.item no-error. os-command no-wait value("c:\dlcs\83c\bin\prowin32 " + "-p c:\nanox\syte_server5\atms-configured-icons\live\nanox_utility\procedure.p " + "-pf c:\nanox\syte_server5\atms-configured-icons\live\nanox_utility\conf\pilot.pf " + "-param " + filter). end. quit. i bit differently. decide ahead of time how many threads , divvy work so: /* worker.p * * i.e.: * mbpro dbname -p worker.p -param "0,5" * mbpro dbname -p worker.p -param "1,5" * mbpro dbname -p worker.p -param "2,5" * mbpro dbname -p worker.p

mapreduce - Why can't output value of hadoop map be null? -

i want use hadoop mapreduce sort lines of log. put fields of line output key, , set output value null. when run, null pointer exception raised @ line context.write(new text(outkeystr), null); so why can't output value of hadoop map null? why output value of hadoop reduce can (i tested)? you can't use explict value null can use nullwritable class if don't care value

html - Textarea stretches parent div -

i trying display textarea inside fixed div. my code here http://jsfiddle.net/uy5b6/7/ you can see textarea stretches out div. want textarea fill div, not stretch it. use negative top margin textarea . div.modal { position: relative; /* show above textarea */ } div.modal textarea { margin-top: -24px; /* equal 'close' height */ padding-top: 24px; /* equal 'close' height */ -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; height: 100%; } now can add borders match style. you can apply following css. div.modal { position: relative; z-index: 1; /* show above textarea */ display: block; text-align: center; } div.modal textarea { position: absolute; top: 0; padding-top: 24px; /* equal 'close' height */ -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; height: 100%; }

c++ - Trying to access fmin and fmax in Qt using math.h -

i trying use basic c functions in qt without luck. i've tried both of following: #include <math.h> #include <cmath> according this , fmin , fmax should in 1 of above. cannot compile using these functions; errors "identifier not found" both of them. additionally, while can open math.h in qt, fmin , fmax functions not seem present in file when search them. qt using else these basic requirements? qt doesn't mangle c++ standard headers. environment, platform, compiler etc.? in c++ easier use std::min() , std::max() functions. templated, can use them 2 float arguments , obtain same result fmin / fmax . defined in algorithm header.

javascript - how to make jquery calendar not to pick current date from system -

i have wrong system date set on system , jquery calendar picking current date system's current date .. how make display current date internet .can please resolve issue please try code, hope should helpful you. thanks html: <input type="text" id="stdate"/> js: $(function(){ $("#stdate").datepicker({ dateformat: 'mm/dd/yy', changemonth: true, changeyear: true, yearrange: '-70:+10', constraininput: false, duration: '', gotocurrent: true}).datepicker('setdate',"0"); }); sample html page: <!doctype html> <html> <head> <title> date time </title> <meta charset="utf-8" /> <script src="http://code.jquery.com/jquery

node.js - store the temporary data in memory array or database -

just wonder if need store temporary data in memory array or database(nosql)? is there performance difference? somebody said nodejs dangerous cache data in memory, may lead memory leak. , cannot afford big data. your comment welcome there number of options storage media, best profiling specific application , making determination. may find overhead of connecting storage, storing , retrieving data outweighs improvements in memory footprint. might find opposite - need profile application know. the npm package look useful type of thing: https://www.npmjs.org/package/look .

connect sql server to pentaho -

i want make connection between database sql server , pentaho user console . before use ms sql server 2000. however, can't make connection. use 1433 port number sql server when try make connection pentaho, realize cannot detect port number 1433. version of sql server should use? can find tutorial connection. information, database sql server in 'vbox' , pentaho in local network. you can use sql server 2000. don't use driver microsoft. must use driver http://jtds.sourceforge.net/ . detail information driver, read following article : http://www.dbvis.com/doc/microsoft-sql-server-database-drivers/

ios - storing all images from camera roll as an array -

i new ios , objective-c, trying create app contains component takes of images camera roll , creates slideshow them. believe first step create array of images stored in camera roll. can create animation array. currently, have button, designated "play", when selected should display slideshow uiimageview. however, code not work right now. or suggestions appreciated. here code far: - (ibaction)play:(id)sender { nsmutablearray *allphotos= [[nsmutablearray alloc]init]; alassetslibrary *library = [[alassetslibrary alloc] init]; [library enumerategroupswithtypes:alassetsgroupsavedphotos usingblock:^(alassetsgroup *group, bool *stop) { [group setassetsfilter:[alassetsfilter allphotos]]; [group enumerateassetsusingblock:^(alasset *result, nsuinteger index, bool *stop) { if (result == nil) { return; } alassetrepresentation *representation = [result defaultrepresentation]; uiimage *image = [uiimage imagewithcgimage:[representat

angularjs - Using Angular.js $resource of $http.get to display results from json API -

i'm trying switch sourcing json locally fetching api. i've had working locally, can't seem access when requesting using api. formatting must incorrect, i'm not sure i'm searching that's incorrect. this way i've been getting json local directory before moving api: countclocks.factory('thisclock', ['$resource', function($resource){ return $resource('clocks/:clockid.json', {}, { query: {method:'get', params:{clockid:'clock'}, isarray:true} }); }]); my current json cones file called clocks.json , looks this: { "id": "ch-1", "slug": 1, "title": "ch 1 name", "content": "some text orange clocks" } i've tried switching resource url , parameters, haven't had luck. here's format changed to: countclocks.factory('thisclock', ['$resource', function($resource){ return $resource('http://www.example.org/api/get_

jquery - div's not fading in on scroll -

i have fiddle , appears work fine, when implement new blank project hidden div s no longer fading in. there i'm missing or not adding? html <div id="container"> <div>hello</div> <div>hello</div> <div class="hideme">fade in</div> <div class="hideme">fade in</div> </div> jquery $(document).ready(function() { $(window).scroll( function(){ $('.hideme').each( function(i){ var bottom_of_object = $(this).position().top + $(this).outerheight(); var bottom_of_window = $(window).scrolltop() + $(window).height(); if( bottom_of_window > bottom_of_object ){ $(this).animate({'opacity':'1'},500); } }); }); });

uitableview - iOS 7 - text in custom tableViewCell content getting cut -

i have been trying figure out past couple of hours no avail. have custom tableviewcell class use tableviewcells. have 3 labels , 2 textfields in custom class. here searchresulttableviewcell.h file: #import <uikit/uikit.h> @interface searchresulttableviewcell : uitableviewcell @property (strong, nonatomic) iboutlet uilabel *price; @property (strong, nonatomic) iboutlet uilabel *itemname; @property (strong, nonatomic) iboutlet uilabel *discount; @property (strong, nonatomic) iboutlet uitextfield *quantity; @property (strong, nonatomic) iboutlet uitextfield *discountinput; @end the text labels populated database entries. issue i'm having right when itemname long, gets cut in display. have tried setting lines property of label in storyboard 3 lines not work. have idea on how implement multiple lines in label? thank you. in customtableviewcell.m self.itemname.numberoflines = 0; // change 0 support multiple lines self.itemname.linebreakmode = nslineb

android - How to design app for Micromax funbook infinity and micromax A54? -

i have created , application want design different screen sizes.i have samsng galaxy s2(hdpi 3.5 inch) micromax funbook infinity(7 inch) , micromax ninja a54(3.5inch mdpi) xml s2 , micromax a54 same micromax accepting images mdpi both tab , ninja problem ninja a54 accepting images tab(mdpi 1280x800) , xml s2. stuck please http://developer.android.com/guide/practices/screens_support.html#range supporting multiple screen size - android call function based on device's screen size (hdpi/ldpi/mdpi) you don't have design xml file sizes,,try use matchparent , fillparent in designs

How to discover live hosts on same network using C kernel module? -

i'm writing kernel module send special packet every live host on same network host running module. i'm not totally sure how discover live hosts on same network using c kernel code. i've looked ping.c code , think discovery of live hosts. i use application level utility nmap ping , data kernel module, defeat purpose of module. ideas welcomed. thanks.

Get Items from map and add to a vector c++ -

i rote code in program jsonnode::const_iterator iter = root.begin(); (; iter!=root.end(); ++iter) { const jsonnode& arraynode = *iter; std::string type = arraynode["type"].as_string(); if(type == "node") { std::string id = arraynode["id"].as_string(); double lat = arraynode["lat"].as_float(); double lon = arraynode["lon"].as_float(); node node; node.setid(id); node.setlatitude(lat); node.setlongitude(lon); nodesmap.insert( std::pair<std::string, node>(id, node) ); } else if(type == "way") { std::string wayid = arraynode["id"].as_string(); waynode.setid(wayid); std::vector<node> collection; const jsonnode& waynodes = arraynode["nodes"]; const jsonnode& nodes = wa

ios - Deleting Table from sqlite database -

i unable delete tables sqlite database using drop table query. have tried possible solutions such [database opencloseresultset] , [resultset close] , on. adding these lines results in out of memory error , if dont write these lines program stops @ drop table statement. there no warning or error given too.even if put code in debug, debug point goes away once line executed.i using fmdatabase library while working process related sqlite.i unable find out cause of issue. have tried these links not working in case. 1) fmdb executeupdate drop command halt app 2) how remove data table using fmdb here code issue prevails. + (nsstring *) deletetable:(nsinteger) index{ nsstring *returnflag = @"success"; fmdatabase *database = nil; @try { nsstring *query = @"select name sqlite_master type = 'table'"; database = [fmdatabase databasewithpath:[dboperator getdatabasepath:databasename]]; if(database != nil && [database open]) { fmr

github - chaining builds in the TravisCI -

imagine situation on github: repo 1 repo 2 (has dependency repo 1 build artifact) where both of these have travis configured. i'd run travis build of repo 2 in case of successful travis build on repo 1 . any chance/idea how achieve that? the idea had to: create new user and in case of successful travis build of repo 1 git commit + push repo 2 . however lead dirty commit history on repo 2 . remove new user's old commits, increases complexity might error prone. sorry, it's not possible right now, can start travis-ci build on commit @ moment. obviously not ideal, can, however, in repo 2, clone git repo 1, run repo 1 unit tests in repo 2, , if fail stop repo 2 unit tests running , end build.

Draw a line using OpenGL|ES in Android NDK using C++ -

Image
i want draw line in android ndk app using opengl|es. i using following code draw line on screen. glfloat line[] = { 0,0,0, 100,100,0 }; glfloat colors[] = { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f }; glclearcolor(0.0f, 0.0f, 0.0f, 0.0f); glclear(gl_color_buffer_bit); glshademodel(gl_smooth); glvertexpointer(3, gl_float, 0, line); glcolorpointer(4, gl_float, 0, colors); glenableclientstate(gl_vertex_array); glenableclientstate(gl_color_array); glclear(gl_color_buffer_bit); gldrawarrays(gl_lines, 0, 2); glflush(); the above code paint line on screen, issue facing if change coordinates in array line e.g. glfloat line[] = { 0,0,0, 5,5,0 }; then same line drawn on screen i.e. there no change in length of line. output attched: what r

Issue in sending email to a group email using java mail -

as subject self explanatory - facing issue in sending email group email using java mail. i have gone through through several blogs & articles of no & not have precise answer or hangs in middle. can please help. here mail class you. mail going have link ftp location & text file attachment. to separate issue tried send simple mail group didn't either. i tried find answers in places java-forums.org & stack overflow found no luck. i appreciate quality time & in providing insight issue. to explain issue better- my automation framework when completes execution of test cases, sends mail me link execution report & log file attachment. audience report has expanded & need send mail group email address. when set email (to group.email@company.com) none of users in group receives mail. if send email email address or else email address works. i no logs or error & not able understand issue correctly. an insight experts in understanding issue

javascript - i am inserting date to database in the format yyyy/mm.dd -

i had problem inserting date database.my database mysql generated date automatically input field.but mysql date format yyyy/mm/dd.so want in format. plz any1 me . <tr> <td class="label"> <label for="bill-date">bill date </label> </td> <td> <input id="bill_date" class="datepicker" type="date" name="bill_date" required> </td> <script type="text/javascript"> document.getelementbyid("bill_date").value = date(); </script> </tr> check jsfiddle use format prototype below. today = new date(); var datestring = today.format("yy/mm.dd"); alert(datestring); the prototype library /* * date format 1.2.3 * (c) 2007-200

android - How to get value in second spinner and third spinner after selected first spinner and calculate -

how value in second spinner , third spinner after selected first spinner , calculate [to create simple converter] here code, there no error in code coding not run perfectly, please me guys.. public class mainactivity extends activity{ private spinner firstspinner, secondspinner, thirdspinner; private button convert; edittext input, output; double awal, numtemp; string num, hasil; arraylist<string> choosetype = new arraylist<string>(); arraylist<string> choosesuhu = new arraylist<string>(); arraylist<string> chooseberat = new arraylist<string>(); arraylist<string> choosepanjang = new arraylist<string>(); arraylist<string> choosedata = new arraylist<string>(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); firstspinner = (spinner) findviewbyid(r.id.choosetype); secondspinner = (spinner) findviewbyid(r.id.cho

javascript - JS Make function object return -

i creating function object. when run object returns undefined. instance, in jsfiddle example , when try alert(test(8)) , function runs , returns 13 when create function object, 'alert(func(8))' returns undefined. <button onclick="start()">start test</button> <script> function test(num) { alert("running..."); return num + 5; } function start(){ alert(test(8)); var func = new function("num", "test(num)"); alert(func(8)); } </script> because in second func , not return ing value of test(num) function test(num) { alert("running..."); return parseint(num) + 5; } function start(){ alert(test(8)); // return value obtained on calling test(num) <------------ var func = new function("num", "return test(num)"); alert(func(8)); } start();

Move to user defined function in asp.net code? -

i have aspx.cs code in code when programmer enters page load method, after checking condition, want jump here: datatable dt = flight.insertbooking(objbook.id, convert.toint32(viewstate["totalfare"]), objbook.recommission, objbook.commission, title, fname, lname, phone, phone, email, address, "-", "-", country, pincode, objbook.bookingid, objbook.pnrno, bookrequest.source.tostring(), objbook.msg, bookrequest.farerule[0].departuredate, objbook.markup, objbook.adminmarkup, bookrequest.origin, bookrequest.destination, bookrequest.promotionalplantype.tostring(), bookrequest.faretype, bookrequest.remarks, bookrequest.sessionid, isoneway, convert.tostring(viewstate["trnid"]), fltype, objbook.bookingstatus, objbook.status, passengers, request.userhostaddress); if (dt.rows.count > 0) wrap code in function , call 😊

java - Where to obtain trusted certificate for my applet? -

have small company website, i'd make more interesting adding there applet. i've prepared already, , when launched eclipse works correctly. when launched applet, website have warning not trusted , cannot run without adding page java exceptions. , here fun begins. i'd have applet signed in order allow customers use without changes in java configuration. i'm not planning make more applets, or other code need signing, don't need buy expensive certificates. i've tried self-signing, according java 7 policies not enough run applet. i've wanted obtain free opensource code certificate certum.eu, link doesn't work anymore. cacert not option, i've heard not trusted in browsers... there way sign applet no harm wallet? the closest thing open source certificate cacert not supported in all browsers . thawte , certum seem have stopped offering free certificates open source projects. (if want know write email certum why link dead) the thing kno

jquery - reorder the div vertically in small screen using twitter bootstrap -

on mobile template want position contact widget @ first inside sidebar. please check example. there way that <div class="container-fluid"> <div class="col-md-9"> <p>main content goes here</p> </div> <div class="col-md-3"> <div class="sidebar-nav"> <ul class="nav"> <li><a href="#" title="">overview</a></li> <li><a href="#">mission , vision</a></li> <li><a href="#">directors</a></li> <li><a href="#">management</a></li> <li><a href="#">structure</a></li> </ul> </div> <div class="contact-widget"> <h3>contact address</h3> <p>some address go here</p> </div> </div> </div> you can add 2 navigation instead of 1

excel vba - Creating workbook based on two cell value -

i have workbook "report.xlsx" in have 70 sheets (the name of 70 sheets present on list in workbook called "list.xlsx"). need create workbook based on list present in "list.xlsx". i have list this. sheet name person name fax tom tax tami rax tom max sara sax tom what need code can move sheets of workbook "report.xlsx" , create workbook based on above list eg: fax, rax & sax should copied new workbook "report.xlsx" , renamed tom. wise tax should copied new workbook , renamed tami. , same max should copied new workbook , renamed sara. thanks in advance. dear team, below code tried, still unable needed, can on this. sub copysheets() dim thiswb string dim newwb string dim endofprocess string dim m integer thiswb = activeworkbook.name on error resume next application.displayalerts = false sheets("tempsheet").delete

asp.net - Cannot find the master page used by my default page -

Image
i have sharepoint website (i did not create trying used find inside it). identifying master page in home screen in sharepoint designer 2013 can find default page , possibility edit it. after entering edit mode default page can see link master page: <%@ page language="c#" masterpagefile="~masterurl/default.master" inherits="microsoft.sharepoint.portal.webcontrols.personalwebpartpage, microsoft.sharepoint.portal,version=16.0.0.0, culture=neutral,publickeytoken=71e9bce111e9429c" meta:webpartpageexpansion="full" meta:progid="sharepoint.webpartpage.document" %> to master page here: masterpagefile="~masterurl/default.master" of course. locating master page i try go master pages section of navigation pane in sharepoint designer 2013 cannot see master page pointed default page. what missing? i don't know helps or not. have experience on sharepoint 2007. here, default master page l

savant3 - is possible to do this in php? $code->Info_.$code -

i looking @ several locations, not looking, want perform operation $tpl = new savant3(); $tpl->info_.$db_code["name"] = $db_code["info"]; $tpl->display('index.tpl.php'); php echo $this->eprint($this->info_name); is possible?. thank you. you can do $tpl->{"info_$db_code[name]"} = $db_code["info"]; see manual this: http://www.php.net/manual/en/language.variables.variable.php

jquery - Javascript - Convert dom element reference to node -

in jquery can this: var domelement = document.getelementbyid("myid"); var tmp = jquery(domelement); upon can node var node = tmp[0]; i know how can done in native javascript. regards your domelement variable node of dom tree. tmp variable wraps jquery object , [0] indexer gets dom element back. native javascript first line of code.

start mysql query with IF -

according mysql website should able start query if statement. if search_condition statement_list [elseif search_condition statement_list] ... [else statement_list] end if but when try query if (count(1) information_schema.table_constraints table_schema = 'dbname' , table_name='tblname' , constraint_name = 'con_name') alter table table drop foreign key constraint_name; end if i syntax error saying have wrong syntax near "if" , mysql workbench highlights if saying syntax error, unexpected if. i've tried begin if, , omitting both begin , end if error same. you can't use if or while conditions out side statement unless enclosed in code block of begin - end . hence db engine threw error on statement. for statement work, need stored procedure , changes statement well. example : delimiter // drop procedure if exists drop_constraint // create procedure drop_constraint( in dbname varchar(64), in tablename v

javascript - why cookies are always disabled in IE 10 -

i using navigator.cookieenabled in javascript determine whether cookies enabled or not on client. working fine on browsers except ie. please using wrong method identifying cookies there wrong ie 10 the reliable way can think of check whether cookies enabled set cookie in response server in first place, , check it's set on client via document.cookie . according this answer question , there's no point in checking cookieenabled , doesn't provide correct information. for instance, if server includes header in response serving page: set-cookie: cc=1; max-age=3600 ...then javascript code can check this: if (/\bcc=/.test(document.cookie)) { // appear enabled } else { // not }

javascript - Script element block in head but don't block in body -

Image
i use cuzillion build page script element in head: <head> <script></script> </head> <body> <img /> <img /> <img /> <img /> </body> this script element load 2 second delay, , need 3 second execute. when load page in chrome, network show net status: obviously load script block parser parse images in body. images have load after script have been loaded (may mentioned there image loaded in advance. think because webkit preloader triggered). however, when move script body , <body> <img/> <img/> <script></script> <img/> <img/> </body> it doesn't block image load under it: but why? why script block in head not in body? what's differences? if sourcing external script, can use async attribute tell browser fetch in parallel.

How to make a C# source file to be processed by the Visual Studio, but NOT compiled in the assembly? -

i have many c# script source files in project tree marked build action: none the problem is : if source file marked build action: none go declaration , go implementation , other navigation , refactoring functions of visual studio , resharper doesn't work anymore. the script files compiled csharpcodeprovider once app running , behave 100% same if in actual code base (the original executable assembly). the difference here source files not compiled msbuild, app itself. how can force visual studio/build process analyze files (as if going compiled) without including them final executable assembly? if edit main project file ( .csproj ) , add afterbuild target, can invoke custom action on post build. following example calls compile.exe build action=none items in project extension of .proj . <target name="afterbuild"> <itemgroup> <scripts include="@(none)" condition="'%(extension)' == '.proj'"

ServiceStack Service Design -

i creating new service stack application , want know if possible service stack; used message design pattern , have lot of requests dtos (about 100 request dtos); of requests inherit base request , each request dto has corresponding response dto; want generate generic service contains 4 methods get, post, put , delete; each 1 of these methods take baserequest parameter , return baseresponse return value , every concrete dtorequest determine rout; applicable in service stack; if not there alternative? public class organizationservice : servicestack.service { public baseresponse post(baserequest request) { throw new notimplementedexception(); } public baseresponse update(baserequest updaterequest) { throw new notimplementedexception(); } public baseresponse delete(baserequest deleterequest) { throw new notimplementedexception(); } public baseresponse get(basereques

javascript - Check if something was processed -

the solution needs work @ least in chrome. detect when document ready. wait, not verify document.readystatus or document.onreadystatechange . when use xmlhttprequest, instance, page "processing" something. , need exact moment when process end , trigger callback. problem don't have access xmlhttprequest implementation code. can check document status, instance. so, instance, if on page had 4 xmlhttprequest running, , 3 had end, nothing have, yet. after last 1 stop process, callback triggered.

android - Getting error while creating new int[]{} in listview -

i getting error while creating integer array: madapter = new simplecursoradapter(getbasecontext(),r.layout.lv_layout,null,new string[] { "name","photo","details"},new int[]{r.id.tv_name,r.id.iv_photo,r.id.tv_details}, 0); my code: simplecursoradapter madapter; matrixcursor mmatrixcursor; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // contacts contacts content provider stored in cursor mmatrixcursor = new matrixcursor(new string[] { "_id","name","photo","details"} ); // adapter set data in listview madapter = new simplecursoradapter(getbasecontext(),r.layout.lv_layout,null,new string[] { "name","photo","details"},new int[]{r.id.tv_name,r.id.iv_photo,r.id.tv_details}, 0); // getting reference listview list

Switching Visual Studio User - Visual Studio Premium -

Image
i want switch visual studio user got following error. i tried reset user data descriped here in this post nothing changed. reinstalled visual studio , didn't help any hint? we unable establish connection because configured user user@mydoamin.de attempted connect using user boas.enkler@mydomain.de. connect different user perform switch user operation. connect configured identity attempt last operation again. there 2 workable options use (in order): as of visual studio 2013 release 4 ensure login correctly using current user id expects first. then logout account settings option on account drop-down menu (top right, showing name) now login again using other account it appears vs not login different account while logged in. make happy first :) fallback option: need run devenv /resetuserdata @ command prompt. to run “switch user operation”: close instances of vs2013 (check task manager make sure devenv.exe not running). open develope

Call c# function of global class from javascript -

i have global function returns string. need access function javascript in 1 of pages , set returned value javascript variable. example:- var jsvariable = <%globalclass.methodreturningstring();%>; how that? you cannot call c# function this. need create web service or webmethod in order call function. please see link you. http://www.aspsnippets.com/articles/calling-aspnet-webmethod-using-jquery-ajax.aspx

php - Echo Arrays in Array -

i have array mutltiple arrays in it. tried echo each of them "array" instead of values saved inside of each arrays. my array looks this: $arrays = [['test1','test2'],['test3','test4']]; foreach($arrays $array) { echo $array, '<br>'; } i get: array array instead of test1,test2 test3,test4 you're not printing content of inner arrays - try this: $arrays = [['test1','test2'],['test3','test4']]; foreach($arrays $array) { echo implode(',', $array) . '<br>'; } oh, , why not print_r($arrays) ?

c# - Store data in workflow before bookmarking for use on resume -

is possible, somehow, persist information in workflow activity use on resuming. basically have stock standard workflow activity, call service gets list of ids back. this example... public class mygodostuffactivity: nativeactivity<bool> { public inargument<int> versionid { get; set; } public int[] jobs { get; set; } protected override bool caninduceidle { { return true; } } protected override void execute(nativeactivitycontext context) { var container = context.getextension<icontainer>(); var versionid = context.getvalue(versionid); using (var service = container.resolve<ijobsservice>()) { jobs = service.startjobs(versionid); context.createbookmark("bookmark_wait_for_jobs_versionid_" + versionid, bookmarkcallbackresult); } } private void bookmarkcallbackresult(nativeactivitycontext context, bookmark bookmark, object value) {

unit testing - dynamic value for the data provider in python -

i using lambda data provider unit test in python. if send static variable means can result. if use dynamic variable means have encountered problem. , coding class testone(unittest.testcase): data=lambda: ( ((tc.read_data_from_excel('inputdata.xls','data','datalevel1')),), ) def setup(self): self.driver =webdriver.firefox() self.driver.maximize_window() @data_provider(data) def test(self,username,password): //coding here here excel file having username , password , write method 'read_data_from_excel' retrieve data , return list. did wrong

css - How to reduce the width of textfield using jQuery mobile? -

can please tell me how reduce width of textfield using jquery mobile? fiddle using css does't work #co label{ color: red !important; width: 100px !important; margin :30px; } #co input{ width: 100px !important; border-radius: 0 !important; } #co .ui-input-text { width: 100px; }

java - Play Framework: How do I change active class on route change -

i using play framework 2 java , bootstrap helper in project , want apply active class on sidebar link click. using side nav bar navigation , default 1 link has active class on page load, thats why in every time 1 link highlighted active link, how change class="active" on route or link change, there way check route path our html scala template file. here side bar navigation code. <ul class="nav nav-list"> <li class="active"><a href="/menu1">menu1</a></li> <li><a href="/menu2">menu2</a></li> <li><a href="/menu3">menu3</a></li> </ul> here routes file get /menu1 com.demo.project.controllers.democontroller.menu1() /menu2 com.demo.project.controllers.democontroller.menu2() /menu3 com.demo.project.controllers.democontroller.menu3() please give me suggestion on it! finally go

Arithmetic overflow error for type in Sql Server 2000 -

in sql server 2000 table,there column called kpi of float type . when try convert column varchar(cast(kpi varchar(3))) ,it gives error msg 232, level 16, state 2, line 1 arithmetic overflow error type varchar, value = 26.100000. the thing column has 1 distinct value , 26.1. can not understand why show error when converting varchar! your error has triggered full stop in 26.1. you have applied command: cast(kpi varchar(3)) first: change cast varchar(3) varchar(4) (to first value after full stop) so you'll have: this line convert value 26.10000000 in 26.1 then apply varchar(26.1) not correct! varchar type wants integer value size. why apply last varchar?? think must remove external varchar , leave cast function

ios - Passing NSString from View Controller to TableViewController -

can please advise on how pass array of nsstrings viewcontroller tableviewcontroller. have tried using prepareforsegue in rootviewcontroller -(void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { tableviewcontroller *transferviewcontroller = segue.destinationviewcontroller; nslog(@"segue %@", segue.identifier); if ([segue.identifier isequaltostring:@"segueaffiliation"]) { // segue affiliation happened transferviewcontroller.titletext = @"friendly"; } else if ([segue.identifier isequaltostring:@"seguecategory"]) { // segue category happened } else if ([segue.identifier isequaltostring:@"seguefunction1"]) { // segue function1 happened } else if ([segue.identifier isequaltostring:@"seguefunction2"]) { // segue function2 happened } else if ([segue.identifier isequaltostring:@"seguefunction3"]) { // segue function3 happened } and not sure on how pass data, far have in table