Posts

Showing posts from September, 2013

Reading file PHP using too much memory -

so, i'm trying parse text file has 24mb , 314134 lines. problem is, feel script using way memory. this code: if(file_exists($filepath)) { $data = file_get_contents($filepath); $lines = explode("\n", $data); foreach ($lines $line) { //split line. $spllitedline = explode(';', utf8_encode($line)); //get fields index. $localidade = !empty($spllitedline[3]) ? $spllitedline[3] : ''; $codigo_postal = $spllitedline[14] . '-' . $spllitedline[15]; $morada = (!empty($spllitedline[5]) ? $spllitedline[5] : ' ') . ' ' . (!empty($spllitedline[6]) ? $spllitedline[6] : ' ') . ' ' . (!empty($spllitedline[7]) ? $spllitedline[7] : ' ') . ' ' . (!empty($spllitedline[8]) ? $spllitedline[8] : ' ') . ' ' .

android - Error on ruOnUiThread inside asychtask -

i trying parse data server , compare data data in database... seems working fine... except getting same value comparing data change... i'll explain code... in below code, there textviews tv3 , tv4... comparing data ie, shopid changed, shows value first array of json... when tried debug, found the run() inside runonuithread calling after 2-3 loops... donno whats happening here... please somone ,e sort out issue... edit: while debugging when skip each line not showing error... when try skip breakpoints using f9 shows error... edit: 2: since code litle bit long, juz deleted som unwanted part... private bitmap downloadbitmap(string url) { httpurlconnection urlconnection = null; try { url uri = new url(url); urlconnection = (httpurlconnection) uri.openconnection(); int statuscode = urlconnection.getresponsecode(); if (statuscode != httpstatus.sc_ok) { return null; } inputstream inputstream = urlconnectio

How tochange the text inside a link with jQuery -

