Posts

Showing posts from June, 2014

objective c - Ask to send crash report in ios? -

i writing codes project can not use several crash reporting tools due privacy issue. searching manage send email having crash report if crash occurs without involvement of third party reporting tool. in application delegate declare api like: void uncaughtexceptionhandler(nsexception * exception) { // here can: // 1. set boolean in user defaults app crashed. // 2. dump data (below) in file in documents directory. nslog(@"uncaught exception: %@", exception.reason); nslog(@"crashsymbols: %@", exception.callstacksymbols); } then set in "application:didfinishlaunchingwithoptions:": nssetuncaughtexceptionhandler(&uncaughtexceptionhandler); then when application next launches, if boolean (1) set in user defaults, read data (2) , email.

python - scipy: minimize vs. minimize.scalar; return F versus return F**2; shouldnt make a difference? -

i found behavior cannot explain. miss ? i have implicit function: def my_cost_fun(x,a,b,c): # x scalar; variables provided numpy arrays f = some_fun(x,a,b,c) - x return f i minimize function using: optimize.fsolve(my_cost_fun,0.2,args = (a,b,c)) optimize.brentq(my_cost_fun,-0.2,0.2,args = (a,b,c)) or mimimize function: optimize.minimize(my_cost_fun,0.2,args = (a,b,c),method = 'l-bfgs-b',bounds=((0,a),) the strange thing is: if use return f brent_q method , fsolve give same result , %timeit measures fastest loop ~ 250 µs l-bfgs-b (and slsqp , tnc) not change x0 @ , provides wrong result if use return f**2 : fsolve returns right solution converges slowly; 1.2 ms fastest loop l-bfgs-b returns right solution converges slowly: 1.5 ms fastest loop can explain why ? as mentioned in comments: here 1 possible explaination of why l-bfgs-b not working when use return f : if value of f can negative, optmize.minimize try find...

windows - package-refresh-contents hangs at Contacting host: elpa.gnu.org:80 -

i'm running emacs 24.4 windows (installed through chocolatey) , trying install cider. when run m-x package-install [ret] cider [ret] , [no match] . when run m-x package-refresh-contents [ret] , hangs on contacting host: elpa.gnu.org:80 . ~/.emacs.d populated github repo recommended braveclojure.com ( here ). i've reinstalled emacs , i'm still getting same problem. i had same problem on emacs elpa wiki set un elpa have modify emacs init file located @ ~/.emacs or _emacs or ~/.emacs.d/init.el me ~/.emacs-live.el since have version. i updated file following: (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") ("marmalade" . "http://marmalade-repo.org/packages/") ("melpa" . "http://melpa.org/packages/"))) seems needed configuration elpa going packages. after ran m-x package-refresh-contents [ret] , m-x package-install [ret] cid...

excel - Can VBA delete a row from a .txt file -

i have text file contains: date, price 3/12/2015, 755 3/13/2015, 1087 i have code inserting rows text file , have insert correction date. in example, let's real price want 3/12/2015 650 instead of 755. there way delete 755 row , insert row 3/12/2015, 650 new file like: date, price 3/12/2015, 650 3/13/2015, 1087 here code using write text file: filepath = "c:\desktop\path.txt" set ofile = fso.opentextfile(filepath, 8, true) ofile.writeline range("a13").text & "," & range("b13").value thank you.

javascript - getting value from input field and open a new link -

im new html && javascript coding im doing first steps , trying write search bar pass google input text <script src="func.js"></script> <form name="googleseach"> <p align="center"><input name="searchtxt" id="searchtxt" type=search placeholder="google search"> <input type="submit" value="find" onclick="test()"></p> </form> and javascript function test(){ window.open("https://www.google.ru/webhp?newwindow=#q="+document.getelementbyid('searchtxt').value,"_self") } well, thought should work no, not. what's proble? believe want use <form name="googleseach" onsubmit="test(event)"> instead of onclick. also handler should cancel submit action. use location.href instead of window.open since you're trying open new url in same window. http://jsfiddl...

javascript - Math Computation with Checked Boxes -

having trouble trying figure out how add value of checked box total. in case i'm trying add price of checked boxes price of original cost already. function totals cost of original cost correctly i'm not sure how add checked values function or create new one. in advance. <tr> <th> small pizza </th> <td> $9.00 </td> <td> <input type = "text" name = "smal" id = "small" size ="2" /> </td> </tr> <tr> <th> medium pizza </th> <td> $11.00 </td> <td> <input type = "text" name = "medium" id = "medium" size = "2" /> </td> </tr> <tr> <th> large pizza </th> <td> $13.00 </td> <td> <input type = "text" name = "large" id = "large...

Python 3.4 - Opening a file in a module with a different directory -

i have package looks following package/ __init__.py module.py in module.py have this def function(file_name): open(file_name) f: # stuff somewhere else in arbitrary directory have python file looks this import package package.function("some_file.txt") but upon running it, it's giving me filenotfounderror: [errno 2] no such file or directory: "some_file.txt" . the problem absolute path of some_file.txt may c:\users\user\documents\some_file.txt , in package.function path absolute path c:\users\user\documents\package\some_file.txt . there way can make calling package.function file outside package directory automatically includes absolute path of file want open? sorry if terminology ambiguous, i'm unfamiliar os stuff. edit: exact file setup have looks this: directory/ foo.py package/ __init__.py module.py another_directory/ bar.txt and foo.py looks this import package p...

c# - ItextSharp font color issue in ver 5.5.4+ -

Image
i have code creates red "stamp" using red font color: string stampdate = datetime.now.tostring("mm/dd/yyyy"); string fontpath = server.mappath("/assets/fonts"); string origfile = server.mappath("/test.pdf"); const int opacitypercent = 80; const float pdfpaidfontsize = 28; const float pdfcopyx = 170; const float pdfpaidx = 385; const float pdfy = 20; const float pdfdatexoffset = 7; const float pdfdateyoffset = 12; const float pdfdatefontsize = 10; const string paidstamptxt = "paid"; const string copystamptxt = "copy"; const string arialfilename = "arialbd.ttf"; pdfstamper stamper = null; pdfreader reader = null; pdfreader.unethicalreading = true; memorystream streampdf; try { reader = new pdfreader(origfile); streampdf = new memorystream(); stamper = new pdfstamper(reader, streampdf); (int = 1; <= r...

java - Android Studio - Is there a way to show different text optimized for a smaller screen in a button? -

i amateur android developer. in app have buttons arranged in relative layout. app running on nexus 4. favorite button text fits nicely. ( app on nexus 4 ) what worries me on phones smaller nexus 4. what i'd make different string of text appear on devices can't fit "favorites string" in 1 line. string of text says "favs" instead of "favorites". ( app on nexus one ) is there way code activity_main.xml or have create new xml file designed specificaly smaller phones. i'd suggest putting icon above text increase room. remember in different languages abbreviation may not possible, , english medium length language (expect russian string twice long, problem language). but yes, in general going need multiple designs different classes of phones. looks on tablets, phablets, normal phones, , small phones different. target normal phones, enough on phablets, , redesign small , tablets.

How to remove decimals from tab delimited files Excel -

want thank taking time read question. my excel file, cells rounded 2 decimals, when save tab delimited file format, fields have many decimals, though they're not visible in excel cells. was hoping can please me out. i'm using tab delimited files uploaded mysql. please note not programmer! everyone! the real value in cell seems not rounded, formated 2 decimals. if export, format ignored , real value exported. avoid that, suggest add round-formular cell. =round(your value;2) 2 = number of decimals your value can other cell or calculation. regards

Is there a HttpServer in the standard Java Packaging? -

i've been browsing around quite bit , i'm wondering if there's similar httpserver class in com.sun.net.httpserver.httpserver package. enjoy using it's simple use , easy handle get/post requests without effort. have quite few applications use of right now; i've been told shouldn't using com.sun packaging, because it's not supported, , there's implemented in main packages. just trying figure out if i'm missing somewhere, or if doesn't exist. write own implementation using java.io, i'm quite lazy , seems nice little class have. you can use nanohttpd, single class http server java. https://github.com/nanohttpd/nanohttpd

javascript - Prevent keypress to bubble to input in mousetrap -

i using mousetrap capturing key presses. 1 of shortcuts want define focus on input. mousetrap.bind('i', function() { $('.input').focus() }); the focussing works fine, 'i' keypress gets bubbled input, , being focussed, input gets populated 'i'. is there way prevent 'i' being written in input? appreciated. thanks right there in documentation : as convenience can return false in callback: mousetrap.bind(['ctrl+s', 'meta+s'], function(e) { _savedraft(); return false; }); returning false here works same way jquery's return false. prevents default action , stops event bubbling up. so: mousetrap.bind('i', function() { $('.input').focus(); return false; });

Why is my urllib.quote in python encoding from Win-1252 instead of UTF-8 for CSV file? -

i've been trying url encode inputs them ready api request , urllib.quote works great string , encodes way it's supposed utf-8, when it's csv file, encodes in way api request not recognize. # -*- coding: utf-8 -*- import urllib r = "handøl sweden" print urllib.quote(r) this returns correct format: hand%c3%b8l%20sweden whereas: # -*- coding: utf-8 -*- import urllib import csv citylist = [] open ('sitevalidate4.csv','rb') csvfile: citydata = csv.reader(csvfile) row in citydata: citylist.append(row[12]) r = row[12] print r print urllib.quote(r) this returns: handøl sweden hand%f8l%20sweden are there fixes encode input .csv file correct format? your csv file encoded cp-1252, you'd have re-code utf-8: r = r.decode('cp1252').encode('utf8') your plain python code using utf-8 bytes ; provided code editor indeed saved data utf-8 coding: utf-8 header implies. just putting pep 2...

Get the val() of textarea within a foreach of php with a button in jquery -

get val() of textarea within foreach of php button in jquery $(document).ready(function(){ $('.boton_responder').click(function(){ var cod = $(this).attr("name"); var texto = $('input[name="'+cod+'"]' ).val(); console.log(texto); }); }); it's system of comment in html php , jquery, when admin logged in system, show comments without answers , show field textarea admin write answers. so, i'm stop here because in console.log in texto show indefined, "cod" show fine value your select incorrect. try: var texto = $('textarea[name="'+cod+'"]').val();

ios - WatchKit group: with image and label, image gets 2 of 4 corners rounded -

Image
i'm trying lay out view in watchkit image , label side side. i create group horizontal orientation, , add image left justification , label right justification. i 2 different problems here: (1) image square, edge of image against edge of group gets rounded off. have 2 rounded corners , 2 square corners, looks bad. i'd prefer 4 rounded corners -- need consistent. (2) label text long , needs wrapped. in interface builder set lines 2, , in ib wraps properly. when run it, view in simulator doesn't wrap, , instead truncated. do have corner radius set on containing group? if clip corners of image.

ruby on rails - link_to for url with embedded parameters -

i'm still newish rails not sure on correct terms here but.. i'd see how use link_to helper when url has parameters embedded in structure. such as: http://example.com/appointments/2015/3/15 which displays appointments day. how use link when know date need pass in part of url? something like, link_to 'text', appointments_path(2015/3/15) or whatever is? sorry i'm unsure terms here or else find better google bonus: call type of parameters? assuming have route dynamic segments like: get '/appointments/:year/:month/:date', to: 'appointments#index', as: :appointments you pass year, month, , day parameters arguments path helper: link_to appointments_path(year: 2015, month: 3, day: 15)

java - Why can't my tests see my system property when I release on Jenkins? -

i wrote unit test code prints out value of system.property named "jenkins_build". property has value when run these command locally: mvn --batch-mode test -djenkins_build=true mvn test -dargline="-djenkins_build=true" etc. but no matter do, cannot property tests when run on jenkins. command line option i'm using there: mvn -dargline="-djenkins_build=true" --batch-mode -dresume=false release:prepare release:perform slightly different, don't see why matter. why system.getproperty("jenkins_build") null on jenkins "true" in local environment? have using release:prepare release:perform ? i think same question , i'm not sure. difference he's trying pass arguments release plugin, i'm trying pass them surefire plugin. also, want define value in command line without having change pom.xml. there way that? fwiw , solution linked does work. note if not fork jvm, properties set on maven command ...

Android app fails due to a java.lang.StackOverflowError -

i'm making android program , it's failing due stackoverflow error. have attached code. i'm using android studio. believe it's looping because of addtextchangedlistener can't understand why it's doing it. my code: rb1 = (radiobutton) findviewbyid(r.id.radiobuttoncfm); rb2 = (radiobutton) findviewbyid(r.id.radiobuttonac); rb1.setonclicklistener(new radiogroup.onclicklistener() { public void onclick(view v) { edittext e1 = (edittext) findviewbyid(r.id.edittext); string susername1 = e1.gettext().tostring(); if (textutils.isempty(susername1)) { e1.seterror("the item cannot empty."); return; } edittext e2 = (edittext) findviewbyid(r.id.edittext2); string susername2 = e2.gettext().tostring(); if (textutils.isempty(susername2)) { e2.seterror("the item cannot empty."); ...

download a csv file using a https request with R -

i download csv file using https request. using web browser, can download file . i in r. did try use geturl function rcurl package without success. library(rcurl) url <- "https://indices.euronext.com/nyx_eu_listings/price_chart/download_historical?typefile=csv&layout=vertical&typedate=dmy&separator=point&mic=xpar&isin=fr0003500008&name=cac%2040&namefile=price_data_historical&from=0&to=1426550400000&adjusted=1&base=0" csvfile <- geturl(url) tks help use download.file read.table instead of geturl: url <- "https://indices.euronext.com/nyx_eu_listings/price_chart/download_historical?typefile=csv&layout=vertical&typedate=dmy&separator=point&mic=xpar&isin=fr0003500008&name=cac%2040&namefile=price_data_historical&from=0&to=1426550400000&adjusted=1&base=0" download.file(url, "name.txt") data.url <- read.table("name.txt...

javascript - Rails App (Spree) - Sudden "Uncaught Type Error" -

i have fresh 3.0 version installation of spree commerce running on rails app. added slick slider (slick.js) installation using following methods: added slick.js vendor/assets/javascripts/spree/frontend put relevant scss files in vendor/assets/stylesheets/spree/frontend setup custom homepage deface layout, , called slick slider @ bottom using <script></script> it worked swimmingly, , setup slick-custom.scss styling. commit changes, shut-off codekit, , move locations. open macbook again , it's throwing blasted uncaught typeerror: undefined not function . called on $(".slider-for").slick({ ... i have been , down thing, , cannot tell what's changed, nor why isn't loading. slick in resources, jquery loaded, filepaths , elements named appropriately. it's driving me insane, , don't know do. relevant files: homepage setup <div class="slider-for"> <% @products.each |product| %> <div> ...

javascript - jQuery validation is duplicating else statements | Values won't print once validation is finished -

so validating form - validation works fine if user wrong .after <p></p> error message. if user click button more once keep printing out .after error message! i have tried - includes putting boolean expression in if statement , once .after error message prints make expression false so if statement won't run again. did not work me. i can't values print out once validation done!? to try , fix have wrapped tried wrap validation in if statement tests see if validation true , @ bottom of if statement after validation make boolean value turn false , have else statement prints out values each input...this won't work me! jquery: // javascript document $(document).ready(function() { //submit form validation $('#submit').click(function () { //get values input fields: $name = $('#txtname').val(); $age = $('#numage').val(); //sex: $sex = $('sex').val(); //email...

class - mutable method X.this is not callable using a immutable object error in D -

i have d code copied page: http://ddili.org/ders/d.en/class.html import std.stdio; struct s { (int x) { this.x = x; } int x; } class foo { s o; char[] s; int i; // ... this(s o, const char[] s, int i) { this.o = o; this.s = s.dup; this.i = i; } foo dup() const { return new foo(o, s, i); } immutable(foo) idup() const { return new immutable(foo)(this.o, this.s, this.i); } } void main() { auto var1 = new foo(s(5), "hello", 42); auto var2 = var1.dup(); immutable(foo) imm = var1.idup(); writeln(var1); writeln(var2); writeln(imm); } the issue have "mutable method a.foo.this not callable using immutable object" error when compile it. you're receiving error because called new immutable(foo)(this.o, this.s, this.i); looks immutable constructor, , have constructor mutable object defined, default. can solve...

c# - how to save listbox item to multiple database Fields? like split -

Image
i'm using listbox1 , listbox2 want transfer selected items listbox1 listbox2 (id, firstname middlename lastname) in database firstname , middlename , lastname in separate fields after trasnfer listbox1 items listbox2 want save database problem ... don't know how split words , give each words string name command them save assigned fields here's code sqlconnection void database1() { conn.open(); sqlcommand cmd = new sqlcommand("select * [user_tbl_db]", conn); sqldataadapter da = new sqldataadapter(cmd); dataset ds = new dataset(); da.fill(ds); conn.close(); datatable mydatatable = ds.tables[0]; datarow temprow = null; foreach (datarow temprow_variable in mydatatable.rows) { temprow = temprow_variable; listbox2.items.add((temprow["id"] + ", " + temprow["firstname"] + " " + " " + temprow["middlename...

C# Kinect Drawing Point Over Tracked Hand -

i have following code: if (frame != null) { canvas.children.clear(); _bodies = new body[frame.bodyframesource.bodycount]; frame.getandrefreshbodydata(_bodies); foreach (var body in _bodies) { if (body != null) { if (body.istracked) { // choose hand track string whichhand = "right"; //change "left" in order track left hand joint handright = body.joints[jointtype.handright]; if (whichhand.equals("right")) { string righthandstate = "-"; //find right hand state switch (body.handrightstate) ...

ios - Presenting a ViewController over another ViewController -

Image
i've got pretty lengthy question today, takes amount of explaining. let's start example. example let's have 3 view controllers: fullsizeviewcontroller firstviewcontroller secondviewcontroller fullsizeviewcontroller, name states, intended take space of whole screen. firstviewcontroller , secondviewcontroller, on other hand, should take 3/4 of height of screen. here's few pictures illustrate. here have fullsizeviewcontroller. nothing special, 2 buttons - "first" & "second". if haven't caught on now, 2 buttons should toggle each of respective view controllers, shown below. the issue i'm having main issues this? how able to animate view controllers bottom change size of 2 smaller view controllers still allow interaction fullsizeviewcontroller small view controller open on top of main content, not 2 toggle buttons? what i've tried since i'm not sure how this, haven't tried much, have tried ...

osx - Moving files in Applescript, got error: "Finder got an error: Handler can’t handle objects of this class." -

i trying move files using applescript, , error every time run app. in contents of app, have file(s) want move (so if distribute app users won't have separately download file(s)). why using ((path home folder text) , adding specific file path past that. here code: set source ((path home folder text) & "/contents/resources/finder.jpg") set source2 ((path home folder text) & "/contents/resources/finder@2x.jpg") set destination alias "macintosh hd:system:library:coreservices:dock.app:contents:resources:" tell application "finder" move source destination replacing move source2 destination replacing end tell p.s. checked every related question/answer there on here, , none helped. a simple display dialog source have led solution: path home folder returns alias home folder (macintosh hd:users:your name:). think wanted path me instead points app. analias text returns path string using : delimiters , ap...

jquery - css clear floats with multiple divs -

i need clear floats after left , right div..ie; left div should match whole size of right div..but unfortunately dont see working. css #left{ float:left; background-color:gray } #right{ float:left; background-color:gray } html <div> <div id="left"> <ul id="ul1" style="list-style-type:none"> <li><a style="color:orange" href="/">about us</a></li> <br> <li><a style="color:orange" href="/players">players</a></li> <br> <li><a style="color:orange" href="/contactus">contact us</a></li> </ul> </div> <div id="right"> content. <br> content. <br> content. <br> co...

jsp - How to add breadcrumb to Spring MVC? -

how can add breadcrumb pages of spring mvc? suppose question ask breadcrumbs quite popular , might question of many others. i've found solution using dummiesmind.breadcrumb.springmvc.annotations, there question on stackoverflow not learn except finding similar solution 1 ive found. solution this one using javascript. does have better option ones mentioned? @link(label="sample link", family="controllerfamily", parent=""); @requestmapping(value = "sample.do", method=requestmethod.get); public modelandview samplemethod(httpsession session){...} what using display pages ? jsp ? thymeleaf ? the link point seems option or @ least can build custom works based on that. using annotations keeps code clean need make sure add them everywhere. you use abstract controller define method create modelandview object pages. add breadcrumbs way : protected modelandvie...

java - Play song if sensor detects certain amount of movement -

i trying call different songs whenever sensor detects change in movement example... if no movement detected play song 1. if movement detected play song 2. else if movement stops play song 1 again. so far, have been successful , plays through first 2 if statements above, however, can't song 1 without music player playing on itself. i've tried using .pause(); seems pause second , plays song1 on again , again. this have far: public void onsensorchanged(sensorevent se) { float x = se.values[0]; float y = se.values[1]; float z = se.values[2]; maccellast = maccelcurrent; maccelcurrent = (float) math.sqrt((double) (x * x + y * y + z * z)); float delta = maccelcurrent - maccellast; maccel = maccel * 0.9f + delta; // perform low-cut filter mp1.start(); //song1 starts if (maccel > 5) { // movement mp2.start(); // start song2 if (mp...

C++ custom text-to-speech direction -

i wanted try hands @ scratch text speech project while now. after gathering .wav files of different english phonic sounds, , learning how compile project audio playsound(text("audio.wav"), null, snd_async); , play through .exe, i've ran hard part. can not, life of me, figure out practical way attach audio string or char values when use inputs text, inputted string read left right , plays audio correlated letters reads. where can go, or should @ me solving problem or @ least aquire next step? visualstudios2012 express windows

node.js - NPM.JS plugin for accessing the linux terminal -

here situation. i'm working on application uses node.js. however, cannot find plugin shut down system without intervention. figured if can access bash (the command line linux) should able enter shutdown -h -p now . ideally, code this: var commander = require('commander'); // example commander.command("shutdown -h -p now"); and shut down system. reading this, , help! if can find either module shutdown system, or module can access terminal, appreciated. i think built in native. https://nodejs.org/api/child_process.html . you can google around examples. also. can check out shell.js module

c - NameError with Python Swig trying to interface the cholmod library -

i'm trying create python interface c cholmod library, part of suitesparse library ( suitesparse ). as i'm new swig, don't know if daunting task or not. didn't find reference interface done in swig. compiling happens without trouble. this error when try import swig-generated "_cholmod.py" file: python 2.7.5+ (default, feb 27 2014, 19:37:08) [gcc 4.8.1] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import _cholmod traceback (most recent call last): file "<stdin>", line 1, in <module> file "_cholmod.py", line 99, in <module> class suitesparse_config_struct(_object): file "_cholmod.py", line 106, in suitesparse_config_struct __swig_setmethods__["malloc_func"] = __cholmod.suitesparse_config_struct_malloc_func_set nameerror: name '_suitesparse_config_struct__cholmod' not defined where name...

c++ - cin crashing my program after 12 for loop iterations? -

i've never posted here before i'm stuck thought i'd give try. i've been working on code while, aim input few students marks , output them tables averages , totals. given file this: 15 albert einstein 52 67 63 steve abrew 90 86 90 93 david nagasake 100 85 93 89 mike black 81 87 81 85 andrew van den 90 82 95 87 joanne dong nguyen 84 80 95 91 chris walljasper 86 100 96 89 fred albert 70 68 dennis dudley 74 79 77 81 leo rice 95 fred flintstone 73 81 78 74 frances dupre 82 76 79 dave light 89 76 91 83 hua tran du 91 81 87 94 sarah trapp 83 98 my problem when inputting names program crashes after fred flinstone, know not problem formatting of next name (frances dupre) because when moved him list read fine. i have located program crashing 'cerr' outputting @ different stages of read process , crashes when trying read in frances's marks. a1main.cpp #include <iostream> #include "student.h" using namespace std; int main() { int numst...

Convert white color to transparent on bitmap in android -

i want convert white background transparent background in android bitmap. my situation: original image : cannot post image public bitmap replacecolor(bitmap src){ if(src == null) return null; int width = src.getwidth(); int height = src.getheight(); int[] pixels = new int[width * height]; src.getpixels(pixels, 0, width, 0, 0, width, height); for(int x = 0;x < pixels.length;++x){ pixels[x] = ~(pixels[x] << 8 & 0xff000000) & color.black; } bitmap result = bitmap.createbitmap(pixels, width, height, bitmap.config.argb_8888); return result; } processing after detect pixel pixel, 1 one. it's bitmap image doesn't remain original color. so, append code filter. if (pixels[x] == color.white) public bitmap replacecolor(bitmap src){ if(src == null) return null; int width = src.getwidth(); int height = src.getheight(); int[] pixels = new int[width * height]; src.getpixel...

php - Copy records and related records over in a MySQL database (stored procedure or function) -

i thinking stored procedure/function best solution this, open suggestions. i want duplicate master record, , duplicate of associated records @ same time. consider following example setup: table 1 table 2 table 3 ------- ---------- ---------- id (pk) id (pk) id (pk) data1 t1_id (fk) t2_id (fk) data2 data1 data1 data3 data2 data2 looking @ schema above, can see table 1 master table. want copy that, along child records in table 2 , grandchild records in table 3 . when done, pk's (of auto_increment, , dynamically generated) need updated. when happens, foreign keys in related tables need updating also. is there stored procedure/function can ease compared trying now? [select multidimensional array, , foreaching, foreaching, foreaching , more foreaching on data inserts , whatnot].

iOS 8 (Xcode 6.1.1) - Navigation bar not working as in storyboard -

Image
i'm following youtube tutorial swift ios tutorial - core data - add update delete part1 (xcode 6 beta) done in different xcode version , encountering navigation issues wasn't apparent in tutorial. suppose changes in latest xcode hope 1 might able address here. i have 1 tableviewcontroller embeded in navigationcontroller (initial view) , tableviewcontroller, made push segue + bar item viewcontroller. in simulation mode, + button displays edit , clicking doesn't go viewcontroller should push to. this how it's done in storyboard. and, simulation screen button wrong , clicking doesn't go next screen. **updated check segue connection, if have given cell, if there record navigate next view. other wise give segue connection edit button next view testing purpose.

css - how to select the element in a tree structure? -

codepen: http://codepen.io/singlexyz/pen/emqyeb html: <div class="item"> <a href="">首页</a> <div class="item"> <a href="">项目</a> <div class="item"> <a href="">招贤</a> <div class="item"> <a href="">联系</a> </div> </div> </div> </div> scss .item{ background-color:skyblue; @for $i 1 through 4{ &:nth-child(#{$i}){ margin-left:$i * 10px; } } } the nth-child(3) doesn't select that. i try use nth-of-type, it's take nth-of-type(1). have need add class in every .item ? the correct way use space since talking children , not siblings div div div {} div div div{ background: red } <div class="item"> <a href="">首页</a> <d...

multithreading - System.Threading.Thread.Sleep c# -

good morning using c# develop pc software , using method in software delay loop between lines system.threading.thread.sleep(x); but make software freeze . how method work out freeze application full code private void button18_click_3(object sender, eventargs e) { (int = 0; < lstgroups.items.count; i++) { // system.threading.thread.sleep(x); system.windows.forms.application.enablevisualstyles(); // timeless.enabled = true; timeless.start(); duration--; if (duration == 0) { timeless.start(); } if (gsend.post(lstgroupsbox.items[i].tostring(), appsettings.default.accesstoken, txtstatus.text, txtlink.text) == true) lblshow.text = "sent : " + lstgroups.items[i].text; lblsendid.text = "sent : " + lstgroupsbox.items[i]; { //foreach...

shell - How can I pass and return a value from user defined function in MAKEFILE? -

i create function takes list argument, performs operation , returns list(or scalar value). define function using 'define'. function: 1) performs operation on input list 2) checks if resultant list empty, if list empty raise error. 3) otherwise return resultant list this possible in languages c/c++. facing issues when try in makefile. a) can point me examples or post example here?. b) how makefile function returns value? i checked makefile documentation , few other places on web not find useful. give me idea on starting functions. thank help! define myfuntest fnames := $(filter %pattern, $(1)) ifneq ($(fnames),) $(error error) endif endef caller function like: abc := documents downloads return_value := $(call mytestfun,$(abc)) i want 'fnames' returned in 'return_value' user-defined macros must single "expression". returned value result of expanding expression. cannot use ifneq or variable assignments or other s...

How to get filepath of selected file in windows explorer context-menu in C#? -

i've created music player using visual studio 2012 windowsform c#, want play/add songs windows explorer other player(windows media player,winamp,mpcstar,vlc...) does! think wouldn't real hard! of these programs simple! so example: select 3 songs in directory in explorer , right click on them , select "play " , should use application add function added playlist , start playing! if user press enter key should operation! if user select "add playlist" songs should added playlist (not replace previous playlist songs) i don't want create program need answer know how can paths of selected files windows explorer context-menu! *** want selected files path not single file! ** update: found solution! posted answer below! hope helps others :) ok i've got solution :) this link helped me paths of selected files in explorer clicking on context-menu item: .net shell extensions - shell context menus real easy :) here's steps: 1) do...