Posts

Showing posts from March, 2014

Nuget sources update fails to update -

following nuget command line reference , update internal nuget source url new url. update fails. execute nuget sources output nuget.org [enabled] http://www.nuget.org/api/v2 internalfeed [enabled] http://oldserver:8888/nuget execute nuget sources update -name internalfeed -source http://newserver:8888/nuget package source "internalfeed" updated. nuget sources output nuget.org [enabled] http://www.nuget.org/api/v2 internalfeed [enabled] http://oldserver:8888/nuget expected output nuget.org [enabled] http://www.nuget.org/api/v2 internalfeed [enabled] http://newserver:8888/nuget actual output not match expected output. how can update internalfeed url? there file in root directory called nuget.config . file contained oldserver value. removed value nuget.config . update took after making said change.

keyboard down key not working if chosen dropdown height set -

i have set max height chosen dropdown using following code `.chosen-container .chosen-results { height:100px !important; }` but results in keybord down arrow key not working on press of down key scroll bar not reaches end please try setting max-height:100px instead of height.

java - Issues with javac compilation errors and Maven dependency resolution -

i'm "noob" when comes maven. i've used ant in past, not enough maven make "stick" me. here problem. i'm attempting write java program parse json files relevant information , generate csv files upload using proprietary tool uploads csv files. built project using maven. program use google gson library, listed dependency in pom file (included below). when execute "mvn compile", maven returns error indicating package maven should resolving via dependency management features doesn't exist. specific error: "error: package com.google.code.gson not exist" here pom file: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.acumen.app</groupid> <artifactid>

ios - How can I access the array saved in the for loop? (objective c) -

-(void) queryrestuarantsname { nsmutablearray* restaurantnamearray = [[nsmutablearray alloc] init]; pfquery *query = [pfquery querywithclassname:@"menus"]; [query selectkeys: @[@"resturant", @"description", @"name"]]; query.limit = 1000000; [query findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { (pfobject *object in objects) { nsstring* restaurant = [object objectforkey: @"resturant"]; [restaurantnamearray addobject:restaurant]; } }]; } currently, outside of loop, restaurantnamearray said empty. however, in loop, has objects. how can access objects outside of loop? it asynchronous code. access restaurantnamearray before receiving results findobjectsinbackgroundwithblock return empty results. so processing of data in array should happen after findobjectsinbackgroundwithblock got results. expected following code work: [self queryrestuarantsname];

android - manage fade in animation of listitems with onScrollStateChanged for a listview -