i want change text inside link jquery when href attribute undefined. here code; <input type="text" id="sample"/><button id="button">submit</button> <table id="table" border="1"> <tr> <td>less 50</td> <td>less 100</td> <td>less 500</td> <td>less 1000</td> <td>more 1000</td> </tr> </table> js: $("#button").click(function() { var val=$("#sample").val();//alert(val) if(val<50){ var col1=val; }else if(val<100){ var col2=val; }else if(val<500){ var col3=val; }else if(val<1000){ var col4=val; }else if(val>1000){ var col5=val; } var row='<tr>'+ '<td><a href="#">'+col1+'</a></td&

c# - Multiple CheckedChanged event on programmatically added checkboxes -

i want able assign each checkbox it's own richtextbox i'm making richtextboxes, i'm making checkboxes how can "link" them together? for example : // richtextbox 1 - > checkbox 1 = false // richtextbox 2 - > checkbox 2 = true // richtextbox 3 - > checkbox 3 = true // richtextbox 4 - > checkbox 4 = false this code: int n = todoitems.count; richtextbox[] richtextboxes = new richtextbox[n]; checkbox[] checkboxes = new checkbox[n]; (int = 0; < n; i++) { //creating richtextbox richtextboxes[i] = new richtextbox(); richtextboxes[i].name = "tb" + i.tostring(); richtextboxes[i].text = todoitems[i].tostring(); richtextboxes[i].location = new system.drawing.point(130, (10 + (60 * i))); richtextboxes[i].size = new system.drawing.size(300, 50); richtextboxes[i].visible = true; rich

Solving PDE system in Matlab: Derivatives on a mesh -

i using matlab solve system of coupled pdes, pdenonlin . i create mesh geometry (a square box circular hole in middle), , refine until : [p,e,t] = initmesh('defectgeom2'); [p,e,t] = refinemesh('defectgeom2',p,e,t); i solve system % solution: u = pdenonlin(b_s,p,e,t,c_s,a_s,f_s); % extract different functions full solutions (systems): np = size(p,2); % number of node points uk = reshape(u,np,[]); % each uk column has 1 component of u therefore have uk (in case 3) solutions. now want calculate integrals , derivatives of approximate solutions. tried interpolating uniform grid using tri2grid : x=linspace(-1,1,npts); y=x; psi=tri2grid(p,t,uk(:,3),x,y); theta=tri2grid(p,t,uk(:,1),x,y); theta_y=derivative(theta,1,2); psi_x=derivative(psi,1,1); and calculate: pressure = trapz(x,psi_x-cos(2*theta).*theta_y+sin(2*theta)); but gives me poor approximation, guess because of fact grid uniform whereas mesh finer around central circle , coarser elsewhere. i

java - Why is there a delay in Spring AMQP Message dispatching from a filled Queue? -

i using spring amqp in message driven application. noticed there constant delay of around 300ms between invocations of message listener, though sure queue filled messages. logfile below shows delay between blockingqueueconsumer.nextmessage , blockingqueueconsumer.handle call blockingqueueconsumer.handledelivery thread in between: 2015-05-12 12:46:18,655 trace [simpleasynctaskexecutor-1] simplemessagelistenercontainer.doreceiveandexecute waiting message consumer. 2015-05-12 12:46:18,655 debug [simpleasynctaskexecutor-1] blockingqueueconsumer.nextmessage retrieving delivery consumer: tags=[{amq.ctag-wwui6qjs1fanfpm7j6givw=my-queue}], channel=cached rabbit channel: amqchannel(mybrokerip,1), acknowledgemode=auto local queue size=0 2015-05-12 12:46:18,967 debug [pool-1-thread-6 ] blockingqueueconsumer.handledelivery storing delivery consumer: tags=[{amq.ctag-wwui6qjs1fanfpm7j6givw=my-queue}], channel=cached rabbit channel: amqchannel(mybrokerip,1), acknowledgemode=auto local queue

android - Update fragments in viewpager when a Spinner item is selected -

my goal create simple, multi-language application uses viewpager display fragments. have created : -"frensh_frag1,frensh_frag2,frensh_frag3 " french fragments -"english_frag1,english_frag3,english_frag3 " english fragments what want add spinner displays languages (fr, en), when choose "en" viewpager should display english fragments. how implement spinner code?! code far : public class mainactivity extends fragmentactivity { private viewpager pager; spinner spinner; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); pager = (viewpager) findviewbyid(r.id.viewpager); spinner = (spinner) findviewbyid(r.id.spinner); string[] language={"fr", "en", "sp"}; arrayadapter<string> stringarrayadapter=new arrayadapter<string> (this,android.r.layout.simple_spinner_dropdown_item,language); spin

Calculate number of rows with current month & year in Google Sheets or Excel -

i have 1 row filled dates in format mm/dd/yyyy (with header row), such as: dates 5/12/2015 4/12/2012 5/7/2015 5/7/2014 i count number of rows match current month & year. in example above, result 2 (when it's may 2015). is possible achieve result using function? preferably using google spreadsheet, excel fine. in google sheets can use =count(filter(a:a,month(a:a) = month(today()),year(a:a)=year(today()))) where a:a column dates

python - Templates Django (Does not exist at/) -

Image
i'm trying use django templates cant display simple html line don't understand why... searched resolve after many test, problem remains. this structure: my urls.py (which work tried fonction in views.py): from django.conf.urls import patterns,include, url django.contrib import admin urlpatterns = patterns('polls.views', url(r'^$', 'home', name = 'home'), url(r'^admin/', include(admin.site.urls)), ) my views.py: from django.shortcuts import render django.template import template , context # create views here. # -*- coding: utf-8 -*- def home(request): return render(request, 'mysite/bap2pmonitoring.html') my setting file setting.py: templates = [ { 'backend': 'django.template.backends.django.djangotemplates', 'dirs': [os.path.join(base_dir, 'templates'], 'app_dirs': true, 'options': { 'con

css - responsive image using the after selector -

i'm wondering if can make image inserted :after responsive. html: <div class="col-md-3 swap-bot main-sidebar sidebar"> <ul id="shop-sidebar"> <li id="text-2" class="widget widget_text"> <h2 class="widgettitle">shop powered </h2> </li> </ul> </div> css: .sidebar>ul>li { background: #fff; border: 1px solid #aaa; border-bottom-width: 2px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; margin-bottom: 20px !important; } .sidebar .widgettitle { font-size: 16px; font-weight: 700; padding: 15px 15px 10px 15px; margin-bottom: 0 !important; border-bottom: 1px solid #aaa !important; } #text-2 h2:after{ content: url('https://blabla.com/wp-content/uploads/2015/05/small.png'); display: block; padding-top: 10px; background-size: contain; background-position: center; } i

php - Duplicate data stored when using cURL -

i trying post data using curl web services store data database there, it's storing same data 2 times, instead of one. applied condition there , it's working can not find reason behind behavior. $postedarray['login_credentials'] = $this->login_data; $postedarray['post_data'] = $this->arrpostdata; $str = http_build_query($postedarray); $ch = curl_init(); curl_setopt($ch, curlopt_httpheader, array('expect:')); curl_setopt($ch, curlopt_url, $this->requesturl); curl_setopt($ch, curlopt_encoding, 'gzip,deflate'); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $str); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_connecttimeout, 999); curl_setopt($ch, curlopt_timeout, 999); if (curl_exec($ch) === false) { echo 'curl error: ' . curl_error($ch); retur

c# - WPF Entity Framework Loading Process Stucks -

currently working project in c# wpf entity framework, had used mahapps.metro package ui, need implement progreebar or loadingindicator or idicates app not stuck, whenever made kind of operation first time, apps stucks few second , seems hang, in web apps had implemented ajax call, loading process with .ajaxstart() .ajaxstop() so question know or there way implement every call of app or entity framework or process how can implement progressbar or gif loader or shows process. i had tries progessbar of mahapps.metro whenever start progressbar stucks untill process complete. edited: some of code is, private void showclientwindow(object sender, routedeventargs e) { myprogess.isindeterminate = true; //its progressbar myframe.source = new uri("myviews/clientview.xaml", urikind.relative); myprogess.isindeterminate = false; } thanks, gaurav oza the solution not display progressbar let user think application not stuck,

javascript - Press enter key on a web page -

there texbox on fb groups. html code: <input type="text" class="inputtext textinput" name="freeform" placeholder="gruba başkalarını ekle" autocomplete="off" aria-autocomplete="list" aria-expanded="false" aria-owns="typeahead_list_u_jsonp_4_2" aria-haspopup="true" role="combobox" spellcheck="false" aria-label="gruba başkalarını ekle" id="u_jsonp_4_3"> and input name using javascript code. document.getelementsbyname('freeform')[0].value = '" + textbox2.text + "'; but there no button click , using sendkeys.send("{enter}") event click enter . the problem sendkeys.send not enough me , wanna press enter key using ways. how can hit enter key without using sendkeys.send ? you can achieve in jquery quite creating event , assigning keycode of enter key, 13 : var e

javascript - Cleaning out bad JSON data from object? -

i retrieving building geolocation data service, in cases of data have missing properties. good data [{ "modifiedon": "2015-04-29 11:17:28.0", "buildingname": "wintefell", "latitude": "52.900619", "longitude": "-1.434602", "region": "the north", }, { "modifiedon": "2015-04-29 11:17:28.0", "buildingname": "water gardens", "latitude": "51.818051", "longitude": "-.354871", "region": "dorne" }] bad data missing region or building name { "modifiedon": "2015-04-29 11:17:28.0", "buildingname": "kings landing", "latitude": "23.818051", "longitude": "-.154871", } after making ajax request store json response in object called _regionandbuildings i w

bash - Convert image sequence to video using ffmpeg and list of files -

i have camera taking time-lapse shots every 2–3 seconds, , keep rolling record of few days' worth. because that's lot of files, keep them in subdirectories day , hour: images/ 2015-05-02/ 00/ 2015-05-02-0000-02 2015-05-02-0000-05 2015-05-02-0000-07 01/ (etc.) 2015-05-03/ i'm writing script automatically upload timelapse of sunrise youtube each day. can sunrise time web in advance, go after sunrise , list of files taken in period using find : touch -d "$sunrise_start" sunrise-start.txt touch -d "$sunrise_end" sunrise-end.txt find images/"$today" -type f -anewer sunrise-start.txt ! -anewer sunrise-end.txt now want convert files video ffmpeg . ideally i'd without making copy of files (because we're talking ~3.5 gb per hour of images), , i'd prefer not rename them image000n.jpg because other users may want access images. copying images fallback. but i

sql server 2008 - restore only last 1 or 2 months data in sqlserver? -

i have 5 tb of data in production , development team requested restore last month data(<=500 mb ) in staging server , last 2 months data in pre production. how can restore last 1 or 2 months data in sqlserver? i dont think possible restore data last few months if have timestamp field in tables lead inconsistent data.

html5 - Write text inside rectangle -

i trying find how filltext inside rectangle. unfortunately can find c# projects/tutorials. possible add text inside rectangle in html5 in canvas? want each rectangle (node) have different text on example 1 called cow , other tiger , on. possible? have tried everything! var x = 150; var y = 100; var canvas = $('#nodelist').get(0); var ctx = canvas.getcontext('2d'); ctx.font = "30px arial"; canvas.height = 0; var rects = [ [20, 20, x, y], [20, 220, x, y], [20, 420, x, y], [20, 620, x, y], [20, 820, x, y], [20, 1020, x, y], [20, 1220, x, y], [20, 1420, x, y], [20, 1620, x, y] ]; (var = 0; < rects.length; i++) { canvas.height = canvas.height + 200; ctx.clearrect(0, 0, canvas.width, canvas.height); //rectangles opnieuw tekenen (var j = 0; j < i; j++) { ctx.fillrect(rects[j][0], rects[j][1], rects[j][2], rects[j][3]); } ctx.fillrect(rects[i][0],

c# - I'm retrieving a value for a combobox with custom class items but I can't make it show the item -

i wanted have items , hidden values call later used article create custom items. but i'm calling 1 value cannot make show proper item. combobox stays null. if (reader.hasrows) { reader.read(); namebox.text = reader["c_name"].tostring(); lastbox.text = reader["c_lastname"].tostring(); genderbox.selecteditem = reader["c_gender"].tostring(); } here add combobox , want show accoring value reader private void editcust_load(object sender, eventargs e) { genderbox.items.add(new comboboxitem("male", "1")); genderbox.items.add(new comboboxitem("female", "0")); } please let me know if need add more code or provide more information. i'm junior developer please excuse terrible mistakes , bad formulation. first, override equals , gethashcode methods in class: public class comboboxitem() { string displayvalue; string hiddenvalue;

java - TreeMap Compile Error -

this code: import java.util.*; public class treemap { public static void main(string[] args) { map<string,integer> treemap = new treemap<string,integer>(); code fill treemap ie treemap.put("kevin", 36); } } and getting compiler error: treemap.java:5: error: type treemap not take parameters map<string,integer> treemap = new treemap<string,integer>(); ^ use full qualified class name java treemap class new java.util.treemap<string,integer>()

python - Discount function not working -

#function - discount buy 5 1 free def generate_discount1 (): if (entwindow1.get() != ""): price = 0.99 free = 1 discno = (int(entwindow1.get())+ int(entwindow2.get())+ int(entwindow3.get())+ int(entwindow4.get())+ int(entwindow5.get())+ int(entwindow6.get())+ int(entwindow7.get())+ int(entwindow8.get())+ int(entwindow9.get())) total_bought = float (price*discno) total_free = float (price*free) return 0.2 / (total_bought / total_free) i can't discount function work, it's python 3.4 using tkinter. this function should give discount, if customer bought 5 donuts 1 free. this how compute what believe you're after: example: def discount(p

hardware - VPI vpi_put_value on nets -

i trying force value of net through vpi_put_value (using c interface of vpi) simulation doesn't keep forced value. during simulation evaluates value , see in gtkwave different value forced. need method force value specific times (range of simulation times) not depend on simulator (cvc, icarus etc.). is achievable? use vpiforceflag flag force value through vpi, , release vpireleaseflag . vpi_put_value(sys, &return_val, null, vpiforceflag); refer documentation form verilog/sytemverilog lrm: ieee std 1364-1995 § 23.23 vpi_put_value() ieee std 1364-2001 § 27.32 vpi_put_value() ieee std 1364-2005 § 27.32 vpi_put_value() ieee std 1800-2012 § 38.34 vpi_put_value() you can same effect verilog keywords force , release

javascript - Why is 'window.angular' used like so, in this function definition? -

i'm trying understand angularjs file need use integrate django, , has weird syntax i'm not familiar (bear in mind i'm junior dev, may bread , butter)... it goes like: (function(angular, undefined){ 'use script'; var djng_forms_module = angular.module('ng.django.forms', []); funtion hascode(s){ return ..... } var foo = ..... }(window.angular)); i've seen this javascript concept of window , shows window part top (?) level object browser creates when loads page. running console.log(window.angular) prints out load of internal angular stuff. i'm guessing internal guts of angularjs...? but why weird encapsulation function (something javascript being 'functional' language)? the full script here , can't figure out why uses window.angular in function definition (as opposed normal way of doing things). seems set means it's not working application when import via script tags. window.angu

javascript - Reactive programming - value is greater than X for N seconds -

i have stream randstream emit random value every half second , boolstream converts value randstream boolean. let randstream = kefir.frompoll(500, () => math.random()) let boolstream = kefir.map((rand) => rand > 0.5) i want emit true when boolstream emits true 5 seconds (in row). otherwise emit false. i'm using kefir.js library. do have ideas? thanks. with given conditions when know exact rate @ randstream emit numbers, pretty easy achieve .slidingwindow : let result = boolstream .slidingwindow(10, 10) .map(items => _.every(items)) .skipduplicates(); if want work rate of events, can try like: let result = boolstream .scan(({mostrecentfalse, latestvalue}, bool) => { return bool ? {mostrecentfalse, latestvalue: true} : {mostrecentfalse: date.now(), lastvalue: false} }, {mostrecentfalse: date.now()}) .changes() .map(({mostrecentfalse, latestvalue}) => latestvalue && (date.now() - mostrece

android - Does the _id in content providers table needs to be in sequence -

i using content providers application.the app register added user server.the server send id user.i need populate listview content providers data.can use id _id content providers table because server's id may not in sequence. is work on non sequence id's.or need go other options i'm not sure id comes server side. api guide: a provider isn't required have primary key, , isn't required use _id column name of primary key if 1 present. however, if want bind data provider listview, 1 of column names has _id. requirement explained in more detail in section displaying query results . basically, if server id unique may use it

python - Tkinter-PhotoImage in a Tkinter.Frame -

i trying add photoimage() in 1 of frame-widgets. there seem problem though since graphics of picture won't show. code below: urllib import urlopen import tkinter tkinter import * class frames(object): pictures = {"path": "c:/users/xxxxx/desktop/source/pics/", 'google': 'google.gif', 'wiki': 'wikipedia.gif', 'tyda': 'tyda.gif', "hitta": "hitta.gif" } def __init__(self, parent): #creation of main frames self.parent = parent self.logo_frame = frame(parent) self.input_frame = frame(parent) self.output_frame = frame(parent) def configure(self): #root window self.parent.geometry('400x400') self.parent.title('w0rksuite') self.

javascript - d3js - force: nodes and links from json file not loaded in my svg during redrawing -

i'm still trying load nodes , links extern json file. works when outside redraw() function. goal load them , add additional nodes , link svg . thats why created redraw() function make great part of job. inspired force example , other example . nothing appears (i have no error). have ? my code : var width = 960, height = 500; var selected_node = null, selected_link = null; var svg = d3.select("body") .append("svg") .attr("width", width) .attr("height", height) .attr("pointer-events", "all"); var visual = svg .append('svg:g') .append('svg:g') .on("mousemove", mousemove) .on("click", click); visual.append('svg:rect') .attr('width', width) .attr('height', height) .attr('fill', 'white'); var force = d3.layout.force() .size([width, height]) .charge(-400) .on("tick"

java - Maven MOJO Execution Failed while Building -

i'm trying run openolat lms project (an open source learning platform written in java) source but got following maven error in netbeans output , can't build project. failed execute goal org.openolat.mojo:buildnumber-maven-plugin:1.2.0:hgchangeset (default) on project openolat-lms: command failed. execution failed execution of cmd : id failed exit code: 127. working directory was: /home/aboud/netbeansprojects/openolat hg installation seems valid , complete. hg version: na (ok) -> [help 1] see full stack trace of errors, re-run maven -e switch. re-run maven using -x switch enable full debug logging. more information errors , possible solutions, please read following articles: [help 1] http://cwiki.apache.org/confluence/display/maven/mojoexecutionexception and here's full stack trace of errors when run mvn -e clean install at org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:217) @ org.apache.maven.lifecycle.internal.mojoexecutor.exec

variables - moving average function matlab (without the use of a for loop) -

i trying complete matlab assignment project following question: write function called moving_average takes scalar called x input argument , returns scalar. function uses “buffer” hold previous inputs, , buffer can hold maximum of 25 inputs. specifically, function must save recent 25 inputs in vector (the buffer). each time function called, copies input argument element of buffer. if there 25 inputs stored in buffer, discards oldest element , saves current 1 in buffer. after has stored input in buffer, returns mean of elements in buffer. the solution provide following: function ma = moving_average (x) persistent buffer; if isempty(buffer) buffer = x; ma = mean(x); else buffer = [buffer x]; if numel(buffer) <= 25 ma = mean(buffer); else ma = mean([buffer(end-24) buffer(end)]); end end according auto grader function performs correctly when values 1-50 passing consecutively, fails when values of noisy s

ios - Core Audio - Write data to beginning or middle of audio file (somewhere other than the end) -

so, have audio recording ios app working on. in app have need write audio @ point in file (in documents directory) user chooses, overwrite whatever audio there. example: record 3 min of audio, scroll minute two, start recording again 10 seconds. now, 2:00 - 2:10 contains new audio, , old audio gone (the audio file not longer in example). i using ezaudio , can record , pause many times want , keep appending end. going use extaudiofileseek seek backward in file , record there, can use when file open read-only. what don't want: don't want record different file, , append 2 files using method: https://stackoverflow.com/a/10562809/1391672 there significant loading time associated this. ios app voice memos appends files instantaneously. can extaudiofilewriteasync used append audio @ beginning? or @ specified sample location? there method should at? i think extaudiofileseek undefined when recording. use audiofile api extaudiofile built upon. catch have own form

php - trigger with multiple action and loop -

Image
i have 3 tables in database. - train_information - axle - bogie when fill in form, information gets filled in train_information table, , looks then: now, see number_of_axles 4. the tables axle , bogie this. axle : bogie : as can see, trigger inserts 3 wich should axle table only. in bogie table, want add 4. here example: this needs in 1 trigger aswell. because mysql version not support multiple triggers same action (after insert). the axle trigger working. how looks: all need add loop inside existing trigger as delimiter // create trigger train_information_ins after insert on train_information each row begin declare x int ; declare y int ; if(new.number_of_axies > 0 ) set x = 1 ; while x < new.number_of_axies insert axle (train_id,axle) values (new.train_id,x); set x=x+1; end while ; set y=1; while y <= new.number_of_axies insert bogie (train_id,axle_nr) values (ne

c# - Dictionary to anonymous object -

i have dictionary collection, string, int. want convert dictionary anonymous object properties collection keys , anonymous object propertie's values dictionary values. way it? thank you are looking this? var keyvals = dict.select(kv => new { key = kv.key, value = kv.value }); but can't imagine use case this. why prefer anonymous type on available dictionary?

java - request the .war file on the remote server -

i have implemented jersey server-side part android app. have tested jersey postman chrome extension url: http://localhost:8080/serverside/webapi/data and getting response. i tested android app php file url: url myurl = new url("http://byethost.com/index.php"); and getting response too. now have exported jersey project .war file , has name serverside.war and put on remote server in htdocs directory , trying request url: http://byethost.com/serverside/webapi/data from postman getting 404 not found ? which url have use request .war file serverside on remote server postman chrome extension? i appreaciate help.

richtextbox - Salesforce Rich text field to full mode feature -

with of below link have implemented how convert salesforce rich text editor "full mode" editor? but having issue ,either in dev mode or not page keep on refreshing , rich text flickering. any idea why happening

javascript - Why does SauceLabs say my QUnit Test Fails when its clearly passing? -

Image
we trying use saucelabs verify our browser-based qunit tests passing in popular device/browser combinations ... the tests pass when @ them in browser: https://ordenado.herokuapp.com/ but reason saucelabs telling "failed"... see: https://saucelabs.com/tests/5b0f07813a7f4934bb44b07606ea2fd5 curl command used for reference, used following curl command: curl https://saucelabs.com/rest/v1/ordem/js-tests \ -x post \ -u ordem:secret_key \ -h 'content-type: application/json' \ --data '{ "platforms": [ ["windows 8.1", "internet explorer", "11"], ["windows 8", "internet explorer", "10"], ["windows 8.1", "firefox", "beta"], ["windows 8", "firefox", "37"], ["windows 7", "firefox", "32"], ["os x 10.8", "safari", "6"], [&quo

go - How to do database migration with Beego framework? -

i need add new field existing table, correct process beego? i familiar django's south: first generate migration script manage.py schema_migration , execute migration script manage.py migrate . beego has command bee generate migration generate migration script in database/migrations/xxx.go . don't understand how use generated script, doesn't seem connected anything. and don't see documentation mentioning migration. came across same issue, i'm using mysql. here how i've done it- created migration file using bee generate : $ bee generate migration user 2016/06/26 13:36:31 [info] using 'user' migration name 2016/06/26 13:36:32 [info] migration file generated: /path/to/project/database/migrations/20160626_140247_user.go 2016/06/26 13:36:32 [succ] generate created! now file generated , below content of file: package main import ( "github.com/astaxie/beego/migration" ) // not modify type user_20160626_140247 struct {

angularjs - ASP.NET MVC View not rendering with layout after form post using angular -

i'm routing views using ngroute , not having particular issues rendering views. problem having when post method , passing list view. site/page renders view no layout. typing address bar http://localhost:7351/page works , provides layout no view. if post form in http://localhost:7351/main browser url changes http://localhost:7351/site/page , displays results without layout. form in view main <form method="post" action="site/page"> <input id="chk_main" type="checkbox" /> <input type=submit> </form> routeconfig routes.maproute( name: "page", url: "site/page", defaults: new { controller = "site", action = "page" } ); edit: if change "url: site/page" "url: page" layout show, view won't. controller public actionresult index() { return view(); } public actionresult main() { return view(persons); } [httppost] pub

How to dynamically fill the structure which is a pointer to pointer of arrays in C++ implementing xfs -

structure 1: typedef struct _wfs_cdm_cu_info { ushort ustellerid; ushort uscount; lpwfscdmcashunit * lpplist; } wfscdmcuinfo, * lpwfscdmcuinfo; structure 2: typedef struct _wfs_cdm_cashunit { ushort usnumber; ushort ustype; lpstr lpszcashunitname; char cunitid[5]; char ccurrencyid[3]; ulong ulvalues; ulong ulinitialcount; ulong ulcount; ulong ulrejectcount; ulong ulminimum; ulong ulmaximum; bool bapplock; ushort usstatus; ushort usnumphysicalcus; lpwfscdmphcu * lppphysical; } wfscdmcashunit, * lpwfscdmcashunit; structure 3: typedef struct _wfs_cdm_physicalcu { lpstr lpphysicalpositionname; char cunitid[5]; ulong ulinitialcount; ulong ulcount; ulong ulrejectcount; ulong ulmaximum; ushort uspstatus; bool bhardwaresensor; } wfscdmphcu, * lpwfscdmphcu; the code: lpwfscdmcuinfo lpwfscdmcuinf = null; lpwfscdmcashunit lpwfscdmcashunit = null; lpwfscdmphcu

c# - Two PPT Presentation is opening instead of one while running through VISUAL STUDIO 2010 -

Image
i facing problem not able carve out solution. have written program in powerpoint presentation 2 slides developed using c#. when run program working fine blank powerpoint presentation created ( presentation2.pptx ). not able understand why blank presentation created. please me through this. below code: private void thisaddin_startup(object sender, system.eventargs e) { dataset ds = new dataset(); sqlconnection con = new sqlconnection(@"data source=*****;initial catalog=******;user id=****;password=******"); sqlcommand sqlcomm = new sqlcommand("powerpointtest", con); sqlcomm.commandtype = commandtype.storedprocedure; sqldataadapter da = new sqldataadapter(); da.selectcommand = sqlcomm; da.fill(ds); powerpoint.application pptapplication = new powerpoint.application(); microsoft.office.interop.powerpoint.slides slides; microsoft.office.interop.powerpoint._slide slide;