animate listview items fade-in animation, onscrollstatechanged , i have been trying out below code layoutanimationcontroller controller = animationutils.loadlayoutanimation( this, r.anim.anim2); getlistview().setlayoutanimation(controller); getlistview().setonscrolllistener(new onscrolllistener(){ public void onscroll(abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount) { // todo auto-generated method stub } public void onscrollstatechanged(abslistview view, int scrollstate) { // todo auto-generated method stub if(scrollstate == 0) { layoutanimationcontroller controller = animationutils.loadlayoutanimation( mainactivity.this, r.anim.anim2); getlistview().setlayoutanimation(controller); } } }); } how works when load

Diagnosing proxy issue with python -

so trying work python 2.7 various things require pulling data internet. have not been successful, , looking diagnose doing wrong. firstly managed pip work by defining proxy so, pip install --proxy=http://username:password@someproxy.com:8080 numpy . hence python must capable of getting through it! however when came writing .py script same have had no success. tried using following code urllib2 first: import urllib2 uri = "http://www.python.org" http_proxy_server = "someproxyserver.com" http_proxy_port = "8080" http_proxy_realm = http_proxy_server http_proxy_user = "username" http_proxy_passwd = "password" # next line = "http://username:password@someproxyserver.com:8080" http_proxy_full_auth_string = "http://%s:%s@%s:%s" % (http_proxy_user, http_proxy_passwd, http_proxy_server,

escaping - Escape Characters Aren't Working In Debugger (C#) -

Image
i'm trying use escape characters print double quote. however, program throwing error i'm trying debug it. when add watch string using escape character shows backslash being included in string literal. how use escape characters \ doesn't become part of literal? you confused debugger's behavior. vs debugger show value escape character (ex: 4\" ) in watch section , on hovering but code use 4" in picture above, can notice it's shown escape character vs displays correctly in console.

c++ - GetOpenFileName API intermittently slow on 2003 server -

when running code below on windows server 2003, there intermittent slowdowns while getopenfilename common dialog initializes. startup time varies @ around ~30 seconds. code below scratch program made exemplify problem i'm having in larger project problem exists in both. one important note, when network interfaces disabled, time taken initialize closer normal - typically ~2 seconds. enabled again, problem returns. i have put initialization time against other programs file open common dialogs (like notepad) not have same problem, or without network interfaces enabled. code: getnewfilename.h: #define _twinmain wwinmain #include "windows.h" #include <string> #include "resource.h" using std::wstring; #define isolation_aware_enabled 1 #if defined _m_ix86 #pragma comment(linker,"/manifestdependency:\"type='win32' name='microsoft.windows.common-controls' version='6.0.0.0' processorarchitecture='x86' public

See full stack trace on gulp exception -

a gulp watch task keeps throwing exception stack trace limited 10 frames, can't tell it's originating. i'm guessing must configurable somewhere can't determine where. looked in gulp.config.js , in gulp.util.js. read this report think must easier that. who knows how this? this might work gulp.on('err', function(e) { console.log(e.err.stack); });

c# - Create object by drag and drop at runtime in unity -

i have create object dragging button @ run time. have searched lot still can't find solution. i creating object clicking button using following sample code. have drag , drop. my code is: using unityengine; using system.collections; public class createsphere : monobehaviour { public void onclick() { gameobject sphere = gameobject.createprimitive (primitivetype.sphere); sphere.transform.localscale = new vector3(3.0f, 3.0f, 1.0f) ; //transform.translate(0, 0, time.deltatime); sphere.transform.position = new vector3 (4, 0, 0); } } onclick not dragging, click. drag need have drag handlers using unityengine; using unityengine.gui; using unityengine.eventsystems; using system.collections; public class createsphere : monobehaviour, ibegindraghandler, idraghandler { gameobject sphere; public void onbegindrag(pointereventdata data) { // begin dragging logic goes here sphere = gameobject.createprimitive (primitivetype.sp

java - Calculate the distance between two points -

i tried following code.but gives 2 errors.i want calculate distance between 2 points formula line , display result in textview1 . not know did make mistake in code? cal.java import android.view.view; import android.content.context; import java.lang.math; public class cal extends view { cal(context context){ super(context); } public double result; double parameter = ((10-80)^2) + ((15-90)^2); public void cal(){ result = math.sqrt(parameter); } } mainactivity.java import android.app.activity; import android.os.bundle; import android.widget.textview; public class mainactivity extends activity{ cal cal; textview textview; public void oncreate(bundle s){ super.oncreate(s); setcontentview(r.id.textview1); cal = new cal(this); textview.settext(cal).; } } errors: gradle: failure: build failed exception. what went wrong: execution failed task ':www:compiledebug'. compilation failed; see compiler e

node.js - How to check if user is already logged into instagram -

i using node.js, express, , mongodb instagram app. have found many times know whether or not user logged instagram (be through app via instagram-node authentication or through instagram's actual website). is there easy way this? i ended using passport solve problem. passport conveniently takes care of handling instagram authorization , include example app see how works. https://github.com/jaredhanson/passport-instagram/blob/master/examples/login/app.js function ensureauthenticated(req, res, next) { if (req.isauthenticated()) { return next(); } res.redirect('/login') } is useful since can placed @ top of routing file , routes underneath first check see if user authenticated.

php - Method overiding and inheritance -

this question has answer here: access level class must public error in php 3 answers override public method in subclass in way restricts public access while still allowing access parent class? 1 answer the code below: class { public function foo() {} } class b extends { private function foo() {} } gets me error :"access level b::foo() must public (as in class a)" why can't override class foo method in class b private? rules of access specifiers in method overriding the rule says: "the subclass overridden method cannot have weaker access super class method".

ruby on rails - mongodb unable to create/save double-byte languages -

i have model called review.rb class movienews::review include mongoid::document include mongoid::timestamps include mongoid::userstamp include mongoid::search field :story, type: string end when create instance of class review , tried saving local language telugu in field, im getting wrong output. ex1: review = movienews::review.new review.story = "నటవర్గం" after pasting here it's spelling goes worng "నటవర్.." review.save => true does mongodb supports local languages create collection? please me out. kumar try this review.story = "నటవర్గం\" after pasting here it's spelling goes worng \"నటవర్.." looks breaking both moments when use quotation marks without backslash

macros - Complete code for detecting the keypress q in javascript -

this question has answer here: simplest way detect keypresses in javascript 3 answers is there way detect when press letter q in javascript. working on keyboard macro league of legends press key upon letter q being pressed. have code key being pressed in applescript not sure if send key ingame. address issue myself. need complete javascript code detecting q since don't know syntax well. try this <html> <head> <script type="text/javascript"> function getkeystroke(e){ var keystroke; if(window.event){ // ie keystroke = e.keycode; }else if(e.which){ // netscape/firefox/opera keystroke = e.which; } alert(string.fromcharcode(keystroke)); } </script> <body> <form> <input type="text" onkeyp

mysql - Haversine Formula works as Normal SQL but not in stored procedure -

Image
i using haversine formula find distance between users. works normal mysql piece of code. when use same in stored procedure not working , throws 0.00 distances. don't know why? this working code: drop temporary table if exists temp_tab; create temporary table temp_tab(temp_id integer not null auto_increment primary key, user_fb_id bigint(20) unique,distance double(15,8) default null) charset=utf8; insert temp_tab (user_fb_id, distance) select * (select user_fb_id, 6371 * acos(sin(radians( 11.01684450 )) * sin(radians(`latitude`)) + cos(radians( 11.01684450 )) * cos(radians(`latitude`)) * cos(radians(`longitude`) - radians( 76.95583210 ))) `distance` `user_login_log` user_id <>'1831820984' having `distance` <= 50 order `activity_at` desc) t1 group user_fb_id; select * temp_tab; normal sql output: stored procedure output: stored procedure: delimiter ;; create definer=`up_beta`@`127.0.0.1` procedure

javascript - How to decrease number [value] before post? -

i not sure possible if user type numbers in input, want decrease number in hidden before post? example if type 1 output 0 or if type 2 output 1 <input class="decrease" type="text" name="number" value="" /> <input class="output" type="hidden" name="number" value="//decrease number//" /> hope 1 helps. $(document).ready(function(){ $('.decrease').keyup(function(){ if($('.decrease').val()!="") { $('.output').val($('.decrease').val()-1); } else { $('.output').val(""); } }); }); you have make sure user types in numbers. if user types in character, value of hidden input nan. see documentation more examples , information.

php - Retrieve data within <div> tag using Ajax/jQuery (Inline text edit) -

i've been working on problem few hours, there mistake somewhere in javascript file (i believe), can't figure out. right alert(msg) gives me undefined index: headline/text in editpost.php . the following php code in file profile.php . want retrieve data within <div>i want data</div> tags (i.e. want retrieve data in $row['headline'] , $row['text'] . while ($row = mysqli_fetch_array ($resultpost, mysqli_assoc)) { echo '<h1><div contenteditable="true" data-headline="headline" data-id=' . $row['id'] . '>' . $row['headline'] . '</div></h1>'; echo '<p><div contenteditable="true" data-text="text" data-id=' . $row['id'] . '>' . $row['text'] . '</div></p>'; } this how try retrieve data (seperate .js file): $(document).ready(function() { $('body').on('blur'

c# - value cannot be null in wcf using xml -

i'm triyng converto string xml when code running "value cannot null" how cani fix ? project run in windows phone 8 public string baslıkbul(baslıkı ba) { sqlconnection bag = new sqlconnection(configurationmanager.connectionstrings["baglantı"].connectionstring.tostring()); bag.open(); sqlcommand yap = new sqlcommand("select baslık ad=@ad",bag); yap.parameters.addwithvalue("@ad", ba.ad); yap.executenonquery(); sqldataadapter da = new sqldataadapter(yap); dataset ds = new dataset(); da.fill(ds); string s = ds.getxml(); /// line running xmlreader okuyucu = xmlreader.create(new stringreader(s)); while(okuyucu.read()) { if(okuyucu.nodetype==xmlnodetype.element) { switch(okuyucu.name) { case"baslık": s = convert.tostring(okuyucu.readstri

php - How can I connect a value of one mySQL table to a value of another table? -

i have 2 tables in mysql database: table "animals": | animal | name | |:-----------|------------:| | cat | tom | | dog | | table "orders": | id | animal | |:-----------|------------:| | 1 | cat | | 2 | dog | at first select table "orders" following data: <?php $pdo = database::connect(); $sql = 'select * orders order id asc'; foreach ($pdo->query($sql) $row) { echo ('<td>a:'.$row['id'].'</td>'); echo ('<td>b:'.$row['animal'].'</td>'); echo ('<td>c:'.$row['animal'].'</td>'); } database::disconnect(); ?> now want check if in mysql table "animal" animal has name . if yes print @ position b name . if there no name print animal : | a:1 |

c# - User!Language vs CurrentThread -

for formatting our dates in rdl-files, use following format: =first(formatdatetime(fields!somedate.value, 2)) according page , should take computer's regional settings. the problem is: if call reporting-service via service , try set language: rs.setexecutionparameters(mapparameters(report.parameters).toarray(), "de-ch"); this gets ignored. tried override thread-cultures via system.threading.thread.currentthread.currentuiculture = new system.globalization.cultureinfo("de-ch"); system.threading.thread.currentthread.currentculture = new system.globalization.cultureinfo("de-ch"); which gets ignored well. whats string: reporting-server has de-ch culture well, keeps using english date-format. can tells me what's meant "computer's regional settings" , why reporting-service refuses take passed culture? edit: language in report is =user!language generally said i'd pass report-language outside, via currentthread

Facebook post page feed as page admin -

var message = 'test'; var picture = 'http://l.yimg.com/f/i/tw/ks/show/120604_mntl01.jpg'; var link = 'https://www.youtube.com/watch?v=bil8px1ds3c'; var name = 'great'; var description = 'des'; fb.api('/1437247769881131/feed', 'post', {message: message, picture: picture, name: name, description: description },function (response){ if (!response || response.error) { alert('error occured'); } else { alert('post id: ' + response.id); } }); i tried posting test message fan page wall , become visitor post(on left) how post wall , if change admin fan page admin ,it pop dialog [you're using facebook page] [to continue, you'll need switch using facebook 談政宏 using facebook 談政宏.] so change person admin , can post visitor post how can post page admin ? you need use page token post "as

python - how to iterate from index n to m of an OrderedDict? -

this question has answer here: slicing python ordereddict 5 answers i have ordereddict , iterate on subset of elements, index n m .i can simple way: from collections import ordereddict d = ordereddict() in range(10): d[i] = n = 3 m = 6 c = 0 in d: if n <= c <= m: print(d[i]) c += 1 but looking more compact, similar slicing lists: n = 3 m = 6 l = [i in range(10)] in l[n:m+1]: print(i) is there such mechanism ordereddict ? it depends on how ordereddict created ( n , m need consider index of items in d ), how this: d.values()[n:m]

c# Bits order in byte -

hello i'm trying understand how or set bit , i'm stuck in bit order. let's have number 70 01000110 . want change first bit true becomes 11000110 198 . don't understand or i'm confused methods found. public static void set(ref byte abyte, int pos, bool value) { if (value) { //left-shift 1, bitwise or abyte = (byte)(abyte | (1 << pos)); } else { //left-shift 1, take complement, bitwise , abyte = (byte)(abyte & ~(1 << pos)); } } public static bool get(byte abyte, int pos) { //left-shift 1, bitwise and, check non-zero return ((abyte & (1 << pos)) != 0); } in these methods when want change first bit have pass position 7 guess index of last of 8 bits. why that? why first bit in byte changed index of last? why first bit in byte changed index of last? basically, bits referred such least-significant bit bit 0, next bit 1 etc. example: bit: 76543210 value: 0

WSO2 API Manager Custom Routing -

Image
is there way dynamically set endpoints in wso2 api manager other configured production , sandbox urls? in case, want route based on incoming header value; resulting in like: https://my_dynamically_determined_subdomain.my_static_domain.com i tried doing custom handler class writes desired url "to" header, doesn't seem affect routing. is there way accomplish this? your approach seems good. can set "to" header dynamically. have use default endpoint , instead of http endpoint . default endpoint send message url found in "to" header. please modify insequence of api configuration (found in $am_home/repository/deployment/server/synapse-configs/default/api/your-api.xml) replace http endpoint default endpoint, shown below. if want of apis, can edit velocity_templates.xml apis published default endpoints automatically. please refer this doc more details on this. worth have @ blog post discussing similar pattern trying do.

c# - Ignoring CSV rows with no data -

i'm surprised haven't seen on here (or maybe missed it). when parsing csv file, if there rows no data, how can/should handled? i'm not talking blank rows, empty rows, example: id,name,quantity,price 1,stuff,2,5 2,things,1,2.5 ,,, ,,, ,,, i using textfieldparser handle commas in data, multiple delimiters, etc. 2 solutions i've thought of either use readline instead of readfields, remove benefits of using textfieldparser, i'd assume, because i'd have handle commas different way. other option iterate through fields , drop row if of fields empty. here's have: dttexceltable = new datatable(); using (textfieldparser parser = new textfieldparser(filename)) { parser.delimiters = new string[] { ",", "|" }; string[] fields = parser.readfields(); if (fields == null) { return null; } foreach (string columnheader in fields) { dttexceltable.columns.add(columnheader); } while (true) {

recursion - Recursive Observer Dependencies? -

my model tree structure position of child object relative parent. basically, looks this: var node = ember.object.extend({ parent: null, location: null, absolutelocation: ember.computed('location', 'parent', 'parent.absolutelocation', function() { var parent = this.get('parent'); if(parent) { return this.get('location') + parent.get('absolutelocation'); } else { return this.get('location'); } }) }); the parent property instance of node class. in theory, should recursively update children's absolutelocation when parent's location updated. however, not i'm seeing. right in app have location , absolutelocation of -39 main node, location of -116 child , absolute location of -56 same child. doesn't add up. could there's bug in ember somewhere, or on wrong track in finding issue? note have simplified above example, in reality ember data object , location two-dimensio

javascript - How to trigger enter after changing input field -

i wondering how change value of something, take 15 example, , entering straight after manually. looked on things "trigger" confused me. <input class="paging_input" data-se="trade-inventory-input-page" type="text"> you want trigger change value of input , simulate enter key press. let's have in html file: <input id="someid" type="text" /> and should write in js file: function simulateenterpress(element) { var e = $.event("keypress"); // create keypress event e.which = 13; // set pressed key "enter" element.trigger(e); // trigger event } function doaction() { var inputelement = $("#someid"); // input element inputelement.val(/* somevalue */); // set value of input simulateenterpress(inputelement); } after enter key keypress event triggered , processed keypress event handler.

java - Why do I get an error "The method ... is undefined for the type..."? -

i've build method takes strings input parameter. in index.jsp page, retrieve get-variable url using request.getparameter() . now, want call aforementioned method on string, compiler error saying: the method <method name> (string) undefined type __2f_<webapp name>_2f_src_2f_main_2f_webapp_2f_index_2e_jsp ". does know why error , how can rid of it. appreciated! my code rather lengthy, think relevant code: categorie = request.getparameter("categorie"); if (categorie.equals("")) { categorie = "category;"; } arraylist<string> categorieen = querycategories(categorie); you calling arraylist<string> categorieen = querycategories(categorie); , did not define querycategories method. since jsp page compiled big servlet class, tries locate querycategories method member of class , not find it.

c# - Xml serializing dynamic string to boolean -

below instance of simple job scheduler parses xml dynamic strings json: xml <navigations> <navigation name="facebook" active ="0" ></navigation> </navigations> c# list<navigationdata> nds = new list<navigationdata>(); foreach (object cnav in (ienumerable)c.navigations) { navigationdata nd = new navigationdata(); nd.name = (string)((dynamic)cnav).name; nd.active = xmlconvert.toboolean((string)((dynamic)cnav).active); // 3 nds.add(nd); } transitcontent.navigationdata = jsonconvert.serializeobject(nds); the above program throws exception @ line 3 as: failed convert string boolean xmlconvert.toboolean not able recognize string convert.toboolean an other type conversions possibele in scenario? expected result should be: json [ { "name": "facebook", "active": false } ] well yes, "0" isn't valid value boolean. soun

c - If condition and logical comparision not working -

struct data_struct* search_in_list(char *val, struct data_struct **prev) { char *dat=null; char *dat2=null; struct data_struct *ptr = head; struct data_struct *tmp = null; bool found = false; printf("\n searching list value [%s] ...found is.%d\n",val,found); while(ptr != null) { printf("\n ptr !=null .....searching list value "); dat = ptr->val; dat2 = val; printf("hello world %s.......%s",dat,dat2); **if (dat == dat2) printf("hello !!!");** found = ( val == ptr->val); printf("the data is%d",found); if (found) { printf("\n ptr val if......searching list value [%s] ",ptr->val); found = true; break; } else { printf("\n else found....searching list value [%s] ",ptr->val); tmp = ptr; ptr = ptr->next; } } if(true == found)

java - Google Maps error in Android Studio -

i use google maps in android studio. working fine in console, have error: 07-02 10:53:54.191 29293-29293/com.home.smart.home e/dalvikvm﹕ not find class 'android.app.notification$bigtextstyle', referenced method com.google.android.gms.common.googleplayservicesutil.zza 07-02 10:53:54.192 29293-29293/com.home.smart.home e/dalvikvm﹕ not find class 'android.app.appopsmanager', referenced method com.google.android.gms.common.googleplayservicesutil.zza 07-02 10:53:55.831 29293-29293/com.home.smart.home e/dalvikvm﹕ not find class 'android.app.appopsmanager', referenced method com.google.android.gms.common.ij.a 07-02 10:53:55.868 29293-29293/com.home.smart.home e/dalvikvm﹕ not find class 'android.app.notification$bigtextstyle', referenced method com.google.android.gms.common.ij.b i have included lib in gradle compile 'com.google.android.gms:play-services:7.5.0' without full stack trace can't sure, suppose trying use big notifica

Where to store GAE / Google Cloud SQL database credentials? -

i'm setting php application using google app engine , cloud sql. have running, wondering should securely store database credentials php uses when connecting cloud sql. i keep credentials in php file "require_once" whenever need connect database. file contains credentials not listed in app.yaml, don't think can accessed, i'm not sure i'm new google app engine. thanks! best practice suggest store them "in environment" , not in code - because vary between deployment environments (dev vs live) for app engine can define environment variables in app.yaml, or in "included" yaml file, or on command line when deploying. i realise lot of input. read this: http://12factor.net/config good luck!

r - NA values not being excluded in `cor` -

to simplify, have data set follows: b <- 1:6 # > b # [1] 1 2 3 4 5 6 jnk <- c(2, 4, 5, na, 7, 9) # > jnk # [1] 2 4 5 na 7 9 when try: cor(b, jnk, na.rm=true) i get: > cor(b, jnk, na.rm=t) error in cor(b, jnk, na.rm = t) : unused argument (na.rm = t) i've tried na.action = na.exclude , etc. none seem work. it'd helpful know issue , how can fix it. thanks. read ?cor : cor(x, y = null, use = "everything", method = c("pearson", "kendall", "spearman")) it doesn't have na.rm , has use . an optional character string giving method computing covariances in presence of missing values. must (an abbreviation of) 1 of strings "everything" , "all.obs" , "complete.obs" , "na.or.complete" , or "pairwise.complete.obs" . pick one. details of each in details section of ?cor .

database - Jitterbit - "ORA-12504, TNS:listener was not given the SID in CONNECT_DATA" -

Image
issue: we're attempting upserts salesforce lawson (oracle) database client, using jitterbit. using oracle [jdbc] driver on default port. have jitterbit agent running on windows server 2008 on machine inside client's network, , assured client (but not 100% certain) server can connect lawson database. when try initiate connection oracle database within jitterbit studio (studio not running windows server, we're running local machine) we're refused with: listener refused connection following error: ora-12504, tns:listener not given sid in connect_data the question i'm hoping can is - listener lacking sid for? i'm familiar on basic level listener.ora , how sid information needs provided listener allow incoming connections database. does sid in error refer to: the lawson database? (this seems unlikely, understanding listener referred here listener sitting on server lawson database) the machine agent sitting on (the windows server 2008)? or local mac

osx - Programmatically find the name of referenced pictures in Word documents -

while writing thesis had somehow renamed 1 of referenced picture files made word tell me not show referenced picture. had long since forgot picture showing... how can find name of referenced picture file? i running office 2011 on mac, , docx file (openxml). i don't know vba, after remembering docx zipped xml file came following python solution listing referenced pictures: import sys,xml.dom.minidom; zipfile import zipfile; z=zipfile(sys.argv[1]); f=z.open("word/document.xml"); doc = xml.dom.minidom.parse(f); e in doc.getelementsbytagname("pic:cnvpr")]; print e.attributes["name"].value if saving word-pictures can call on document: $ word-pictures ../thesis.docx aurora_screen_reference.png grid2aib.jpg __media-query-css3.tiff __dom_html.tiff aurora_screen_reference.png interaksjonsskisse_science_full_rwd_breaking.png.tiff motivasjonsprisme.png evacprepbackgrnduk1-forside.tiff sattrackingmapa3__bilde.tiff volcgraph-forside.

iOS: Keyboard close down form objects Swift -

Image
i have login screen controller few form objects. when user click form objects, ios keyboard appearing on login button and have click other area close keyboard click login button login. how slide these form objects when keyboard appear? you can set notifications : [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(keyboardwillshow:) name:uikeyboardwillshownotification object:self.view.window]; and set notification hide keyboard : [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(keyboardwillhide:) name:uikeyboardwillhidenotification object:self.view.window]; and call these functions , set thing want. move view animation when keyboard shown , move view down animation when keyboard hides. can set these animations using function : animatewithduration

objective c - Create NSMutableArray by a NSString value -

how can create nsmutablearray (name) dynamically nsstring value? e.g. nsstring *stringname = @"helloarray1"; then create nsmutablearray "helloarray1" dynamically. e.g. nsmutablearray * (--here stringname / helloarray1---) = [nsmutablearray new]; and nslog: nslog(@"%@", (--here stringname / helloarray1---) ); thanks help i think that's not possible. better set dynamically object. example: nsmutabledictionary *variables = [nsmutabledictionary new]; (int = 0; < 10; i++) { nsmutablearray *temp = [[nsmutablearray alloc] initwithobjects:@"1", @"2", nil]; [variables setobject:temp forkey:[nsstring stringwithformat:@"value_%d", i]]; } nslog(@"%@", [variables objectforkey:@"value_1"]);

xcode - How can I launch the iOS Simulator from Terminal? -

i can build using xcode command line tools, there way can run application using them? (e.g. equivalent pressing cmd+r in xcode) first decide device want use: xcrun simctl list this give list of devices: -- ios 9.0 -- iphone 4s (56632e02-650e-4c24-aaf4-5557fb1b8eb2) (shutdown) iphone 5 (acd4db7b-9fc9-49d5-b06b-ba5d5e2f5165) (shutdown) iphone 5s (a8358b76-ad67-4571-9eb7-fff4d0ac029e) (shutdown) iphone 6 (1d46e980-c127-4814-a1e2-5be47f6a15ed) (shutdown) iphone 6 plus (fd9f726e-453a-4a4c-9460-a6c332ab140b) (shutdown) choose id (eg. fd9f726e-453a-4a4c-9460-a6c332ab140b) want (you can create own device using xcrun simctl create if want). boot simulator device (replacing your-device-id id) /applications/xcode.app/contents/developer/applications/simulator.app/contents/macos/simulator -currentdeviceudid <your-device-id> now should able use simctl install , launch commands. xcrun simctl install <your-device-id> <path-to-application

jquery - Backbone $el is not synced with dom -

view bind self change event (it's input). after re-render $el keeps reacting event, $el.val() returns previous value. when in debug mode search element $(...).val() returns valid value. i thought somehow unbinded dom, when rerender again , vie sets $el.val(...) it's set well. how happen? p.s. view removed , appended on re-renedr , delegateevents called in render method the issue in adding subviews not this.$el.append this.$el.after

python - Way to view, filter, and sort database tables in Django -

i building app work in django (they having me learn on own). need display database table filter/search criteria above it, along clickable columns sort rows these fields. there thousands of rows, need pagination. again, brand new django, have feeling there lot of existing functionality type of thing, i'm not sure how find it, or looking exactly. looking app install? built-in template? not related django else? want similar modeladmin template - identical, in fact, though i've heard not reusable. pointers wonderful. this seems looking datatables. check django-datatable-view , django-datatable

lotus notes - Is there a way to automatically answer a dialog box using formula coding? -

is there way automatically answer dialog box using formula coding? in ibm notes domino - have formula code behind button automatically answer dialog box. possible? avoid "would save?" dialog box. save document after changed fields in button. @command([editdocument]; 1); field counter := counter + 1; @postedcommand([filesave]); @postedcommand([editdocument]; 0);

javascript - How to move every 4 elements to another container with jQuery? -

so have markup: <section class="oldcontainer"> <article></article> <article></article> <article></article> <article></article> <article></article> <article></article> </section> <section class="newcontainer"></section> <section class="newcontainer"></section> and i'd move <article>'s oldcontainer newcontainer , newcontainer can have no more 4 <article>'s each. how can done jquery? know how wrap elements in situation, not move them :) if newcontainer elements present then, move them var $as = $('.oldcontainer article'); $('.newcontainer').each(function(i) { $(this).append($as.slice(i * 4, (i + 1) * 4)) }); .oldcontainer { min-height: 5px; border: 1px solid red; margin-bottom: 5px; } .newcontainer { min-height: 5px; border: 1px solid green; margin-

Devexpress gridview focused to next row by enter -

hi i'm using devexpress . i have gridview , want when press enter go down cell of gridview cell.i hope explain . thank you raise processgridkey gridcontrol event : private void dgv_processgridkey(object sender, system.windows.forms.keyeventargs e) { gridcontrol grid = sender gridcontrol; keypress(grid.mainview, e); } private void keypress(baseview sender, keyeventargs e) { var view = (gridview)sender; if (e.keydata == keys.enter) { e.handled = true; dgv.begininvoke(new action(() => { view.closeeditor(); view.movenext(); }), null); } }

php - SEO friendly URL instead of query string .htaccess -

how can modify .htaccess file , seo friendly urls instead of query string. want achieve 3 goals: localhost/example/products/ instead of localhost/example/products-list.php localhost/example/products/38/ instead of localhost/example/products.php?id=38 localhost/example/products/38/red/ instead of localhost/example/products.php?id=38&color=red on post @anubhava helped me lot , have right second point: rewriteengine on rewritebase /example # external redirect actual url pretty 1 rewritecond %{the_request} /products(?:\.php)?\?id=([^\s&]+) [nc] rewriterule ^ products/%1? [r=302,l,ne] # internal forward pretty url actual 1 rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^products/([^/]+)/?$ products.php?id=$1 [l,qsa] the second point works want know have put other rules, before or after. put right after other rule, it's not working because redirects previous url localhost/example/products/38/ : # external redirect actual u

javascript - Node JS Promise.all and forEach -

i have array structure exposes async methods. async method calls return array structures in turn expose more async methods. creating json object store values obtained structure , need careful keeping track of references in callbacks. i have coded brute force solution, learn more idiomatic or clean solution. the pattern should repeatable n levels of nesting. i need use promise.all or similar technique determine when resolve enclosing routine. not every element involve making async call. in nested promise.all can't make assignments json array elements based on index. nevertheless, need use promise.all in nested foreach ensure property assignments have been made prior resolving enclosing routine. i using bluebird promise lib not requirement here partial code - var jsonitems = []; items.foreach(function(item){ var jsonitem = {}; jsonitem.name = item.name; item.getthings().then(function(things){ // or promise.all(allitemgetthingcalls, function(things){ th

java - how does "null" works ? is its value a constant? -

this question has answer here: what null in java? 14 answers can tell binary value null? know jvm dependent can tell me how works ? how jvm allocate address null? stays constant throughout until system restarts? 'null' in java or in programming language empty initialization don't have nulls consume memory space.it refer variable value pointing null value created in memory. for example: string nullstring = null ; declares 16 byte memory point null value. even though u mean null memory used reference variable in case nullstring later. **let wanna string nullstring = "10"; //still time consumes same bytes because declared value pointer changed time!** to honest handling null , jvm or c driven jvm thing or c no wonder.because , driven form c except java added own high level abstraction manage thing memory! null pointer in c

python - howto get fit parameters from seaborn distplot fit=? -

i'm using seaborn distplot (data, fit=stats.gamma) how fit parameters returned? here example: import numpy np import pandas pd import seaborn sns scipy import stats df = pd.read_csv ('requestsize.csv') import matplotlib.pyplot plt reqs = df['12 web pages'] reqs = reqs.dropna() reqs = reqs[np.logical_and (reqs > np.percentile (reqs, 0), reqs < np.percentile (reqs, 95))] dist = sns.distplot (reqs, fit=stats.gamma) use object passed distplot : stats.gamma.fit(reqs)

jquery - How to get Javascript clock to increment based on a button click -

i have following piece of javascript displays digital clock on webpage. creating web based interactive story based on day in office. everytime user clicks button proceed onto next part of story want increment clock 30 minutes. clock showing real time. ideally need start @ 9:00 story increment user goes through. i have absolutely no idea how , new javascript, can help! function displaytime() { var currenttime = new date(); var hours = currenttime.gethours(); var minutes = currenttime.getminutes(); var seconds = currenttime.getseconds(); var meridiem = "am"; // default if (hours > 12) { hours = hours - 12; // convert 12-hour format meridiem = "pm"; // keep track of meridiem } if (hours === 0) { hours = 12; } if(hours < 10) { hours = "0" + hours; } if(minutes < 10) { minutes = "0" + minutes; } if(seconds < 10) {

android - java.lang.NullPointerException in Handler on dispatchMessage -

i'm new in android programming , have sporadic error in handler service. log error is: java.lang.nullpointerexception @ com.rafag.taxialerta.radartaxiservice$buzonmensajetareaubicaciones.handlemessage(radartaxiservice.java:105) @ android.os.handler.dispatchmessage(handler.java:106) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5212) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:602) @ dalvik.system.nativestart.main(native method) my code is: private handler puentetareaubicaciones; static class buzonmensajetareaubicaciones extends handler { private final weakreference<radartaxiservice> wr; buzonmensajetareaubicaciones(radartaxiservice srv) { wr = new weakreference<>(srv); }

regex - Regular expression for handling comma separated list with irregular quotes -

i receiving pretty ugly data source , need address issue regular expression. asking provider clean data source not possible. data looks this: string 1, string 2,,"string,4",string 5 there 2 complications here, see it. need match empty string in 3rd field , need capture "string,4" 4th field. hardest part has been trying figure out how handle comma in quotes. have been playing around lookahead/lookbehind assertions haven't had luck. also, while not positive, need assume field can quoted time , expect line such 1 below , not expect consistent: string 1, "string,2",,string 4,string 5 anyone have suggestions? this works me. let me know if needs improved ((?:".*?")|[^,"]*)

javascript - How to keep index straight when ajax request are async and not finishing in order -

i interacting vimeo oembed api getting videos. context have multiple events each set of videos. keeping page load times down getting first set of videos rather loading of them. this function takes 4 parameters , gets video, returning result calling function loading. videourl http://www.vimeo.com/videoid , index based on .each in calling function iterating through available id's, count total number of videos called , callback handles data getting calling function. once function done calls showfirstvideo shows video first thumbnail generating. the issue having because ajax calls async, indexeq var jumps around. instead of: 0, 1, 2, 3, 4 ... 1,6,3,0... i need indexeq increment in order @ end can run showfirstvideo function @ appropriate time. function loadvideo(videourl, index, vidscount, callback) { var indexeq = index; $.when( $.ajax({ type : "get", url : "http://www.vimeo.com/api/oembed.json",

Link to section not working on HTML-rich Outlook email -

i sending email table lists system exceptions catch. each row, error should link corresponding row on next table full stack trace. so, created link (consider error code 999 , example): <a href="#e999">error 999</a> and, target section this: <h2 id="e999" name="e999">error 999</h2> the email sent perfectly, , displayed correctly, link doesn't work @ outlook. have gone view source , copy pasted html file test on chrome, , works fine! on research found stackoverflow answer containing tried . any ideas? there microsoft support page regarding how add hyperlink email message . reading it, you'll find wanted, in other words, insert bookmark in current message . as way troubleshoot issue, follow steps, , create bookmark manually, test if work... , worked! so, why did work? viewing generated working source code, you'll find difference: seems outlook support anchors targets : link section: <a hr